public static final class Parser.Builder extends java.lang.Object implements SmithyBuilder<Parser>
Parser
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Parser.Builder |
argument(Parser.Argument argument)
Adds an argument.
|
Parser |
build()
Creates an immutable object that is created from the properties
that have been set on the builder.
|
Parser.Builder |
option(java.lang.String longName,
java.lang.String help)
Adds an option argument that accepts no value.
|
Parser.Builder |
option(java.lang.String shortName,
java.lang.String longName,
java.lang.String help)
Adds an option argument that accepts no value.
|
Parser.Builder |
parameter(java.lang.String longName,
java.lang.String help)
Adds an argument that accepts a single value.
|
Parser.Builder |
parameter(java.lang.String shortName,
java.lang.String longName,
java.lang.String help)
Adds an argument that accepts a single value.
|
Parser.Builder |
positional(java.lang.String name,
java.lang.String help)
Configures the name of positional arguments that come after options
and parameters.
|
Parser.Builder |
repeatedParameter(java.lang.String longName,
java.lang.String help)
Adds an argument that accepts a value that can be repeated.
|
Parser.Builder |
repeatedParameter(java.lang.String shortName,
java.lang.String longName,
java.lang.String help)
Adds an argument that accepts a value that can be repeated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
requiredState
public Parser build()
SmithyBuilder
build
in interface SmithyBuilder<Parser>
public Parser.Builder positional(java.lang.String name, java.lang.String help)
name
- Name of the positional argument.help
- Positional argument help text.public Parser.Builder argument(Parser.Argument argument)
argument
- Argument to add.public Parser.Builder option(java.lang.String shortName, java.lang.String longName, java.lang.String help)
shortName
- Short name (e.g., -o).longName
- Long name (e.g., --output).help
- Help text for the option.public Parser.Builder option(java.lang.String longName, java.lang.String help)
longName
- Long name (e.g., --output).help
- Help text for the option.public Parser.Builder parameter(java.lang.String shortName, java.lang.String longName, java.lang.String help)
shortName
- Short nam (e.g., -o).longName
- Long name (e.g., --output).help
- Help text for the parameter.public Parser.Builder parameter(java.lang.String longName, java.lang.String help)
longName
- Long name (e.g., --output).help
- Help text for the parameter.public Parser.Builder repeatedParameter(java.lang.String shortName, java.lang.String longName, java.lang.String help)
shortName
- Short nam (e.g., -o).longName
- Long name (e.g., --output).help
- Help text for the parameter.public Parser.Builder repeatedParameter(java.lang.String longName, java.lang.String help)
longName
- Long name (e.g., --output).help
- Help text for the parameter.