Class ShortArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,Short>
cloud.commandframework.arguments.standard.ShortArgument<C>
- All Implemented Interfaces:
CloudKeyHolder<Short>
,Comparable<CommandArgument<?,
?>>
@API(status=STABLE,
since="1.5.0")
public final class ShortArgument<C>
extends CommandArgument<C,Short>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static final class
Nested classes/interfaces inherited from class cloud.commandframework.arguments.CommandArgument
CommandArgument.TypedBuilder<C,
T, B extends CommandArgument.Builder<C, T>> -
Method Summary
Modifier and TypeMethodDescriptionshort
getMax()
Get the maximum accepted short that could have been parsedshort
getMin()
Get the minimum accepted short that could have been parsedstatic <C> @NonNull ShortArgument.Builder<C>
newBuilder
(@NonNull String name) Create a newShortArgument.Builder
.static <C> @NonNull CommandArgument<C,
Short> Create a new requiredShortArgument
.static <C> @NonNull CommandArgument<C,
Short> Create a new optionalShortArgument
.static <C> @NonNull CommandArgument<C,
Short> Create a new requiredShortArgument
with the specified default value.Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultDescription, getDefaultValue, getKey, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
Method Details
-
newBuilder
Create a newShortArgument.Builder
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the argument- Returns:
- Created builder
-
of
Create a new requiredShortArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
Create a new optionalShortArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,Short> optional(@NonNull String name, short defaultNum) Create a new requiredShortArgument
with the specified default value.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namedefaultNum
- Default value- Returns:
- Created argument
-
getMin
public short getMin()Get the minimum accepted short that could have been parsed- Returns:
- Minimum short
-
getMax
public short getMax()Get the maximum accepted short that could have been parsed- Returns:
- Maximum short
-