Package revxrsal.commands.process
Interface ValueResolver.ValueResolverContext
- All Superinterfaces:
ParameterResolver.ParameterResolverContext
- Enclosing interface:
- ValueResolver<T>
public static interface ValueResolver.ValueResolverContext
extends ParameterResolver.ParameterResolverContext
Represents the resolving context of
ValueResolver
. This contains
all the relevant information about the resolving context.-
Method Summary
Modifier and TypeMethodDescriptionReturns the command arguments passed to the command.pop()
Returns (and removes) the first value in theargument stack
.byte
popByte()
Returns (and removes) the first value in theargument stack
and parses it into a byte.double
Returns (and removes) the first value in theargument stack
and parses it into a double.float
popFloat()
Returns (and removes) the first value in theargument stack
and parses it into a float.Returns (and removes) the string in which might get concatenated with the rest of the arguments if theParameterResolver.ParameterResolverContext.parameter()
consumes all strings that follow it.int
popInt()
Returns (and removes) the first value in theargument stack
and parses it into an integer.long
popLong()
Returns (and removes) the first value in theargument stack
and parses it into a long.short
popShort()
Returns (and removes) the first value in theargument stack
and parses it into a short.Methods inherited from interface revxrsal.commands.process.ParameterResolver.ParameterResolverContext
actor, command, commandHandler, getResolvedArgument, getResolvedParameter, input, parameter
-
Method Details
-
arguments
ArgumentStack arguments()Returns the command arguments passed to the command.This stack may have been modified by previous resolvers, and there is no guarantee that its content matches the actor input.
To access the original, unmodified input of the actor, see
ParameterResolver.ParameterResolverContext.input()
.- Returns:
- The argument stack
-
popForParameter
String popForParameter()Returns (and removes) the string in which might get concatenated with the rest of the arguments if theParameterResolver.ParameterResolverContext.parameter()
consumes all strings that follow it.This is equivilent to calling
arguments().popForParameter(parameter())
- Returns:
- The string for this parameter. Will return the first argument if the parameter cannot consume all strings.
- See Also:
-
pop
String pop()Returns (and removes) the first value in theargument stack
.- Returns:
- The first value.
- Throws:
NoSuchElementException
- if the stack is empty
-
popInt
int popInt()Returns (and removes) the first value in theargument stack
and parses it into an integer.- Returns:
- The first value, as an int.
- Throws:
NoSuchElementException
- if the stack is emptyInvalidNumberException
- if an invalid number is inputted
-
popDouble
double popDouble()Returns (and removes) the first value in theargument stack
and parses it into a double.- Returns:
- The first value, as a double.
- Throws:
NoSuchElementException
- if the stack is emptyInvalidNumberException
- if an invalid number is inputted
-
popByte
byte popByte()Returns (and removes) the first value in theargument stack
and parses it into a byte.- Returns:
- The first value, as a byte.
- Throws:
NoSuchElementException
- if the stack is emptyInvalidNumberException
- if an invalid number is inputted
-
popShort
short popShort()Returns (and removes) the first value in theargument stack
and parses it into a short.- Returns:
- The first value, as a short.
- Throws:
NoSuchElementException
- if the stack is emptyInvalidNumberException
- if an invalid number is inputted
-
popFloat
float popFloat()Returns (and removes) the first value in theargument stack
and parses it into a float.- Returns:
- The first value, as a float.
- Throws:
NoSuchElementException
- if the stack is emptyInvalidNumberException
- if an invalid number is inputted
-
popLong
long popLong()Returns (and removes) the first value in theargument stack
and parses it into a long.- Returns:
- The first value, as a long.
- Throws:
NoSuchElementException
- if the stack is emptyInvalidNumberException
- if an invalid number is inputted
-