Class IntegerArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,Integer>
cloud.commandframework.arguments.standard.IntegerArgument<C>
- All Implemented Interfaces:
CloudKeyHolder<Integer>
,Comparable<CommandArgument<?,?>>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static 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 TypeMethodDescriptionint
getMax()
Get the maximum accepted integer that could have been parsedint
getMin()
Get the minimum accepted integer that could have been parsedstatic <C> @NonNull IntegerArgument.Builder<C>
newBuilder(@NonNull String name)
Create a newIntegerArgument.Builder
.static <C> @NonNull CommandArgument<C,Integer>
Create a new requiredIntegerArgument
.static <C> @NonNull CommandArgument<C,Integer>
Create a new optionalIntegerArgument
.static <C> @NonNull CommandArgument<C,Integer>
Create a new requiredIntegerArgument
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 newIntegerArgument.Builder
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the argument- Returns:
- Created builder
-
of
Create a new requiredIntegerArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
Create a new optionalIntegerArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,Integer> optional(@NonNull String name, int defaultNum)Create a new requiredIntegerArgument
with the specified default value.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namedefaultNum
- Default value- Returns:
- Created argument
-
getMin
public int getMin()Get the minimum accepted integer that could have been parsed- Returns:
- Minimum integer
-
getMax
public int getMax()Get the maximum accepted integer that could have been parsed- Returns:
- Maximum integer
-