Class ByteArgument.ByteParser<C>

  • All Implemented Interfaces:
    ArgumentParser<C,​java.lang.Byte>
    Enclosing class:
    ByteArgument<C>

    public static final class ByteArgument.ByteParser<C>
    extends java.lang.Object
    implements ArgumentParser<C,​java.lang.Byte>
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteParser​(byte min, byte max)
      Construct a new byte parser
    • Method Summary

      Modifier and Type Method Description
      byte getMax()
      Get the max value
      byte getMin()
      Get the min value
      boolean isContextFree()
      Check whether or not this argument parser is context free.
      @NonNull ArgumentParseResult<java.lang.Byte> 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

      • ByteParser

        public ByteParser​(byte min,
                          byte max)
        Construct a new byte parser
        Parameters:
        min - Minimum value
        max - Maximum value
    • Method Detail

      • parse

        public @NonNull ArgumentParseResult<java.lang.Byte> 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,​java.lang.Byte>
        Parameters:
        commandContext - Command context
        inputQueue - The queue of arguments
        Returns:
        Parsed command result
      • 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,​java.lang.Byte>
        Returns:
        true if the parser is context free, else false
      • 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,​java.lang.Byte>
        Parameters:
        commandContext - Command context
        input - Input string
        Returns:
        List of suggestions
      • getMax

        public byte getMax()
        Get the max value
        Returns:
        Max value
      • getMin

        public byte getMin()
        Get the min value
        Returns:
        Min value