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

      public T parse(CommandSender sender, 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 ArgumentParserType parser()
      Specified by:
      parser in class Argument<T extends Number>
    • nodeProperties

      public byte @Nullable [] nodeProperties()
      Overrides:
      nodeProperties in class Argument<T extends Number>
    • min

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

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

      public ArgumentNumber<T> between(T min, 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

      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

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

      protected String parseValue(String value)
    • getRadix

      protected int getRadix(String value)
    • removeScientificNotation

      @Nullable protected @Nullable String removeScientificNotation(String value)