Class ArgumentNumber<T extends Number>

java.lang.Object
io.github.mqzn.commands.arguments.AbstractArgument<T>
io.github.mqzn.commands.arguments.ArgumentNumber<T>
Type Parameters:
T - the type of the number
All Implemented Interfaces:
Argument<T>
Direct Known Subclasses:
ArgumentDouble, ArgumentFloat, ArgumentInteger, ArgumentLong

public abstract class ArgumentNumber<T extends Number> extends AbstractArgument<T>
A class that represents any numeric argument
  • Field Details

  • Method Details

    • parse

      @NotNull public T parse(@NotNull @NotNull String command, @NotNull @NotNull String input) throws ArgumentParseException
      Throws:
      ArgumentParseException
    • min

      @NotNull public @NotNull ArgumentNumber<T> min(@NotNull T value)
    • max

      @NotNull public @NotNull ArgumentNumber<T> max(@NotNull T value)
    • between

      @NotNull public @NotNull ArgumentNumber<T> between(@NotNull T min, @NotNull T max)
    • hasMin

      public boolean hasMin()
      Gets if the argument has a minimum.
      Returns:
      true if the argument has a minimum
    • getMin

      @NotNull public T getMin()
      Gets the minimum value for this argument.
      Returns:
      the minimum of this argument
    • hasMax

      public boolean hasMax()
      Gets if the argument has a maximum.
      Returns:
      true if the argument has a maximum
    • getMax

      @NotNull public T getMax()
      Gets the maximum value for this argument.
      Returns:
      the maximum of this argument
    • parseValue

      @NotNull protected @NotNull String parseValue(@NotNull @NotNull String value)
    • getRadix

      protected int getRadix(@NotNull @NotNull String value)
    • removeScientificNotation

      @Nullable protected @Nullable String removeScientificNotation(@NotNull @NotNull String value)
    • increment

      public abstract T increment(T num)
    • getParser

      public Function<String,T> getParser()