public class OptionUtils extends Object
| Constructor and Description |
|---|
OptionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
backQuoteChars(String string)
Converts carriage returns and new lines in a string into \r and \n.
|
static String |
backQuoteChars(String string,
char[] find,
String[] replace)
Converts specified characters into the string equivalents.
|
static String |
displayNameToFlag(String name)
Turns a camel case display name of a property into a commandline flag
that uses lowercase and hyphens.
|
static String |
joinOptions(String[] optionArray)
Joins all the options in an option array into a single string,
as might be used on the command line.
|
static String[] |
splitOptions(String quotedOptionString)
Split up a string containing options into an array of strings,
one for each option.
|
static String |
unbackQuoteChars(String string)
The inverse operation of backQuoteChars().
|
static String |
unbackQuoteChars(String string,
String[] find,
char[] replace)
The inverse operation of backQuoteChars().
|
public static String backQuoteChars(String string, char[] find, String[] replace)
string - the stringfind - the characters to replacereplace - the replacement strings for the charactersunbackQuoteChars(String, String[], char[])public static String backQuoteChars(String string)
string - the stringunbackQuoteChars(String)public static String unbackQuoteChars(String string, String[] find, char[] replace)
string - the stringfind - the string to findreplace - the character equivalents of the stringsbackQuoteChars(String, char[], String[])public static String unbackQuoteChars(String string)
string - the stringbackQuoteChars(String)public static String[] splitOptions(String quotedOptionString) throws Exception
quotedOptionString - the string containing the optionsException - in case of an unterminated string, unknown character or
a parse errorpublic static String joinOptions(String[] optionArray)
optionArray - the array of optionsCopyright © 2017 University of Waikato, Hamilton, NZ. All Rights Reserved.