Class AbstractArgument<T>
java.lang.Object
io.github.mqzn.commands.arguments.AbstractArgument<T>
- Type Parameters:
T- the data type of the argument parameter
- All Implemented Interfaces:
Argument<T>
- Direct Known Subclasses:
ArgumentBoolean,ArgumentEnum,ArgumentLiteral,ArgumentNumber,ArgumentStringArray,ArgumentWord
This class represents an argument as a command-syntax
parameter to be used in usages and context parsing
-
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 !The description of an argumentdescription(@Nullable String description) booleaninthashCode()id()The id of the Required argumentbooleansetDefaultValue(T value) Modifies the default value of the argumentvoidsetOptional(boolean optional) toString()type()The type of the argumentbooleanWhether the argument can become greedy and use the remaining args till the end of the argsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mqzn.commands.arguments.Argument
alternativeTypes, isSuggestionDynamic, parse
-
Field Details
-
suggestions
-
-
Constructor Details
-
AbstractArgument
-
AbstractArgument
-
AbstractArgument
-
AbstractArgument
-
-
Method Details
-
id
The id of the Required argument -
description
The description of an argument- Specified by:
descriptionin interfaceArgument<T>- Returns:
- the description for usage
-
type
The type of the argument -
defaultValue
Description copied from interface:ArgumentThe 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:
defaultValuein interfaceArgument<T>- Returns:
- The default value of this argument
-
setDefaultValue
Description copied from interface:ArgumentModifies the default value of the argument- Specified by:
setDefaultValuein interfaceArgument<T>- Parameters:
value- the new default value
-
isOptional
public boolean isOptional()- Specified by:
isOptionalin interfaceArgument<T>
-
setOptional
public void setOptional(boolean optional) - Specified by:
setOptionalin 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:
useRemainingSpacein interfaceArgument<T>- Returns:
- Whether the argument can become greedy * and use the remaining args till the end of the args
-
description
- Specified by:
descriptionin interfaceArgument<T>
-
suggest
-
suggestions
- Specified by:
suggestionsin interfaceArgument<T>
-
suggest
-
toString
-
toString
-
equals
-
hashCode
public int hashCode()
-