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>
-
Field Summary
Modifier and TypeFieldDescriptionstatic 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
-
Method Summary
Modifier and TypeMethodDescriptionlong
getMax()
Get the maximum value accepted by this parserlong
getMin()
Get the minimum value accepted by this parsergetSuggestions
(long min, long max, @NonNull String input) Get Long suggestions.boolean
hasMax()
Get whether this parser has a maximum set.boolean
hasMin()
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) 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_MINIMUMConstant for the default/unset minimum value.- Since:
- 1.5.0
- See Also:
-
DEFAULT_MAXIMUM
public static final long DEFAULT_MAXIMUMConstant for the default/unset maximum value.- Since:
- 1.5.0
- See Also:
-
-
Constructor Details
-
LongParser
Construct a new Long parser- Parameters:
min
- Minimum acceptable valuemax
- 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 valuemax
- Maximum valueinput
- Input- Returns:
- List of suggestions
-
parse
-
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 toDEFAULT_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 toDEFAULT_MINIMUM
.- Returns:
- whether the parser has a maximum set
- Since:
- 1.5.0
-
isContextFree
public boolean isContextFree() -
suggestions
-