Class RangedNumericField<N extends Number>

java.lang.Object
studio.mevera.imperat.selector.field.AbstractField<Range<N>>
studio.mevera.imperat.selector.field.RangedNumericField<N>
Type Parameters:
N - The type of the numeric value that this field handles, which extends Number.
All Implemented Interfaces:
SelectionField<Range<N>>

public final class RangedNumericField<N extends Number> extends AbstractField<Range<N>>
RangedNumericField is a concrete implementation of AbstractField that handles numeric fields with range values. The range is represented using the Range class, which allows specifying minimum and/or maximum bounds.
  • Field Details

  • Method Details

    • of

      public static <N extends Number> RangedNumericField<N> of(NumericField<N> numericField)
    • parseFieldValue

      public Range<N> parseFieldValue(String value, studio.mevera.imperat.context.CommandContext<BukkitCommandSource> context) throws studio.mevera.imperat.exception.CommandException
      Parses the given string representation of the value and converts it into the field's value type.
      Parameters:
      value - the string representation of the value to be parsed
      context - the context of the execution
      Returns:
      the parsed value of the field's type
      Throws:
      studio.mevera.imperat.exception.CommandException - if the parsing fails