Class 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.
    • 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 name
        aliases - 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