Interface ArgumentResolver<S,T>

Type Parameters:
S - the type of the sender
T - the target type of the resolved parameter

public interface ArgumentResolver<S,T>
Resolver for command parameter arguments. Converts string command arguments into Java types and provides tab-completion suggestions.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    The number of arguments this resolver consumes.
    resolve(S sender, String[] args, String current)
    Resolves the parameter value from the given arguments.
    default List<String>
    suggest(S sender, String[] args, String current)
    Provides a list of tab-completion suggestions for this parameter.
  • Method Details

    • resolve

      T resolve(S sender, String[] args, String current) throws Exception
      Resolves the parameter value from the given arguments.
      Parameters:
      sender - the sender executing the command
      args - the complete list of arguments passed to the command
      current - the current argument string being resolved
      Returns:
      the resolved parameter value
      Throws:
      Exception - if resolution fails
    • suggest

      default List<String> suggest(S sender, String[] args, String current)
      Provides a list of tab-completion suggestions for this parameter.
      Parameters:
      sender - the sender tab-completing the command
      args - the complete list of arguments entered so far
      current - the current argument string being completed
      Returns:
      a list of suggestions
    • getWidth

      default int getWidth()
      The number of arguments this resolver consumes. Defaults to 1.
      Returns:
      the width of the resolver