public final class MapArgumentConverter<T> extends java.lang.Object implements ArgumentConverter<T>
Modifier and Type | Method and Description |
---|---|
ConversionResult<T> |
convert(java.lang.String argument,
InjectedValueAccess context)
Converts the argument input to a collection of argument values.
|
net.kyori.text.Component |
describeAcceptableArguments()
Describe the arguments that can be provided to this converter.
|
static MapArgumentConverter<java.lang.String> |
forChoices(java.util.Set<java.lang.String> choices)
Construct a converter for simple string choices from a set.
|
static <T> MapArgumentConverter<T> |
from(java.util.Map<java.lang.String,T> map) |
java.util.List<java.lang.String> |
getSuggestions(java.lang.String input,
InjectedValueAccess context)
Given
input as the current input, provide some suggestions for the user. |
public static MapArgumentConverter<java.lang.String> forChoices(java.util.Set<java.lang.String> choices)
public static <T> MapArgumentConverter<T> from(java.util.Map<java.lang.String,T> map)
public ConversionResult<T> convert(java.lang.String argument, InjectedValueAccess context)
Converter
This method should be pure, i.e. it should not send any
error messages to anything in the context
. This could
result in spurious error messages during parsing.
public net.kyori.text.Component describeAcceptableArguments()
ArgumentConverter
This information is displayed to the user.
describeAcceptableArguments
in interface ArgumentConverter<T>
public java.util.List<java.lang.String> getSuggestions(java.lang.String input, InjectedValueAccess context)
SuggestionProvider
input
as the current input, provide some suggestions for the user.getSuggestions
in interface ArgumentConverter<T>
getSuggestions
in interface SuggestionProvider
input
- the user's current inputcontext
- the context for the current command