Package cloud.commandframework.arguments
Class StaticArgument<C>
- java.lang.Object
-
- cloud.commandframework.arguments.CommandArgument<C,java.lang.String>
-
- cloud.commandframework.arguments.StaticArgument<C>
-
- Type Parameters:
C
- Command sender type
- All Implemented Interfaces:
java.lang.Comparable<CommandArgument<?,?>>
public final class StaticArgument<C> extends CommandArgument<C,java.lang.String>
CommandArgument
type that recognizes fixed strings. This type does not parse variables.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class cloud.commandframework.arguments.CommandArgument
CommandArgument.Builder<C,T>
-
-
Method Summary
Modifier and Type Method Description @NonNull java.util.Set<@NonNull java.lang.String>
getAliases()
Get an immutable view of the aliases@NonNull java.util.List<@NonNull java.lang.String>
getAlternativeAliases()
Get an immutable list of all aliases that are not the main literalstatic <C> @NonNull StaticArgument<C>
of(@NonNull java.lang.String name, @NonNull java.lang.String... aliases)
Create a new static argument instance for a required command argumentvoid
registerAlias(@NonNull java.lang.String alias)
Register a new alias-
Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultValue, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
-
-
-
Method Detail
-
of
public static <C> @NonNull StaticArgument<C> of(@NonNull java.lang.String name, @NonNull java.lang.String... aliases)
Create a new static argument instance for a required command argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namealiases
- Argument aliases- Returns:
- Constructed argument
-
registerAlias
public void registerAlias(@NonNull java.lang.String alias)
Register a new alias- Parameters:
alias
- New alias
-
getAliases
public @NonNull java.util.Set<@NonNull java.lang.String> getAliases()
Get an immutable view of the aliases- Returns:
- Immutable view of the argument aliases
-
getAlternativeAliases
public @NonNull java.util.List<@NonNull java.lang.String> getAlternativeAliases()
Get an immutable list of all aliases that are not the main literal- Returns:
- Immutable view of the optional argument aliases
-
-