Class PlainNumberVariableValueArgument.LongParser<C>

java.lang.Object
rocks.gravili.notquests.paper.commands.arguments.variables.PlainNumberVariableValueArgument.LongParser<C>
All Implemented Interfaces:
cloud.commandframework.arguments.parser.ArgumentParser<C,Long>
Enclosing class:
PlainNumberVariableValueArgument<C>

public static final class PlainNumberVariableValueArgument.LongParser<C> extends Object implements cloud.commandframework.arguments.parser.ArgumentParser<C,Long>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Constant for the default/unset maximum value.
    static final long
    Constant for the default/unset minimum value.

    Fields inherited from interface cloud.commandframework.arguments.parser.ArgumentParser

    DEFAULT_ARGUMENT_COUNT
  • Constructor Summary

    Constructors
    Constructor
    Description
    LongParser(long min, long max, NotQuests main)
    Construct a new Long parser
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the maximum value accepted by this parser
    long
    Get the minimum value accepted by this parser
    static @NonNull List<@NonNull String>
    getSuggestions(long min, long max, @NonNull String input)
    Get Long suggestions.
    boolean
    Get whether this parser has a maximum set.
    boolean
    Get whether this parser has a minimum set.
    boolean
     
    @NonNull cloud.commandframework.arguments.parser.ArgumentParseResult<Long>
    parse(@NonNull cloud.commandframework.context.CommandContext<C> commandContext, @NonNull Queue<@NonNull String> inputQueue)
     
    @NonNull List<@NonNull String>
    suggestions(@NonNull cloud.commandframework.context.CommandContext<C> commandContext, @NonNull String input)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface cloud.commandframework.arguments.parser.ArgumentParser

    getRequestedArgumentCount, map
  • Field Details

    • DEFAULT_MINIMUM

      public static final long DEFAULT_MINIMUM
      Constant for the default/unset minimum value.
      Since:
      1.5.0
      See Also:
    • DEFAULT_MAXIMUM

      public static final long DEFAULT_MAXIMUM
      Constant for the default/unset maximum value.
      Since:
      1.5.0
      See Also:
  • Constructor Details

    • LongParser

      public LongParser(long min, long max, NotQuests main)
      Construct a new Long parser
      Parameters:
      min - Minimum acceptable value
      max - Maximum acceptable value
  • Method Details

    • getSuggestions

      public static @NonNull List<@NonNull String> getSuggestions(long min, long max, @NonNull String input)
      Get Long suggestions. This supports both positive and negative numbers
      Parameters:
      min - Minimum value
      max - Maximum value
      input - Input
      Returns:
      List of suggestions
    • parse

      public @NonNull cloud.commandframework.arguments.parser.ArgumentParseResult<Long> parse(@NonNull cloud.commandframework.context.CommandContext<C> commandContext, @NonNull Queue<@NonNull String> inputQueue)
      Specified by:
      parse in interface cloud.commandframework.arguments.parser.ArgumentParser<C,Long>
    • getMin

      public long getMin()
      Get the minimum value accepted by this parser
      Returns:
      Min value
    • getMax

      public long getMax()
      Get the maximum value accepted by this parser
      Returns:
      Max value
    • hasMax

      public boolean hasMax()
      Get whether this parser has a maximum set. This will compare the parser's maximum to DEFAULT_MAXIMUM.
      Returns:
      whether the parser has a maximum set
      Since:
      1.5.0
    • hasMin

      public boolean hasMin()
      Get whether this parser has a minimum set. This will compare the parser's minimum to DEFAULT_MINIMUM.
      Returns:
      whether the parser has a maximum set
      Since:
      1.5.0
    • isContextFree

      public boolean isContextFree()
      Specified by:
      isContextFree in interface cloud.commandframework.arguments.parser.ArgumentParser<C,Long>
    • suggestions

      public @NonNull List<@NonNull String> suggestions(@NonNull cloud.commandframework.context.CommandContext<C> commandContext, @NonNull String input)
      Specified by:
      suggestions in interface cloud.commandframework.arguments.parser.ArgumentParser<C,Long>