Interface Parameter.FirstOfBuilder
-
- All Superinterfaces:
Buildable.Builder<Parameter.Multi>
,Builder<Parameter.Multi,Parameter.FirstOfBuilder>
,ResettableBuilder<Parameter.Multi,Parameter.FirstOfBuilder>
- Enclosing interface:
- Parameter
public static interface Parameter.FirstOfBuilder extends Builder<Parameter.Multi,Parameter.FirstOfBuilder>
Specifies a builder for creating aParameter
that returns a parameter that concatenates all parameters into a single parameter to be executed one by one.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Parameter.Multi
build()
Creates aParameter.Multi
from the builder.Parameter.FirstOfBuilder
optional()
Sets that this parameter is weak optional and will be ignored if it cannot parse the next element(s).Parameter.FirstOfBuilder
or(Parameter parameter)
Adds a parameter that can be used to parse an argument.default Parameter.FirstOfBuilder
orFirstOf(@NonNull Iterable<Parameter> parameters)
Adds a set ofParameter
s to this builder.default Parameter.FirstOfBuilder
orFirstOf(Parameter @NonNull ... parameters)
Adds a set ofParameter
s to this builder.Parameter.FirstOfBuilder
terminal()
Sets that this parameter is optional, and will be ignored if it isn't specified - but will throw an error if this is passed something to parse that it cannot parse.
-
-
-
Method Detail
-
terminal
Parameter.FirstOfBuilder terminal()
Sets that this parameter is optional, and will be ignored if it isn't specified - but will throw an error if this is passed something to parse that it cannot parse.- Returns:
- This builder, for chaining
-
optional
Parameter.FirstOfBuilder optional()
Sets that this parameter is weak optional and will be ignored if it cannot parse the next element(s).- Returns:
- This builder, for chaining
-
or
Parameter.FirstOfBuilder or(Parameter parameter)
Adds a parameter that can be used to parse an argument. Parameters are checked in the order they are added to the builder.- Parameters:
parameter
- The parameter- Returns:
- This builder, for chaining
-
orFirstOf
default Parameter.FirstOfBuilder orFirstOf(Parameter @NonNull ... parameters)
Adds a set ofParameter
s to this builder.The parameters will be parsed in the provided order until one succeeds.
- Parameters:
parameters
- The parameters to add- Returns:
- This builder, for chaining
-
orFirstOf
default Parameter.FirstOfBuilder orFirstOf(@NonNull Iterable<Parameter> parameters)
Adds a set ofParameter
s to this builder.The parameters will be parsed in the provided order until one succeeds.
- Parameters:
parameters
- The parameters to add- Returns:
- This builder, for chaining
-
build
Parameter.Multi build()
Creates aParameter.Multi
from the builder.- Specified by:
build
in interfaceBuildable.Builder<Parameter.Multi>
- Returns:
- The
Parameter.Multi
-
-