com.github.nill14.shellformat
Class ShellFormat
java.lang.Object
com.github.nill14.shellformat.ShellFormat
public class ShellFormat
- extends Object
ShellFormat supports variable replace. Variables are in form ${beer} or $milk.
Multiline formatting is preserved. Variable could expand into string with variables.
Missing variables are erased.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dictionary
public static ShellDictionary dictionary()
- Returns:
- a new ShellDictionary builder
dictionary
public static ShellDictionary dictionary(String... arguments)
- Parameters:
arguments - the pairs of (key, value)
- Returns:
- a new ShellDictionary builder
getDictionary
public Map<String,Object> getDictionary()
- Returns:
- the actual dictionary (immutable)
multiline
public static String multiline(String... lines)
- Composes a multi-line string from input lines.
- Parameters:
lines - the parts of final string
- Returns:
- compiled string concatenated by newlines
format
public String format(String pattern)
- Parameters:
pattern - a pattern to format
- Returns:
- the formatted string
format
public String format(String... lines)
- Parameters:
lines - the pattern lines to format
- Returns:
- the formatted string
Copyright © 2013. All Rights Reserved.