Class IntegerArgument<C>
- java.lang.Object
-
- cloud.commandframework.arguments.CommandArgument<C,java.lang.Integer>
-
- cloud.commandframework.arguments.standard.IntegerArgument<C>
-
- All Implemented Interfaces:
java.lang.Comparable<CommandArgument<?,?>>
public final class IntegerArgument<C> extends CommandArgument<C,java.lang.Integer>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntegerArgument.Builder<C>
static class
IntegerArgument.IntegerParseException
static class
IntegerArgument.IntegerParser<C>
-
Method Summary
Modifier and Type Method Description int
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 java.lang.String name)
Create a new builderstatic <C> @NonNull CommandArgument<C,java.lang.Integer>
of(@NonNull java.lang.String name)
Create a new required command argumentstatic <C> @NonNull CommandArgument<C,java.lang.Integer>
optional(@NonNull java.lang.String name)
Create a new optional command argumentstatic <C> @NonNull CommandArgument<C,java.lang.Integer>
optional(@NonNull java.lang.String name, int defaultNum)
Create a new required command argument with a default value-
Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultValue, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
-
-
-
Method Detail
-
newBuilder
public static <C> @NonNull IntegerArgument.Builder<C> newBuilder(@NonNull java.lang.String name)
Create a new builder- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the argument- Returns:
- Created builder
-
of
public static <C> @NonNull CommandArgument<C,java.lang.Integer> of(@NonNull java.lang.String name)
Create a new required command argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,java.lang.Integer> optional(@NonNull java.lang.String name)
Create a new optional command argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,java.lang.Integer> optional(@NonNull java.lang.String name, int defaultNum)
Create a new required command argument with a default value- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namedefaultNum
- Default num- 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
-
-