public interface SelectorFactory
Modifier and Type | Method and Description |
---|---|
List<String> |
complete(String selector)
Fetch completions for a selector command argument.
|
<T> Argument.Invertible<T> |
createArgument(ArgumentType.Invertible<T> type,
T value,
boolean inverted)
Creates a new
Argument.Invertible using the specified type and
value. |
<T> Argument<T> |
createArgument(ArgumentType<T> type,
T value)
Creates a new
Argument using the specified type and value. |
<T,V> Set<Argument<T>> |
createArguments(ArgumentHolder<? extends ArgumentType<T>> type,
V value)
Creates a new set of
Argument s using the specified type and
value. |
ArgumentType<String> |
createArgumentType(String key)
Creates a custom
ArgumentType with the specified key. |
<T> ArgumentType<T> |
createArgumentType(String key,
Class<T> type)
Creates a custom
ArgumentType with the specified key and value. |
Selector.Builder |
createBuilder()
Creates a
Selector.Builder . |
ArgumentHolder.Limit<ArgumentType<Integer>> |
createScoreArgumentType(String name)
Creates a minimum and maximum
ArgumentType filtering depending on
the score of the specified objective. |
Optional<ArgumentType<?>> |
getArgumentType(String name)
Gets the
ArgumentType with the provided name. |
Collection<ArgumentType<?>> |
getArgumentTypes()
Gets a
Collection of all possible ArgumentType s. |
Argument<?> |
parseArgument(String argument)
Parses an
Argument from the given argument string. |
Selector |
parseRawSelector(String selector)
Parses a
Selector from the given selector string. |
Selector.Builder createBuilder()
Selector.Builder
.Selector parseRawSelector(String selector)
Selector
from the given selector string.selector
- The raw selector stringArgumentHolder.Limit<ArgumentType<Integer>> createScoreArgumentType(String name)
ArgumentType
filtering depending on
the score of the specified objective.name
- The objective name to useOptional<ArgumentType<?>> getArgumentType(String name)
ArgumentType
with the provided name.name
- The name of the argument typeArgumentType
with the given name or Optional.empty()
if not foundCollection<ArgumentType<?>> getArgumentTypes()
Collection
of all possible ArgumentType
s.ArgumentType
sArgumentType<String> createArgumentType(String key)
ArgumentType
with the specified key.key
- The key to use for the argument<T> ArgumentType<T> createArgumentType(String key, Class<T> type)
ArgumentType
with the specified key and value.T
- The argument's value typekey
- The key to use for the argumenttype
- The class of the argument's value type<T> Argument<T> createArgument(ArgumentType<T> type, T value)
Argument
using the specified type and value.T
- The type of the argument valuetype
- The type of the argumentvalue
- The value of the argument<T> Argument.Invertible<T> createArgument(ArgumentType.Invertible<T> type, T value, boolean inverted)
Argument.Invertible
using the specified type and
value. The created Argument
will be inverted based on the given
parameter.T
- The type of the argument valuetype
- The type of the invertible argumentvalue
- The value of the invertible argumentinverted
- true
if the argument should be inverted<T,V> Set<Argument<T>> createArguments(ArgumentHolder<? extends ArgumentType<T>> type, V value)
Argument
s using the specified type and
value.T
- The type of the arguments' joined valueV
- The type of the arguments' sub-valuestype
- The type of the argumentsvalue
- The value of the argumentsArgument<?> parseArgument(String argument) throws IllegalArgumentException
Argument
from the given argument string.
In Vanilla, it should be formatted like key=value
.
argument
- The argument stringIllegalArgumentException
- If the argument couldn't be parsed (e.g.
due to invalid format)