Interface VariableValueParameters.LiteralBuilder<T>
- All Superinterfaces:
AbstractBuilder<ValueParameter<T>>,Builder<ValueParameter<T>,,VariableValueParameters.LiteralBuilder<T>> ResettableBuilder<ValueParameter<T>,VariableValueParameters.LiteralBuilder<T>>
- Enclosing class:
VariableValueParameters
public static interface VariableValueParameters.LiteralBuilder<T>
extends Builder<ValueParameter<T>,VariableValueParameters.LiteralBuilder<T>>
A builder that creates
ValueParameters that requires a specific
sequence of arguments.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Tests for validity and creates thisValueParameter.default VariableValueParameters.LiteralBuilder<T> literal(Collection<String> literal) Sets the sequence of strings that need to be matched at runtime.literal(Supplier<? extends Collection<String>> literalSupplier) Sets aSupplierthat provides the sequence of strings that need to be matched at runtime.returnValue(Supplier<T> returnValueSupplier) Sets aSupplierthat provides the object to return if this parameter parses correctly.default VariableValueParameters.LiteralBuilder<T> returnValue(T returnValue) Sets the object to return if this parameter parses correctly.
-
Method Details
-
literal
VariableValueParameters.LiteralBuilder<T> literal(Supplier<? extends Collection<String>> literalSupplier) Sets aSupplierthat provides the sequence of strings that need to be matched at runtime.Consumers of the API should supply an ordered collection.
- Parameters:
literalSupplier- TheSupplier- Returns:
- This builder, for chaining
-
literal
Sets the sequence of strings that need to be matched at runtime.Consumers of the API should supply an ordered collection.
- Parameters:
literal- The sequence of elements- Returns:
- This builder, for chaining
-
returnValue
Sets aSupplierthat provides the object to return if this parameter parses correctly.- Parameters:
returnValueSupplier- TheSupplier- Returns:
- This builder, for chaining
-
returnValue
Sets the object to return if this parameter parses correctly.- Parameters:
returnValue- TheObject- Returns:
- This builder, for chaining
-
build
ValueParameter<T> build()Tests for validity and creates thisValueParameter.- Specified by:
buildin interfaceAbstractBuilder<T>- Returns:
- The
ValueParameter - Throws:
IllegalStateException- if the literal and the return object have not been specified
-