Class ArgumentNumber<T extends Number>
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<T>
net.minestom.server.command.builder.arguments.number.ArgumentNumber<T>
- Direct Known Subclasses:
ArgumentDouble, ArgumentFloat, ArgumentInteger, ArgumentLong
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Comparator<T> protected booleanprotected booleanprotected Tprotected Tprotected final NetworkBuffer.Type<T> static final intprotected final ArgumentParserTypeprotected final BiFunction<String, Integer, T> static final intstatic final intFields inherited from class Argument
allowSpace, suggestionType, useRemaining -
Method Summary
Modifier and TypeMethodDescriptiongetMax()Gets the maximum value for this argument.getMin()Gets the minimum value for this argument.byteCreates the byteflag based on the number's min/max existance.protected intbooleanhasMax()Gets if the argument has a maximum.booleanhasMin()Gets if the argument has a minimum.byte @Nullable []parse(CommandSender sender, String input) Parses the given input, and throw anArgumentSyntaxExceptionif the input cannot be converted toTparser()protected StringparseValue(String value) removeScientificNotation(String value) Methods inherited from class Argument
allowSpace, equals, filter, getCallback, getDefaultValue, getId, getSuggestionCallback, hasErrorCallback, hashCode, hasSuggestion, isOptional, map, map, parse, setCallback, setDefaultValue, setDefaultValue, setDefaultValue, setSuggestionCallback, suggestionType, useRemaining
-
Field Details
-
NOT_NUMBER_ERROR
public static final int NOT_NUMBER_ERROR- See Also:
-
TOO_LOW_ERROR
public static final int TOO_LOW_ERROR- See Also:
-
TOO_HIGH_ERROR
public static final int TOO_HIGH_ERROR- See Also:
-
hasMin
protected boolean hasMin -
hasMax
protected boolean hasMax -
min
-
max
-
parserName
-
radixParser
-
parser
-
networkType
-
comparator
-
-
Method Details
-
parse
Description copied from class:ArgumentParses the given input, and throw anArgumentSyntaxExceptionif the input cannot be converted toT- Specified by:
parsein classArgument<T extends Number>- Parameters:
input- the argument to parse- Returns:
- the parsed argument
- Throws:
ArgumentSyntaxException- ifvalueis not valid
-
parser
-
nodeProperties
- Overrides:
nodePropertiesin classArgument<T extends Number>
-
min
-
max
-
between
-
getNumberProperties
public byte getNumberProperties()Creates the byteflag based on the number's min/max existance.- Returns:
- A byteflag for argument specification.
-
hasMin
public boolean hasMin()Gets if the argument has a minimum.- Returns:
- true if the argument has a minimum
-
getMin
-
hasMax
public boolean hasMax()Gets if the argument has a maximum.- Returns:
- true if the argument has a maximum
-
getMax
-
parseValue
-
getRadix
-
removeScientificNotation
-