Class EnumArgument.EnumParser<C,​E extends java.lang.Enum<E>>

  • All Implemented Interfaces:
    ArgumentParser<C,​E>
    Enclosing class:
    EnumArgument<C,​E extends java.lang.Enum<E>>

    public static final class EnumArgument.EnumParser<C,​E extends java.lang.Enum<E>>
    extends java.lang.Object
    implements ArgumentParser<C,​E>
    • Constructor Summary

      Constructors 
      Constructor Description
      EnumParser​(@NonNull java.lang.Class<E> enumClass)
      Construct a new enum parser
    • Method Summary

      Modifier and Type Method Description
      boolean isContextFree()
      Check whether or not this argument parser is context free.
      @NonNull ArgumentParseResult<E> parse​(@NonNull CommandContext<C> commandContext, @NonNull java.util.Queue<@NonNull java.lang.String> inputQueue)
      Parse command input into a command result
      @NonNull java.util.List<@NonNull java.lang.String> suggestions​(@NonNull CommandContext<C> commandContext, @NonNull java.lang.String input)
      Get a list of suggested arguments that would be correctly parsed by this parser
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EnumParser

        public EnumParser​(@NonNull java.lang.Class<E> enumClass)
        Construct a new enum parser
        Parameters:
        enumClass - Enum class
    • Method Detail

      • parse

        public @NonNull ArgumentParseResult<E> parse​(@NonNull CommandContext<C> commandContext,
                                                     @NonNull java.util.Queue<@NonNull java.lang.String> inputQueue)
        Description copied from interface: ArgumentParser
        Parse command input into a command result
        Specified by:
        parse in interface ArgumentParser<C,​E extends java.lang.Enum<E>>
        Parameters:
        commandContext - Command context
        inputQueue - The queue of arguments
        Returns:
        Parsed command result
      • suggestions

        public @NonNull java.util.List<@NonNull java.lang.String> suggestions​(@NonNull CommandContext<C> commandContext,
                                                                              @NonNull java.lang.String input)
        Description copied from interface: ArgumentParser
        Get a list of suggested arguments that would be correctly parsed by this parser
        Specified by:
        suggestions in interface ArgumentParser<C,​E extends java.lang.Enum<E>>
        Parameters:
        commandContext - Command context
        input - Input string
        Returns:
        List of suggestions
      • isContextFree

        public boolean isContextFree()
        Description copied from interface: ArgumentParser
        Check whether or not this argument parser is context free. A context free parser will not use the provided command context, and so supports impromptu parsing
        Specified by:
        isContextFree in interface ArgumentParser<C,​E extends java.lang.Enum<E>>
        Returns:
        true if the parser is context free, else false