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:
java.io.Serializable
- Direct Known Subclasses:
ByteArgument.ByteParseException
,DoubleArgument.DoubleParseException
,FloatArgument.FloatParseException
,IntegerArgument.IntegerParseException
,LongArgument.LongParseException
,ShortArgument.ShortParseException
public abstract class NumberParseException extends ParserException
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NumberParseException(@NonNull java.lang.String input, @NonNull java.lang.Number min, @NonNull java.lang.Number max, @NonNull java.lang.Class<?> parserClass, @NonNull CommandContext<?> context)
Construct a new number parse exception
-
Method Summary
Modifier and Type Method Description @NonNull java.lang.String
getInput()
Get the input that failed to parsejava.lang.Number
getMax()
Get the maximum accepted integer that could have been parsedjava.lang.Number
getMin()
Get the minimum accepted integer that could have been parsedabstract @NonNull java.lang.String
getNumberType()
Get the number typeabstract boolean
hasMax()
If the parser had a maximum valueabstract boolean
hasMin()
If the parser had a minimum value-
Methods inherited from class cloud.commandframework.exceptions.parsing.ParserException
getArgumentParserClass, getContext, getMessage
-
-
-
-
Constructor Detail
-
NumberParseException
protected NumberParseException(@NonNull java.lang.String input, @NonNull java.lang.Number min, @NonNull java.lang.Number max, @NonNull java.lang.Class<?> parserClass, @NonNull CommandContext<?> context)
Construct a new number parse exception- Parameters:
input
- Inputmin
- Maximum valuemax
- Minimum valueparserClass
- Parser classcontext
- Command context
-
-
Method Detail
-
getNumberType
public abstract @NonNull java.lang.String 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
public @NonNull java.lang.String getInput()
Get the input that failed to parse- Returns:
- Input
-
getMin
public java.lang.Number getMin()
Get the minimum accepted integer that could have been parsed- Returns:
- Minimum integer
-
getMax
public java.lang.Number getMax()
Get the maximum accepted integer that could have been parsed- Returns:
- Maximum integer
-
-