Class NumberParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
cloud.commandframework.exceptions.parsing.ParserException
cloud.commandframework.exceptions.parsing.NumberParseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ByteArgument.ByteParseException
,DoubleArgument.DoubleParseException
,FloatArgument.FloatParseException
,IntegerArgument.IntegerParseException
,LongArgument.LongParseException
,ShortArgument.ShortParseException
- See Also:
- Serialized Form
-
Constructor Summary
ModifierConstructorDescriptionprotected
NumberParseException(@NonNull String input, @NonNull Number min, @NonNull Number max, @NonNull Class<?> parserClass, @NonNull CommandContext<?> context)
Construct a new number parse exception -
Method Summary
Modifier and TypeMethodDescription@NonNull String
getInput()
Get the input that failed to parsegetMax()
Get the maximum accepted integer that could have been parsedgetMin()
Get the minimum accepted integer that could have been parsedabstract @NonNull String
Get the number typeabstract boolean
hasMax()
If the parser had a maximum valueabstract boolean
hasMin()
If the parser had a minimum valueMethods inherited from class cloud.commandframework.exceptions.parsing.ParserException
captionVariables, errorCaption, getArgumentParserClass, getContext, getMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NumberParseException
protected NumberParseException(@NonNull String input, @NonNull Number min, @NonNull Number max, @NonNull Class<?> parserClass, @NonNull CommandContext<?> context)Construct a new number parse exception- Parameters:
input
- Inputmin
- Maximum valuemax
- Minimum valueparserClass
- Parser classcontext
- Command context
-
-
Method Details
-
getNumberType
Get the number type- Returns:
- Number type
-
hasMax
public abstract boolean hasMax()If the parser had a maximum value- Returns:
true
if there was a maximum value, elsefalse
-
hasMin
public abstract boolean hasMin()If the parser had a minimum value- Returns:
true
if there was a minimum value, elsefalse
-
getInput
Get the input that failed to parse- Returns:
- Input
-
getMin
Get the minimum accepted integer that could have been parsed- Returns:
- Minimum integer
-
getMax
Get the maximum accepted integer that could have been parsed- Returns:
- Maximum integer
-