Class NumberParseException

    • 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 parse
      java.lang.Number getMax()
      Get the maximum accepted integer that could have been parsed
      java.lang.Number getMin()
      Get the minimum accepted integer that could have been parsed
      abstract @NonNull java.lang.String getNumberType()
      Get the number type
      abstract boolean hasMax()
      If the parser had a maximum value
      abstract boolean hasMin()
      If the parser had a minimum value
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 - Input
        min - Maximum value
        max - Minimum value
        parserClass - Parser class
        context - 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, 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 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