Class CommandFlag<T>
java.lang.Object
cloud.commandframework.arguments.flags.CommandFlag<T>
- Type Parameters:
T- Command argument type.Voidis used when no argument is present.
A flag is an optional command argument that may have an associated parser,
and is identified by its name. Essentially, it's a mixture of a command literal
and an optional variable command argument.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull Collection<@NonNull String>Get all flag aliases.@NonNull ArgumentDescriptionGet the flag description.@Nullable CommandArgument<?,T> Get the command argument, if it exists@NonNull DescriptionDeprecated.for removal since 1.4.0.@NonNull StringgetName()Get the flag nameinthashCode()@NonNull CommandFlag.FlagModemode()Returns themodeof this flag.static @NonNull CommandFlag.Builder<Void>newBuilder(@NonNull String name) Create a new flag builderGet the permission required to use this flag, if it existstoString()
-
Method Details
-
newBuilder
Create a new flag builder- Parameters:
name- Flag name- Returns:
- Flag builder
-
getName
Get the flag name- Returns:
- Flag name
-
getAliases
Get all flag aliases. This does not include the flag name- Returns:
- Flag aliases
-
mode
Returns themodeof this flag.- Returns:
- the flag mode
-
getDescription
Deprecated.for removal since 1.4.0. UsegetArgumentDescription()instead.Get the flag description- Returns:
- Flag description
-
getArgumentDescription
Get the flag description.- Returns:
- Flag description
- Since:
- 1.4.0
-
getCommandArgument
Get the command argument, if it exists- Returns:
- Command argument, or
null
-
permission
Get the permission required to use this flag, if it exists- Returns:
- Command permission, or
null - Since:
- 1.6.0
-
toString
-
equals
-
hashCode
public int hashCode()
-