public static final class OptionFormatter.Builder extends Object implements Supplier<OptionFormatter>
OptionFormatter.| Constructor | Description |
|---|---|
Builder(OptionFormatter optionFormatter) |
Constructor that takes the arguments from the supplied
OptionFormatter |
| Modifier and Type | Method | Description |
|---|---|---|
OptionFormatter |
build(Option option) |
Build an OptionFormatter to format the specified option.
|
OptionFormatter |
get() |
|
OptionFormatter.Builder |
setArgumentNameDelimiters(String begin,
String end) |
Specifies the starting and ending argument name delimiters for
Option instances. |
OptionFormatter.Builder |
setDefaultArgName(String name) |
Sets the default argument name.
|
OptionFormatter.Builder |
setDeprecatedFormatFunction(Function<Option,String> deprecatedFormatFunction) |
Specifies the function to construct the deprecated massage for the Option.
|
OptionFormatter.Builder |
setLongOptPrefix(String prefix) |
Sets the long option prefix.
|
OptionFormatter.Builder |
setOptArgSeparator(String optArgSeparator) |
Sets the separator displayed between a options and the argument name.
|
OptionFormatter.Builder |
setOptionalDelimiters(String begin,
String end) |
Specifies the starting and ending delimiters for optional
Option instances. |
OptionFormatter.Builder |
setOptPrefix(String optPrefix) |
Specifies the short option prefix.
|
OptionFormatter.Builder |
setOptSeparator(String optSeparator) |
Sets the separator displayed between a long option and short options.
|
OptionFormatter.Builder |
setSyntaxFormatFunction(BiFunction<OptionFormatter,Boolean,String> syntaxFormatFunction) |
Specifies the function to convert an
OptionFormatter into the syntax format for the option. |
String |
toArgName(String argName) |
A helper method to format any string as an argument name based on this builder.
|
public Builder(OptionFormatter optionFormatter)
OptionFormatteroptionFormatter - The option formatter to provide values for the builder.public OptionFormatter build(Option option)
option - The Option to format.public OptionFormatter get()
get in interface Supplier<OptionFormatter>public OptionFormatter.Builder setArgumentNameDelimiters(String begin, String end)
Option instances.begin - the beginning delimiter.end - the ending delimiter.this instance.public OptionFormatter.Builder setDefaultArgName(String name)
name - the new value of default argument name.public OptionFormatter.Builder setDeprecatedFormatFunction(Function<Option,String> deprecatedFormatFunction)
deprecatedFormatFunction - the function to specify the deprecated message for the option.this instance.public OptionFormatter.Builder setLongOptPrefix(String prefix)
prefix - prefix for long options.public OptionFormatter.Builder setOptArgSeparator(String optArgSeparator)
optArgSeparator - the separator.public OptionFormatter.Builder setOptionalDelimiters(String begin, String end)
Option instances.begin - the beginning delimiter.end - the ending delimiter.this instance.public OptionFormatter.Builder setOptPrefix(String optPrefix)
optPrefix - the prefix for short options.this instance.public OptionFormatter.Builder setOptSeparator(String optSeparator)
optSeparator - the separator.public OptionFormatter.Builder setSyntaxFormatFunction(BiFunction<OptionFormatter,Boolean,String> syntaxFormatFunction)
OptionFormatter into the syntax format for the option.syntaxFormatFunction - The function to convert an OptionFormatter into the syntax format for the option.Copyright © 2002-2025 The Apache Software Foundation. All rights reserved.Apache Commons CLI | Issue management | Source repository