Interface ArgumentResolver<S,T>
- Type Parameters:
S- the type of the senderT- 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 TypeMethodDescriptiondefault intgetWidth()The number of arguments this resolver consumes.Resolves the parameter value from the given arguments.Provides a list of tab-completion suggestions for this parameter.
-
Method Details
-
resolve
Resolves the parameter value from the given arguments.- Parameters:
sender- the sender executing the commandargs- the complete list of arguments passed to the commandcurrent- the current argument string being resolved- Returns:
- the resolved parameter value
- Throws:
Exception- if resolution fails
-
suggest
Provides a list of tab-completion suggestions for this parameter.- Parameters:
sender- the sender tab-completing the commandargs- the complete list of arguments entered so farcurrent- 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
-