Package redempt.ordinate.creation
Class DefaultComponentFactory<T>
java.lang.Object
redempt.ordinate.creation.DefaultComponentFactory<T>
- All Implemented Interfaces:
ComponentFactory<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V> ArgumentComponent<T,
V> createArgument
(ArgType<T, V> type, String name) createBooleanFlag
(String... names) <V> ConstraintComponent<T,
V> createConstraint
(Constraint<T, V> constraint, Supplier<Integer> index, String name) <V> ConsumingArgumentComponent<T,
V> createConsumingArgument
(ArgType<T, V> type, boolean optional, ContextProvider<T, V> defaultValue, String name) <V> ContextComponent<T,
V> createContext
(ContextProvider<T, V> provider, String name) createDispatch
(CommandDispatcher<T> dispatcher) <V> FlagComponent<T,
V> createFlag
(String[] names, ArgType<T, V> type, ContextProvider<T, V> defaultValue) createLookupComponent
(List<Command<T>> commands) <V extends Number & Comparable<V>>
ConstraintParser<T,V> createNumberConstraintParser
(Function<String, V> parseNumber) <V> OptionalArgumentComponent<T,
V> createOptionalArgument
(ArgType<T, V> type, ContextProvider<T, V> defaultValue, String name) <V> VariableLengthArgumentComponent<T,
V> createVariableLengthArgument
(ArgType<T, V> type, boolean optional, String name)
-
Constructor Details
-
DefaultComponentFactory
-
-
Method Details
-
createArgument
- Specified by:
createArgument
in interfaceComponentFactory<T>
-
createOptionalArgument
public <V> OptionalArgumentComponent<T,V> createOptionalArgument(ArgType<T, V> type, ContextProvider<T, V> defaultValue, String name) - Specified by:
createOptionalArgument
in interfaceComponentFactory<T>
-
createConsumingArgument
public <V> ConsumingArgumentComponent<T,V> createConsumingArgument(ArgType<T, V> type, boolean optional, ContextProvider<T, V> defaultValue, String name) - Specified by:
createConsumingArgument
in interfaceComponentFactory<T>
-
createVariableLengthArgument
public <V> VariableLengthArgumentComponent<T,V> createVariableLengthArgument(ArgType<T, V> type, boolean optional, String name) - Specified by:
createVariableLengthArgument
in interfaceComponentFactory<T>
-
createBooleanFlag
- Specified by:
createBooleanFlag
in interfaceComponentFactory<T>
-
createFlag
public <V> FlagComponent<T,V> createFlag(String[] names, ArgType<T, V> type, ContextProvider<T, V> defaultValue) - Specified by:
createFlag
in interfaceComponentFactory<T>
-
createContext
- Specified by:
createContext
in interfaceComponentFactory<T>
-
createDispatch
- Specified by:
createDispatch
in interfaceComponentFactory<T>
-
createConstraint
public <V> ConstraintComponent<T,V> createConstraint(Constraint<T, V> constraint, Supplier<Integer> index, String name) - Specified by:
createConstraint
in interfaceComponentFactory<T>
-
createLookupComponent
- Specified by:
createLookupComponent
in interfaceComponentFactory<T>
-
createNumberConstraintParser
public <V extends Number & Comparable<V>> ConstraintParser<T,V> createNumberConstraintParser(Function<String, V> parseNumber) - Specified by:
createNumberConstraintParser
in interfaceComponentFactory<T>
-