Package studio.mevera.imperat.context
Interface FlagData<S extends CommandSource>
- All Known Implementing Classes:
FlagData.FlagDataImpl
Represents a flag that has been parsed/read/loaded from a
context of a command entered by the
CommandSource
A flag has merely 2 types: 1) A true flag is a flag that has an input value next to it in the raw input 2) A switch (flag that it's value input is represented by its mere presence
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordFlagData.FlagDataImpl<S extends CommandSource> -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanacceptsInput(String input) aliases()static <S extends CommandSource,T>
FlagData<S>create(String name, List<String> alias, ArgumentType<S, T> inputType) static <S extends CommandSource>
FlagData<S>createSwitch(String name, List<String> aliases) default Stringformat()default boolean<T> @Nullable ArgumentType<S,T> default booleanisSwitch()@NotNull Stringname()The main name of the flag
-
Method Details
-
create
static <S extends CommandSource,T> FlagData<S> create(String name, List<String> alias, ArgumentType<S, T> inputType) -
createSwitch
-
name
The main name of the flag- Returns:
- the name(unique) of the flag
-
aliases
- Returns:
- the alias of the flag
-
inputType
- Returns:
- the valueType of input from the flag
-
hasAlias
-
format
-
acceptsInput
-
isSwitch
default boolean isSwitch()
-