Class AbstractArgument<T>
java.lang.Object
io.github.mqzn.commands.arguments.AbstractArgument<T>
- All Implemented Interfaces:
Argument<T>
- Direct Known Subclasses:
ArgumentBoolean
,ArgumentEnum
,ArgumentLiteral
,ArgumentNumber
,ArgumentStringArray
,ArgumentWord
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractArgument
(@NotNull ArgumentData data, Class<T> type) AbstractArgument
(@NotNull String id, @NotNull Class<T> type) AbstractArgument
(@NotNull String id, @NotNull Class<T> type, boolean optional, boolean useRemainingSpace) AbstractArgument
(String id, Class<T> type, boolean useRemainingSpace) -
Method Summary
Modifier and TypeMethodDescriptionThe default value of this argument if the default value is null, means it has no default values, so it's a REQUIRED argument !id()
The id of the Required argumentboolean
setDefaultValue
(T value) Modifies the default value of the argumentvoid
setOptional
(boolean optional) type()
The type of the argumentboolean
Whether the argument can become greedy and use the remaining args till the end of the argsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.mqzn.commands.arguments.Argument
alternativeTypes, isSuggestionDynamic, parse, suggest
-
Field Details
-
suggestions
-
-
Constructor Details
-
AbstractArgument
-
AbstractArgument
-
AbstractArgument
-
AbstractArgument
-
-
Method Details
-
id
The id of the Required argument -
type
The type of the argument -
defaultValue
Description copied from interface:Argument
The default value of this argument if the default value is null, means it has no default values, so it's a REQUIRED argument !- Specified by:
defaultValue
in interfaceArgument<T>
- Returns:
- The default value of this argument
-
setDefaultValue
Description copied from interface:Argument
Modifies the default value of the argument- Specified by:
setDefaultValue
in interfaceArgument<T>
- Parameters:
value
- the new default value
-
isOptional
public boolean isOptional()- Specified by:
isOptional
in interfaceArgument<T>
-
setOptional
public void setOptional(boolean optional) - Specified by:
setOptional
in interfaceArgument<T>
-
asOptional
-
useRemainingSpace
public boolean useRemainingSpace()Whether the argument can become greedy and use the remaining args till the end of the args- Specified by:
useRemainingSpace
in interfaceArgument<T>
- Returns:
- Whether the argument can become greedy * and use the remaining args till the end of the args
-
suggest
-
suggestions
- Specified by:
suggestions
in interfaceArgument<T>
-
toString
-