public final class OptionUtil extends Object
Constructor and Description |
---|
OptionUtil() |
Modifier and Type | Method and Description |
---|---|
static StringBuffer |
describeParameterizable(StringBuffer buf,
Class<?> pcls,
int width,
String indent)
Format a description of a Parameterizable (including recursive options).
|
static void |
formatForConsole(StringBuffer buf,
int width,
String indent,
Collection<Pair<Object,Parameter<?,?>>> options)
Format a list of options (and associated owning objects) for console help
output.
|
static <O extends Parameter<?,?>> |
optionsNamesToString(List<O> options)
Returns a string representation of the specified list of options containing
the names of the options.
|
static <O extends Parameter<?,?>> |
optionsNamesToString(O[] options)
Returns a string representation of the specified list of options containing
the names of the options.
|
static <N extends Parameter<?,?>> |
parameterNamesAndValuesToString(List<N> parameters)
Returns a string representation of the list of number parameters containing
the names and the values of the parameters.
|
static void |
println(StringBuffer buf,
int width,
String data,
String indent)
Simple writing helper with no indentation.
|
public static <O extends Parameter<?,?>> String optionsNamesToString(List<O> options)
O
- Option typeoptions
- the list of optionspublic static <O extends Parameter<?,?>> String optionsNamesToString(O[] options)
O
- Option typeoptions
- the list of optionspublic static <N extends Parameter<?,?>> String parameterNamesAndValuesToString(List<N> parameters)
N
- Parameter typeparameters
- the list of number parameterspublic static void formatForConsole(StringBuffer buf, int width, String indent, Collection<Pair<Object,Parameter<?,?>>> options)
buf
- Serialization bufferwidth
- Screen widthindent
- Indentation stringoptions
- List of optionspublic static void println(StringBuffer buf, int width, String data, String indent)
buf
- Buffer to write towidth
- Width to use for linewrapsdata
- Data to write.indent
- Indentationpublic static StringBuffer describeParameterizable(StringBuffer buf, Class<?> pcls, int width, String indent)
buf
- Buffer to append to.pcls
- Parameterizable class to describewidth
- Widthindent
- Text indent