Class OptionalArgumentComponent<T,V>
java.lang.Object
redempt.ordinate.component.abstracts.CommandComponent<T>
redempt.ordinate.component.argument.ArgumentComponent<T,V>
redempt.ordinate.component.argument.OptionalArgumentComponent<T,V>
- All Implemented Interfaces:
HelpProvider<T>
,Named
-
Constructor Summary
ConstructorDescriptionOptionalArgumentComponent
(String name, ArgType<T, V> type, ContextProvider<T, V> defaultValue, MessageFormatter<T> invalidError, MessageFormatter<T> contextError) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHelp
(HelpBuilder<T> help) int
boolean
parse
(CommandContext<T> context) Methods inherited from class redempt.ordinate.component.argument.ArgumentComponent
complete, getInvalidError, getMaxConsumedArgs, getMaxParsedObjects, getMissingError, getName, getPriority, getType, setType
-
Constructor Details
-
OptionalArgumentComponent
public OptionalArgumentComponent(String name, ArgType<T, V> type, ContextProvider<T, V> defaultValue, MessageFormatter<T> invalidError, MessageFormatter<T> contextError)
-
-
Method Details
-
isOptional
public boolean isOptional()- Overrides:
isOptional
in classArgumentComponent<T,
V>
-
getMinConsumedArgs
public int getMinConsumedArgs()- Overrides:
getMinConsumedArgs
in classCommandComponent<T>
-
parse
- Overrides:
parse
in classArgumentComponent<T,
V>
-
addHelp
- Specified by:
addHelp
in interfaceHelpProvider<T>
- Overrides:
addHelp
in classArgumentComponent<T,
V>
-