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.
See Also:
  • Method Details

    • input

      @NotNull @NotNull @Unmodifiable List<String> 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

      @NotNull <A extends CommandActor> A actor()
      Returns the command actor that executed this command.
      Type Parameters:
      A - The actor type.
      Returns:
      The command actor
    • parameter

      @NotNull @NotNull CommandParameter parameter()
      Returns the current parameter being resolved
      Returns:
      The parameter being resolved
    • command

      @NotNull @NotNull ExecutableCommand command()
      Returns the command being executed
      Returns:
      The command being executed
    • commandHandler

      @NotNull @NotNull CommandHandler commandHandler()
      Returns the owning CommandHandler of this resolver.
      Returns:
      The command handler
    • getResolvedArgument

      @NotNull <T> T getResolvedArgument(@NotNull @NotNull Class<T> type)
      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 an IllegalStateException.
      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

      @NotNull <T> T getResolvedParameter(@NotNull @NotNull CommandParameter parameter)
      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 an IllegalStateException.
      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.