Class NumericParameterDecorator<S extends Source>
java.lang.Object
studio.mevera.imperat.command.parameters.InputParameter<S>
studio.mevera.imperat.annotations.parameters.NumericParameterDecorator<S>
- All Implemented Interfaces:
DescriptionHolder,CommandParameter<S>,NumericParameter<S>,PermissionHolder
public final class NumericParameterDecorator<S extends Source>
extends InputParameter<S>
implements NumericParameter<S>
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.parameters.InputParameter
description, flag, format, greedy, index, name, optional, optionalValueSupplier, parentCommand, permission, suggestionResolver, type -
Method Summary
Modifier and TypeMethodDescriptioncopyWithDifferentPosition(int newPosition) Creates a copy of this parameter with a different position.static <S extends Source>
NumericParameterDecorator<S>decorate(@NotNull CommandParameter<S> parameter, @NotNull NumericRange range) format()Formats the usage parameter using the command@Nullable NumericRangegetRange()Methods inherited from class studio.mevera.imperat.command.parameters.InputParameter
addPermission, asCommand, asFlagParameter, describe, description, equals, getDefaultValueSupplier, getPermissions, getSinglePermission, getSuggestionResolver, hashCode, isFlag, isGreedy, isGreedyString, isOptional, name, parent, parent, position, position, setFormat, setSinglePermission, similarTo, toString, type, wrappedTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface studio.mevera.imperat.command.parameters.CommandParameter
asAnnotated, asCommand, asFlagParameter, asNumeric, getDefaultValueSupplier, getSinglePermission, getSuggestionResolver, isAnnotated, isCommand, isFlag, isGreedy, isGreedyString, isNumeric, isOptional, isRequired, name, parent, parent, position, position, setFormat, setSinglePermission, similarTo, type, valueType, wrappedTypeMethods inherited from interface studio.mevera.imperat.command.DescriptionHolder
describe, describe, descriptionMethods inherited from interface studio.mevera.imperat.command.parameters.NumericParameter
hasRange, matchesRangeMethods inherited from interface studio.mevera.imperat.command.PermissionHolder
addPermission, getPermissions, hasPermission
-
Method Details
-
decorate
public static <S extends Source> NumericParameterDecorator<S> decorate(@NotNull @NotNull CommandParameter<S> parameter, @NotNull @NotNull NumericRange range) -
format
Formats the usage parameter using the command- Specified by:
formatin interfaceCommandParameter<S extends Source>- Overrides:
formatin classInputParameter<S extends Source>- Returns:
- the formatted parameter
- See Also:
-
getRange
- Specified by:
getRangein interfaceNumericParameter<S extends Source>- Returns:
- The actual range of the numeric parameter returns null if no range is specified!
-
copyWithDifferentPosition
Creates a copy of this parameter with a different position. Useful for commands that have multiple syntaxes.- Specified by:
copyWithDifferentPositionin interfaceCommandParameter<S extends Source>- Parameters:
newPosition- the new position to set- Returns:
- a copy of this parameter with the new position
-