Class CommandFlag<T>
java.lang.Object
cloud.commandframework.arguments.flags.CommandFlag<T>
- Type Parameters:
T
- Command argument type.Void
is 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
Modifier and TypeClassDescriptionstatic final class
static enum
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@NonNull Collection<@NonNull String>
Get all flag aliases.@NonNull ArgumentDescription
Get the flag description.@Nullable CommandArgument<?,
T> Get the command argument, if it exists@NonNull Description
Deprecated.for removal since 1.4.0.@NonNull String
getName()
Get the flag nameint
hashCode()
@NonNull CommandFlag.FlagMode
mode()
Returns themode
of 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 themode
of 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()
-