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>>
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 Summary
FieldsFields inherited from class studio.mevera.imperat.selector.field.AbstractField
name, suggestions, typeFields inherited from interface studio.mevera.imperat.selector.field.SelectionField
SEPARATOR, VALUE_EQUALS -
Method Summary
Modifier and TypeMethodDescriptionstatic <N extends Number>
RangedNumericField<N>of(NumericField<N> numericField) parseFieldValue(String value, studio.mevera.imperat.context.CommandContext<BukkitCommandSource> context) Parses the given string representation of the value and converts it into the field's value type.Methods inherited from class studio.mevera.imperat.selector.field.AbstractField
getName, getSuggestions, getValueType
-
Field Details
-
ALL
-
-
Method Details
-
of
-
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 parsedcontext- the context of the execution- Returns:
- the parsed value of the field's type
- Throws:
studio.mevera.imperat.exception.CommandException- if the parsing fails
-