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 protectedNumberParseException(@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.StringgetInput()Get the input that failed to parsejava.lang.NumbergetMax()Get the maximum accepted integer that could have been parsedjava.lang.NumbergetMin()Get the minimum accepted integer that could have been parsedabstract @NonNull java.lang.StringgetNumberType()Get the number typeabstract booleanhasMax()If the parser had a maximum valueabstract booleanhasMin()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:
trueif there was a maximum value, elsefalse
-
hasMin
public abstract boolean hasMin()
If the parser had a minimum value- Returns:
trueif 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
-
-