Interface FlagData<S extends Source>

All Known Implementing Classes:
FlagData.FlagDataImpl

@AvailableSince("1.0.0") public interface FlagData<S extends Source>
Represents a flag that has been parsed/read/loaded from a context of a command entered by the Source

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

  • Method Details

    • create

      static <S extends Source, T> FlagData<S> create(String name, List<String> alias, ParameterType<S,T> inputType, boolean free)
    • create

      static <S extends Source, T> FlagData<S> create(String name, List<String> alias, ParameterType<S,T> inputType)
    • createSwitch

      static <S extends Source> FlagData<S> createSwitch(String name, List<String> aliases)
    • name

      @NotNull @NotNull String name()
      The main name of the flag
      Returns:
      the name(unique) of the flag
    • aliases

      @NotNull @NotNull List<String> aliases()
      Returns:
      the alias of the flag
    • isFree

      boolean isFree()
      Returns:
      whether the flag is free
    • inputType

      @Nullable <T> @Nullable ParameterType<S,T> inputType()
      Returns:
      the valueType of input from the flag
    • hasAlias

      default boolean hasAlias(String alias)
    • format

      default String format()
    • acceptsInput

      default boolean acceptsInput(String input)
    • isSwitch

      default boolean isSwitch()