Interface Argument<T>
- All Known Implementing Classes:
AbstractArgument
,ArgumentBoolean
,ArgumentDouble
,ArgumentEnum
,ArgumentFloat
,ArgumentInteger
,ArgumentLiteral
,ArgumentLong
,ArgumentNumber
,ArgumentStringArray
,ArgumentWord
public interface Argument<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault Class<?>[]
static ArgumentStringArray
static ArgumentBoolean
Boolean
(@NotNull ArgumentData data) static ArgumentBoolean
The default value of this argument if the default value is null, means it has no default values, so it's a REQUIRED argument !static ArgumentDouble
Double
(@NotNull ArgumentData data) static ArgumentDouble
static <E extends Enum<E>>
ArgumentEnum<E>Enum
(ArgumentData data, Class<E> enumClass) static <E extends Enum<E>>
ArgumentEnum<E>static ArgumentFloat
Float
(@NotNull ArgumentData data) static ArgumentFloat
id()
The id of the Required argumentstatic ArgumentInteger
integer
(@NotNull ArgumentData data) static ArgumentInteger
default boolean
static ArgumentLiteral
literal
(@NotNull ArgumentData data) static ArgumentLiteral
static ArgumentLong
Long
(ArgumentData id) static ArgumentLong
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 argsstatic ArgumentWord
word
(@NotNull ArgumentData data) static ArgumentWord
-
Method Details
-
literal
-
word
-
Boolean
-
integer
-
Double
-
Float
-
Long
-
Array
-
Enum
-
literal
-
word
-
Boolean
-
integer
-
Double
-
Float
-
Long
-
Enum
-
id
String id()The id of the Required argument- Returns:
- the id of the Required argument
-
type
The type of the argument- Returns:
- the class type of the argument
-
useRemainingSpace
boolean useRemainingSpace()Whether the argument can become greedy and use the remaining args till the end of the args- Returns:
- Whether the argument can become greedy * and use the remaining args till the end of the args
-
defaultValue
The default value of this argument if the default value is null, means it has no default values, so it's a REQUIRED argument !- Returns:
- The default value of this argument
-
setDefaultValue
Modifies the default value of the argument- Parameters:
value
- the new default value
-
parse
T parse(@NotNull @NotNull Command<?> command, @NotNull @NotNull String input) throws ArgumentParseException - Throws:
ArgumentParseException
-
isOptional
default boolean isOptional() -
setOptional
void setOptional(boolean optional) -
suggest
-
suggestions
-
alternativeTypes
-