Package org.incendo.cloud.parser.flag
Class CommandFlag<T>
java.lang.Object
org.incendo.cloud.parser.flag.CommandFlag<T>
- Type Parameters:
T- Command component type.Voidis used when no component is present.
A flag is an optional command component 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 component.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the flag aliases, not including thename().static <C> @NonNull CommandFlag.Builder<C, Void> Create a newCommandFlag.Builder.Returns the command component, if this is a value flag.Returns the flag description.booleaninthashCode()mode()Returns themodeof this flag.name()Returns the name of the flag.Returns the permission required to use this flag, if it exists.toString()
-
Method Details
-
builder
@API(status=STABLE) public static <C> @NonNull CommandFlag.Builder<C,Void> builder(@NonNull String name) Create a newCommandFlag.Builder.- Type Parameters:
C- command sender type- Parameters:
name- flag name- Returns:
- new
CommandFlag.Builder
-
name
Returns the name of the flag.- Returns:
- flag name
-
aliases
Returns the flag aliases, not including thename().- Returns:
- flag aliases
-
mode
Returns themodeof this flag.- Returns:
- the flag mode
-
description
Returns the flag description.- Returns:
- flag description
-
commandComponent
Returns the command component, if this is a value flag.- Returns:
- command component, or
nullif this is a presence flag
-
permission
Returns the permission required to use this flag, if it exists.- Returns:
- Command permission, or
null
-
toString
-
equals
-
hashCode
public int hashCode()
-