Class FlagCommandParameter<S extends Source>
java.lang.Object
studio.mevera.imperat.command.parameters.InputParameter<S>
studio.mevera.imperat.command.parameters.FlagCommandParameter<S>
- All Implemented Interfaces:
DescriptionHolder,CommandParameter<S>,FlagParameter<S>,PermissionHolder
@Internal
public final class FlagCommandParameter<S extends Source>
extends InputParameter<S>
implements FlagParameter<S>
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.parameters.InputParameter
description, 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.flagData()format()Formats the usage parameter, the default value is the name of the parameter@NotNull OptionalValueSupplier@Nullable SuggestionResolver<S>Methods inherited from class studio.mevera.imperat.command.parameters.InputParameter
addPermission, asCommand, asFlagParameter, describe, description, equals, 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, getSinglePermission, getSuggestionResolver, isAnnotated, isCommand, 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.FlagParameter
inputValueType, isFlag, isSwitchMethods inherited from interface studio.mevera.imperat.command.PermissionHolder
addPermission, getPermissions, hasPermission
-
Method Details
-
format
Description copied from interface:CommandParameterFormats the usage parameter, the default value is the name of the parameter- Specified by:
formatin interfaceCommandParameter<S extends Source>- Overrides:
formatin classInputParameter<S extends Source>- Returns:
- the formatted parameter
- See Also:
-
flagData
- Specified by:
flagDatain interfaceFlagParameter<S extends Source>- Returns:
- The flag's data
-
getDefaultValueSupplier
- Specified by:
getDefaultValueSupplierin interfaceCommandParameter<S extends Source>- Overrides:
getDefaultValueSupplierin classInputParameter<S extends Source>- Returns:
- the default value if it's input is not present in case of the parameter being optional
-
inputSuggestionResolver
- Specified by:
inputSuggestionResolverin interfaceFlagParameter<S extends Source>- Returns:
- the
SuggestionResolverfor input value of this flag null if the flag is switch, check usingFlagParameter.isSwitch()
-
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
-