Package revxrsal.commands.process
Interface ParameterResolver.ParameterResolverContext
- All Known Subinterfaces:
ContextResolver.ContextResolverContext
,ValueResolver.ValueResolverContext
- Enclosing interface:
- ParameterResolver<T>
public static interface ParameterResolver.ParameterResolverContext
Represents the resolving context of a
CommandParameter
. This contains
all the relevant information about the resolving context.-
Method Summary
Modifier and TypeMethodDescription<A extends CommandActor>
Aactor()
Returns the command actor that executed this command.@NotNull ExecutableCommand
command()
Returns the command being executed@NotNull CommandHandler
Returns the owningCommandHandler
of this resolver.<T> T
getResolvedArgument
(@NotNull Class<T> type) Returns the last resolved value of the given parameter type.<T> T
getResolvedParameter
(@NotNull CommandParameter parameter) Returns the last resolved value of the given parameter type.input()
Returns the exact input of the actor.@NotNull CommandParameter
Returns the current parameter being resolved
-
Method Details
-
input
Returns the exact input of the actor. This collection represents the tokenized list from the input, without it being modified by resolvers.- Returns:
- The actor's input to the command.
-
actor
Returns the command actor that executed this command.- Type Parameters:
A
- The actor type.- Returns:
- The command actor
-
parameter
Returns the current parameter being resolved- Returns:
- The parameter being resolved
-
command
Returns the command being executed- Returns:
- The command being executed
-
commandHandler
Returns the owningCommandHandler
of this resolver.- Returns:
- The command handler
-
getResolvedArgument
Returns the last resolved value of the given parameter type. If no parameter matches the given type, or if the parameter was not resolved yet, this will throw anIllegalStateException
.- Type Parameters:
T
- The resolved type- Parameters:
type
- The parameter type to fetch for.- Returns:
- The last resolved value matching the given type.
- Throws:
IllegalStateException
- If no parameter of this type was resolved.
-
getResolvedParameter
Returns the last resolved value of the given parameter type. If no parameter matches the given type, or if the parameter was not resolved yet, this will throw anIllegalStateException
.- Type Parameters:
T
- The resolved type- Parameters:
parameter
- The parameter to fetch for.- Returns:
- The last resolved value matching the given type.
- Throws:
IllegalStateException
- If no parameter of this type was resolved.
-