Package software.amazon.smithy.cli
Class Parser.Builder
java.lang.Object
software.amazon.smithy.cli.Parser.Builder
- All Implemented Interfaces:
SmithyBuilder<Parser>
- Enclosing class:
- Parser
Builds an
Parser
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionargument
(Parser.Argument argument) Adds an argument.build()
Creates an immutable object that is created from the properties that have been set on the builder.Adds an option argument that accepts no value.Adds an option argument that accepts no value.Adds an argument that accepts a single value.Adds an argument that accepts a single value.positional
(String name, String help) Configures the name of positional arguments that come after options and parameters.repeatedParameter
(String longName, String help) Adds an argument that accepts a value that can be repeated.repeatedParameter
(String shortName, String longName, String help) Adds an argument that accepts a value that can be repeated.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceSmithyBuilder<Parser>
- Returns:
- an instance of T
-
positional
Configures the name of positional arguments that come after options and parameters.- Parameters:
name
- Name of the positional argument.help
- Positional argument help text.- Returns:
- Returns the builder.
-
argument
Adds an argument. Arguments appear before positional arguments.- Parameters:
argument
- Argument to add.- Returns:
- Returns the builder.
-
option
Adds an option argument that accepts no value.- Parameters:
shortName
- Short name (e.g., -o).longName
- Long name (e.g., --output).help
- Help text for the option.- Returns:
- Returns the builder.
-
option
Adds an option argument that accepts no value.- Parameters:
longName
- Long name (e.g., --output).help
- Help text for the option.- Returns:
- Returns the builder.
-
parameter
Adds an argument that accepts a single value.- Parameters:
shortName
- Short nam (e.g., -o).longName
- Long name (e.g., --output).help
- Help text for the parameter.- Returns:
- Returns the builder.
-
parameter
Adds an argument that accepts a single value.- Parameters:
longName
- Long name (e.g., --output).help
- Help text for the parameter.- Returns:
- Returns the builder.
-
repeatedParameter
Adds an argument that accepts a value that can be repeated.- Parameters:
shortName
- Short nam (e.g., -o).longName
- Long name (e.g., --output).help
- Help text for the parameter.- Returns:
- Returns the builder.
-
repeatedParameter
Adds an argument that accepts a value that can be repeated.- Parameters:
longName
- Long name (e.g., --output).help
- Help text for the parameter.- Returns:
- Returns the builder.
-