Class NumberParseException

All Implemented Interfaces:
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 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 - Input
      min - Maximum value
      max - Minimum value
      parserClass - Parser class
      context - Command context
  • Method Details

    • getNumberType

      public abstract @NonNull 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, else false
    • hasMin

      public abstract boolean hasMin()
      If the parser had a minimum value
      Returns:
      true if there was a minimum value, else false
    • getInput

      public @NonNull String getInput()
      Get the input that failed to parse
      Returns:
      Input
    • getMin

      public Number getMin()
      Get the minimum accepted integer that could have been parsed
      Returns:
      Minimum integer
    • getMax

      public Number getMax()
      Get the maximum accepted integer that could have been parsed
      Returns:
      Maximum integer