Class ArgumentNumber<T extends Number>

java.lang.Object
net.minestom.server.command.builder.arguments.Argument<T>
net.minestom.server.command.builder.arguments.number.ArgumentNumber<T>
Direct Known Subclasses:
ArgumentDouble, ArgumentFloat, ArgumentInteger, ArgumentLong

public class ArgumentNumber<T extends Number> extends Argument<T>
  • Field Details

  • Method Details

    • parse

      @NotNull public T parse(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String input) throws ArgumentSyntaxException
      Description copied from class: Argument
      Parses the given input, and throw an ArgumentSyntaxException if the input cannot be converted to T
      Specified by:
      parse in class Argument<T extends Number>
      Parameters:
      input - the argument to parse
      Returns:
      the parsed argument
      Throws:
      ArgumentSyntaxException - if value is not valid
    • parser

      public String parser()
      Specified by:
      parser in class Argument<T extends Number>
    • nodeProperties

      public byte @Nullable [] nodeProperties()
      Overrides:
      nodeProperties in class Argument<T extends Number>
    • 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)
    • getNumberProperties

      public byte getNumberProperties()
      Creates the byteflag based on the number's min/max existance.
      Returns:
      A byteflag for argument specification.
    • 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)