Interface ArgumentResolver<S,T>

Type Parameters:
S - sender type
T - resolved parameter type

public interface ArgumentResolver<S,T>
Converts string arguments into typed values and provides tab-completion suggestions.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Number of arguments this resolver consumes.
    resolve(S sender, String[] current, String[] context)
    Resolves a parameter value from the current argument.
    default List<String>
    suggest(S sender, String[] current, String[] context)
    Returns tab-completion suggestions.
  • Method Details

    • resolve

      T resolve(S sender, String[] current, String[] context) throws Exception
      Resolves a parameter value from the current argument.
      Parameters:
      sender - the command sender
      current - the argument array slice for this parameter type
      context - the full command argument array
      Returns:
      the resolved value
      Throws:
      Exception
    • suggest

      default List<String> suggest(S sender, String[] current, String[] context)
      Returns tab-completion suggestions. Default: empty.
      Parameters:
      sender - the command sender
      current - the argument array slice for this parameter type
      context - the full command argument array
      Returns:
      the list of suggestions
    • getWidth

      default int getWidth()
      Number of arguments this resolver consumes. Default: 1.