public class SimpleArgumentConverter<T> extends java.lang.Object implements ArgumentConverter<T>
ArgumentConverter
. Provides no suggestions,
but you can call withSuggestions(SuggestionProvider)
to supply them.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 <T> SimpleArgumentConverter<T> |
from(Converter<T> converter,
net.kyori.text.Component description)
Implements
Converter.convert(String, InjectedValueAccess) using the provided
function, and supplies the provided description for
ArgumentConverter.describeAcceptableArguments() . |
static <T> SimpleArgumentConverter<T> |
from(Converter<T> converter,
java.lang.String description) |
ArgumentConverter<T> |
withSuggestions(SuggestionProvider suggestions) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSuggestions
public static <T> SimpleArgumentConverter<T> from(Converter<T> converter, java.lang.String description)
public static <T> SimpleArgumentConverter<T> from(Converter<T> converter, net.kyori.text.Component description)
Converter.convert(String, InjectedValueAccess)
using the provided
function, and supplies the provided description for
ArgumentConverter.describeAcceptableArguments()
.T
- the type of the argumentconverter
- the converter functiondescription
- the acceptable arguments descriptionpublic 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 ArgumentConverter<T> withSuggestions(SuggestionProvider suggestions)