Interface Parameter
- All Known Subinterfaces:
- Parameter.Multi,- Parameter.Subcommand,- Parameter.Value<T>
Parameters that parse input and return an object into the
 CommandContext should be of type Parameter.Value in
 order to maximize type safety. However, there are also other important
 ways that parameters can be used:
- firstOfBuilder(Parameter)allows for multiple parameters that do not have the same return type to attempt to parse an input successfully.
- seqBuilder(Parameter)allows for the grouping of multiple parameters that will be executed one after another.
- Parameter.Subcommands can be placed anywhere in a parameter chain where a- Parametercan be added, if successfully parsed, any containing- Commandwould take precedence and its- Command.process(CommandCause, ArgumentReader.Mutable)method will be called instead of any parent.
Parameters are intended for use with Command.Builders.
 
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceContains methods to create the generic builders.static interfaceSpecifies a builder for creating aParameterthat returns a parameter that concatenates all parameters into a single parameter to be executed one by one.static interfacestatic interfaceA parameter that consists of multiple parametersstatic interfaceSpecifies a builder for creating aParameterthat returns a parameter that concatenates all parameters into a single parameter to be executed one by one.static interfaceAParameter.Subcommandrepresents a literal argument where, if parsed, should indicate to the command processor that theCommandExecutorof the command should change.static interfaceRepresents aParameterthat attempts to parse an argument to obtain a value of typeT.
- 
Method SummaryModifier and TypeMethodDescriptionstatic Parameter.Value.Builder<BigDecimal>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.BIG_DECIMAL.static Parameter.Value.Builder<BigInteger>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.BIG_INTEGER.static Parameter.Value.Builder<BlockState>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.BLOCK_STATE.static Parameter.Value.Builder<Boolean>bool()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.BOOLEAN.static <T> Parameter.Value.Builder<T>builder(@NonNull io.leangen.geantyref.TypeToken<T> typeToken) Gets a builder that builds aParameter.Value.static <T,V extends ValueParameter<T>> 
 Parameter.Value.Builder<T>Gets a builder that builds aParameter.Value.static <T> Parameter.Value.Builder<T>builder(@NonNull io.leangen.geantyref.TypeToken<T> typeToken, @NonNull ValueParameter<? extends T> parameter) Gets a builder that builds aParameter.Value.static <T> Parameter.Value.Builder<T>Gets a builder that builds aParameter.Value.static <T> Parameter.Value.Builder<T>builder(@NonNull Class<T> valueClass, @NonNull ValueParameter<? extends T> parameter) Gets a builder that builds aParameter.Value.static <T,V extends ValueParameter<T>> 
 Parameter.Value.Builder<T>builder(@NonNull Class<T> valueClass, @NonNull DefaultedRegistryReference<V> parameter) Gets a builder that builds aParameter.Value.static <T> Parameter.Value.Builder<T>builder(@NonNull Parameter.Key<T> key) Gets a builder that builds aParameter.Value.static <T> Parameter.Value.Builder<T>choices(@NonNull Class<T> returnType, @NonNull Function<String, ? extends T> valueFunction, @NonNull Supplier<? extends Collection<String>> choices) Creates a builder that has aValueParameterthat allows you to specify a set of choices that must be chosen from.static <T> Parameter.Value.Builder<T>Creates a builder that has aValueParameterthat allows you to specify a set of choices that must be chosen from.static Parameter.Value.Builder<String>Creates a builder that has aValueParameterthat allows you to specify a set of choices that must be chosen fromstatic Parameter.Value.Builder<Color>color()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.COLOR.static Parameter.Value.Builder<DataContainer>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.DATA_CONTAINER.static Parameter.Value.Builder<LocalDateTime>dateTime()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.DATE_TIME.static Parameter.Value.Builder<Double>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.DOUBLE.static Parameter.Value.Builder<Duration>duration()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.DURATION.static Parameter.Value.Builder<Entity>entity()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.ENTITY.static Parameter.Value.Builder<Entity>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.ENTITYstatic <T extends Enum<T>>
 Parameter.Value.Builder<T>Creates a builder that has aValueParameterthat requires an argument that matches the name of a suppliedEnumtypestatic ParameterReturns aParameterthat attempts to parse an argument using the supplied parameters in order.static ParameterReturns aParameterthat attempts to parse an argument using the supplied parameters in order.static Parameter.FirstOfBuilderfirstOfBuilder(@NonNull Parameter parameter) Returns aParameter.FirstOfBuilderthat allows plugins to attempt to parse an argument using the supplied parameters in order.static Parameter.Value.Builder<Component>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_FORMATTING_CODE.static Parameter.Value.Builder<Component>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_FORMATTING_CODE_ALL.static Parameter.Value.Builder<Integer>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.INTEGER.static Parameter.Value.Builder<InetAddress>ip()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.IP.booleanGets whether this parameter is optional.booleanGets whether this parameter is known to be able to be explicitly considered a terminal parameter without regarding its place in a command.Creates a builder that has theValueParameterset toResourceKeyedValueParameters.ITEM_STACK_SNAPSHOT.static Parameter.Value.Builder<Component>jsonText()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_JSON.static Parameter.Value.Builder<Component>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_JSON_ALL.static <T> Parameter.Key<T>Creates aParameter.Keyfor storing values against.static <T> Parameter.Key<T>Creates aParameter.Keyfor storing values against.static <T> Parameter.Value.Builder<T>literal(@NonNull Class<T> returnType, @NonNull T returnedValue, @NonNull Supplier<? extends Collection<String>> literalSupplier) Creates a builder that has aValueParameterthat requires an argument to be a literal specifiedstatic <T> Parameter.Value.Builder<T>Creates a builder that has aValueParameterthat requires an argument to be a literal specifiedlocation()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.LOCATION.static Parameter.Value.Builder<Long>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.LONG.static Parameter.Value.Builder<Operator>operator()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.OPERATOR.static Parameter.Value.Builder<ServerPlayer>player()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.PLAYER.static Parameter.Value.Builder<ServerPlayer>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.PLAYER, else the targetstatic Parameter.Value.Builder<org.spongepowered.plugin.PluginContainer>plugin()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.PLUGIN.static Parameter.Value.Builder<Double>rangedDouble(double min, double max) Creates a builder that has theValueParameterset toVariableValueParameters.doubleRange(), using the specified bounds (inclusive).static Parameter.Value.Builder<Integer>rangedInteger(int min, int max) Creates a builder that has theValueParameterset toVariableValueParameters.integerRange(), using the specified bounds (inclusive).static <T> Parameter.Value.Builder<T>registryElement(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull List<Function<CommandContext, @Nullable RegistryHolder>> holderProviders, @NonNull RegistryType<T> registryKey, @NonNull String @NonNull ... defaultNamespaces) Creates a builder that has theValueParameterthat allows you to choose from cataloged types.static <T> Parameter.Value.Builder<T>registryElement(io.leangen.geantyref.TypeToken<T> type, @NonNull Function<CommandContext, @Nullable RegistryHolder> holderProvider, @NonNull RegistryType<T> registryKey, @NonNull String @NonNull ... defaultNamespaces) Creates a builder that has theValueParameterthat allows you to choose from cataloged types.static <T> Parameter.Value.Builder<T>registryElement(io.leangen.geantyref.TypeToken<T> type, @NonNull DefaultedRegistryType<T> registryType, @NonNull String @NonNull ... defaultNamespaces) Creates a builder that has theValueParameterthat allows you to choose from types registered in a givenRegistry.static Parameter.Value.Builder<String>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.REMAINING_JOINED_STRINGS.static Parameter.Value.Builder<ResourceKey>Creates a builder that has theValueParameterset toResourceKeyedValueParameters.RESOURCE_KEY.static Parameter.Value.Builder<Vector3d>rotation()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.ROTATION.static ParameterReturns aParameterthat parses arguments using the supplied parameters in order.static ParameterReturns aParameterthat parses arguments using the supplied parameters in order.static Parameter.SequenceBuilderseqBuilder(@NonNull Parameter parameter) Returns aParameter.SequenceBuilderthat parses arguments using the supplied parameters in order.static Parameter.Value.Builder<String>string()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.STRING.static Parameter.Subcommandsubcommand(@NonNull Command.Parameterized subcommand, @NonNull String alias, String @NonNull ... aliases) Gets aParameterthat represents a subcommand.static Parameter.Value.Builder<URL>url()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.URL.static Parameter.Value.Builder<UUID>user()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.USER.static Parameter.Value.Builder<UUID>uuid()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.UUID.static Parameter.Value.Builder<Vector3d>vector3d()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.VECTOR3D.static Parameter.Value.Builder<ServerWorld>world()Creates a builder that has theValueParameterset toResourceKeyedValueParameters.WORLD.
- 
Method Details- 
keystatic <T> Parameter.Key<T> key(@NonNull String key, @NonNull io.leangen.geantyref.TypeToken<T> typeToken) Creates aParameter.Keyfor storing values against.- Type Parameters:
- T- The type
- Parameters:
- key- The string key
- typeToken- The type of value that this key represents
- Returns:
- The Parameter.Key
 
- 
keyCreates aParameter.Keyfor storing values against.- Type Parameters:
- T- The type
- Parameters:
- key- The string key
- type- The type of value that this key represents. Must not omit any type parameters.
- Returns:
- The Parameter.Key
 
- 
builderGets a builder that builds aParameter.Value.If your parameter type is generic, use builder(TypeToken)instead.- Type Parameters:
- T- The type of parameter
- Parameters:
- valueClass- The type of value class
- Returns:
- The Parameter.Value.Builder
 
- 
builderGets a builder that builds aParameter.Value.- Type Parameters:
- T- The type of parameter
- Parameters:
- typeToken- The type of value class as a- TypeToken
- Returns:
- The Parameter.Value.Builder
 
- 
builderGets a builder that builds aParameter.Value.- Type Parameters:
- T- The type of parameter
- Parameters:
- key- The key to initialize this builder with
- Returns:
- The Parameter.Value.Builder
 
- 
builderstatic <T> Parameter.Value.Builder<T> builder(@NonNull Class<T> valueClass, @NonNull ValueParameter<? extends T> parameter) Gets a builder that builds aParameter.Value.If your parameter type is generic, use builder(TypeToken, ValueParameter)instead.- Type Parameters:
- T- The type of parameter
- Parameters:
- valueClass- The type of value class as a- Class
- parameter- The value parameter
- Returns:
- The Parameter.Value.Builder
 
- 
builderstatic <T> Parameter.Value.Builder<T> builder(@NonNull io.leangen.geantyref.TypeToken<T> typeToken, @NonNull ValueParameter<? extends T> parameter) Gets a builder that builds aParameter.Value.- Type Parameters:
- T- The type of parameter
- Parameters:
- typeToken- The type of value class as a- TypeToken
- parameter- The value parameter
- Returns:
- The Parameter.Value.Builder
 
- 
builderstatic <T,V extends ValueParameter<T>> Parameter.Value.Builder<T> builder(@NonNull Class<T> valueClass, @NonNull DefaultedRegistryReference<V> parameter) Gets a builder that builds aParameter.Value.- Type Parameters:
- T- The type of parameter
- V- The- ValueParameterto be used as a parser
- Parameters:
- parameter- The value parameter
- valueClass- The type of value class
- Returns:
- The Parameter.Value.Builder
 
- 
builderstatic <T,V extends ValueParameter<T>> Parameter.Value.Builder<T> builder(@NonNull io.leangen.geantyref.TypeToken<T> typeToken, @NonNull Supplier<V> parameter) Gets a builder that builds aParameter.Value.- Type Parameters:
- T- The type of parameter
- V- The- ValueParameterto be used as a parser
- Parameters:
- parameter- The value parameter
- typeToken- The type of value class as a- TypeToken
- Returns:
- The Parameter.Value.Builder
 
- 
subcommandstatic Parameter.Subcommand subcommand(@NonNull Command.Parameterized subcommand, @NonNull String alias, String @NonNull ... aliases) Gets aParameterthat represents a subcommand.If a Parameter.Subcommandalias in a parameter chain is successfully matched, then element parsing will continue with the parameters supplied toCommand. It is implementation dependent as to what happens if a subcommand fails to parse.- Parameters:
- subcommand- The- Commandto execute
- alias- The first alias of the subcommand
- aliases- Subsequent aliases, if any
- Returns:
- The Parameter.Subcommandfor use in aParameterchain
 
- 
firstOfBuilderReturns aParameter.FirstOfBuilderthat allows plugins to attempt to parse an argument using the supplied parameters in order. Once a parameter has parsed the argument successfully, no more parameters supplied here will be attempted.- Parameters:
- parameter- The first- Parameter
- Returns:
- The Parameter.FirstOfBuilderto continue chaining
 
- 
firstOfstatic Parameter firstOf(@NonNull Parameter first, @NonNull Parameter second, Parameter @NonNull ... parameters) Returns aParameterthat attempts to parse an argument using the supplied parameters in order. Once a parameter has parsed the argument successfully, no more parameters supplied here will be attempted.
- 
firstOfReturns aParameterthat attempts to parse an argument using the supplied parameters in order. Once a parameter has parsed the argument successfully, no more parameters supplied here will be attempted.
- 
seqBuilderReturns aParameter.SequenceBuilderthat parses arguments using the supplied parameters in order.- Parameters:
- parameter- The first- Parameterin the sequence
- Returns:
- The Parameter.SequenceBuilder, to continue building the chain
 
- 
seqstatic Parameter seq(@NonNull Parameter first, @NonNull Parameter second, Parameter @NonNull ... parameters) Returns aParameterthat parses arguments using the supplied parameters in order.
- 
seqReturns aParameterthat parses arguments using the supplied parameters in order.
- 
bigDecimalCreates a builder that has theValueParameterset toResourceKeyedValueParameters.BIG_DECIMAL.- Returns:
- A Parameter.Value.Builder
 
- 
bigIntegerCreates a builder that has theValueParameterset toResourceKeyedValueParameters.BIG_INTEGER.- Returns:
- A Parameter.Value.Builder
 
- 
blockStateCreates a builder that has theValueParameterset toResourceKeyedValueParameters.BLOCK_STATE.- Returns:
- A Parameter.Value.Builder
 
- 
boolCreates a builder that has theValueParameterset toResourceKeyedValueParameters.BOOLEAN.- Returns:
- A Parameter.Value.Builder
 
- 
colorCreates a builder that has theValueParameterset toResourceKeyedValueParameters.COLOR.- Returns:
- A Parameter.Value.Builder
 
- 
dataContainerCreates a builder that has theValueParameterset toResourceKeyedValueParameters.DATA_CONTAINER.- Returns:
- A Parameter.Value.Builder
 
- 
dateTimeCreates a builder that has theValueParameterset toResourceKeyedValueParameters.DATE_TIME.- Returns:
- A Parameter.Value.Builder
 
- 
durationCreates a builder that has theValueParameterset toResourceKeyedValueParameters.DURATION.- Returns:
- A Parameter.Value.Builder
 
- 
doubleNumberCreates a builder that has theValueParameterset toResourceKeyedValueParameters.DOUBLE.- Returns:
- A Parameter.Value.Builder
 
- 
entityCreates a builder that has theValueParameterset toResourceKeyedValueParameters.ENTITY.- Returns:
- A Parameter.Value.Builder
 
- 
entityOrTargetCreates a builder that has theValueParameterset toResourceKeyedValueParameters.ENTITY- Returns:
- A Parameter.Value.Builder
 
- 
formattingCodeTextCreates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_FORMATTING_CODE.- Returns:
- A Parameter.Value.Builder
 
- 
formattingCodeTextOfRemainingElementsCreates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_FORMATTING_CODE_ALL.- Returns:
- A Parameter.Value.Builder
 
- 
integerNumberCreates a builder that has theValueParameterset toResourceKeyedValueParameters.INTEGER.- Returns:
- A Parameter.Value.Builder
 
- 
ipCreates a builder that has theValueParameterset toResourceKeyedValueParameters.IP.- Returns:
- A Parameter.Value.Builder
 
- 
itemStackSnapshotCreates a builder that has theValueParameterset toResourceKeyedValueParameters.ITEM_STACK_SNAPSHOT.- Returns:
- A Parameter.Value.Builder
 
- 
jsonTextCreates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_JSON.- Returns:
- A Parameter.Value.Builder
 
- 
jsonTextOfRemainingElementsCreates a builder that has theValueParameterset toResourceKeyedValueParameters.TEXT_JSON_ALL.- Returns:
- A Parameter.Value.Builder
 
- 
locationCreates a builder that has theValueParameterset toResourceKeyedValueParameters.LOCATION.- Returns:
- A Parameter.Value.Builder
 
- 
longNumberCreates a builder that has theValueParameterset toResourceKeyedValueParameters.LONG.- Returns:
- A Parameter.Value.Builder
 
- 
operatorCreates a builder that has theValueParameterset toResourceKeyedValueParameters.OPERATOR.- Returns:
- A Parameter.Value.Builder
 
- 
playerCreates a builder that has theValueParameterset toResourceKeyedValueParameters.PLAYER.- Returns:
- A Parameter.Value.Builder
 
- 
playerOrTargetCreates a builder that has theValueParameterset toResourceKeyedValueParameters.PLAYER, else the target- Returns:
- A Parameter.Value.Builder
 
- 
pluginCreates a builder that has theValueParameterset toResourceKeyedValueParameters.PLUGIN.- Returns:
- A Parameter.Value.Builder
 
- 
rangedDoubleCreates a builder that has theValueParameterset toVariableValueParameters.doubleRange(), using the specified bounds (inclusive).- Parameters:
- min- The minimum value.
- max- The maximum value.
- Returns:
- A Parameter.Value.Builder
 
- 
rangedIntegerCreates a builder that has theValueParameterset toVariableValueParameters.integerRange(), using the specified bounds (inclusive).- Parameters:
- min- The minimum value.
- max- The maximum value.
- Returns:
- A Parameter.Value.Builder
 
- 
remainingJoinedStringsCreates a builder that has theValueParameterset toResourceKeyedValueParameters.REMAINING_JOINED_STRINGS.- Returns:
- A Parameter.Value.Builder
 
- 
resourceKeyCreates a builder that has theValueParameterset toResourceKeyedValueParameters.RESOURCE_KEY.- Returns:
- A Parameter.Value.Builder
 
- 
rotationCreates a builder that has theValueParameterset toResourceKeyedValueParameters.ROTATION.- Returns:
- A Parameter.Value.Builder
 
- 
stringCreates a builder that has theValueParameterset toResourceKeyedValueParameters.STRING.- Returns:
- A Parameter.Value.Builder
 
- 
urlCreates a builder that has theValueParameterset toResourceKeyedValueParameters.URL.- Returns:
- A Parameter.Value.Builder
 
- 
userCreates a builder that has theValueParameterset toResourceKeyedValueParameters.USER.- Returns:
- A Parameter.Value.Builder
 
- 
uuidCreates a builder that has theValueParameterset toResourceKeyedValueParameters.UUID.- Returns:
- A Parameter.Value.Builder
 
- 
vector3dCreates a builder that has theValueParameterset toResourceKeyedValueParameters.VECTOR3D.- Returns:
- A Parameter.Value.Builder
 
- 
worldCreates a builder that has theValueParameterset toResourceKeyedValueParameters.WORLD.- Returns:
- A Parameter.Value.Builder
 
- 
registryElementstatic <T> Parameter.Value.Builder<T> registryElement(io.leangen.geantyref.TypeToken<T> type, @NonNull Function<CommandContext, @Nullable RegistryHolder> holderProvider, @NonNull RegistryType<T> registryKey, @NonNull String @NonNull ... defaultNamespaces) Creates a builder that has theValueParameterthat allows you to choose from cataloged types.See #defaultNamespace(String)for how default namespaces work.If the GameorServerscopedRegistryHolderis required,VariableValueParameters.RegistryEntryBuilder.GLOBAL_HOLDER_PROVIDERorVariableValueParameters.RegistryEntryBuilder.SERVER_HOLDER_PROVIDERmay be used.- Type Parameters:
- T- The type of registry value
- Parameters:
- type- The registry value type to check for choices
- holderProvider- A- Functionthat provides the appropriate- RegistryHolderto get the appropriate- Registry
- registryKey- The- RegistryKeythat represents the target- Registry
- defaultNamespaces- The default namespaces that will be used with the provided value if the supplied argument is un-namespaced
- Returns:
- A Parameter.Value.Builder
 
- 
registryElementstatic <T> Parameter.Value.Builder<T> registryElement(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull List<Function<CommandContext, @Nullable RegistryHolder>> holderProviders, @NonNull RegistryType<T> registryKey, @NonNull String @NonNull ... defaultNamespaces) Creates a builder that has theValueParameterthat allows you to choose from cataloged types.See #defaultNamespace(String)for how default namespaces work.If the GameorServerscopedRegistryHolderis required,VariableValueParameters.RegistryEntryBuilder.GLOBAL_HOLDER_PROVIDERorVariableValueParameters.RegistryEntryBuilder.SERVER_HOLDER_PROVIDERmay be used.- Type Parameters:
- T- The type of registry value
- Parameters:
- type- The registry value type to check for choices
- holderProviders-- Functions that provides the appropriate- RegistryHolderto get the appropriate- Registry
- registryKey- The- RegistryKeythat represents the target- Registry
- defaultNamespaces- The default namespaces that will be used with the provided value if the supplied argument is un-namespaced
- Returns:
- A Parameter.Value.Builder
 
- 
registryElementstatic <T> Parameter.Value.Builder<T> registryElement(io.leangen.geantyref.TypeToken<T> type, @NonNull DefaultedRegistryType<T> registryType, @NonNull String @NonNull ... defaultNamespaces) Creates a builder that has theValueParameterthat allows you to choose from types registered in a givenRegistry.See #defaultNamespace(String)for how default namespaces work.- Type Parameters:
- T- The type of registyr value
- Parameters:
- type- The registry value type to check for choices
- registryType- The- DefaultedRegistryTypeto use when retrieving objects
- defaultNamespaces- The default namespaces that will be used with the provided value if the supplied argument is un-namespaced
- Returns:
- A Parameter.Value.Builder
 
- 
choicesCreates a builder that has aValueParameterthat allows you to specify a set of choices that must be chosen fromThis will return a parser that will return Strings- Parameters:
- choices- The choices
- Returns:
- A Parameter.Value.Builder
 
- 
choicesstatic <T> Parameter.Value.Builder<T> choices(@NonNull Class<T> returnType, @NonNull Map<String, ? extends T> choices) Creates a builder that has aValueParameterthat allows you to specify a set of choices that must be chosen from. These choices map to objects that will get put in theCommandContextwhen a choice is selected.- Type Parameters:
- T- The type of parameter
- Parameters:
- returnType- The type of object that will be returned by the parser to be built by this builder.
- choices- The choices
- Returns:
- A Parameter.Value.Builder
 
- 
choicesstatic <T> Parameter.Value.Builder<T> choices(@NonNull Class<T> returnType, @NonNull Function<String, ? extends T> valueFunction, @NonNull Supplier<? extends Collection<String>> choices) Creates a builder that has aValueParameterthat allows you to specify a set of choices that must be chosen from. These choices map to objects that will get put in theCommandContextwhen a choice is selected, through the use of thevalueFunction.- Type Parameters:
- T- The type of parameter
- Parameters:
- returnType- The type of object that will be returned by the parser to be built by this builder.
- valueFunction- The function that returns an object to put in the- CommandContextbased on the supplied choice
- choices- The choices
- Returns:
- A Parameter.Value.Builder
 
- 
enumValueCreates a builder that has aValueParameterthat requires an argument that matches the name of a suppliedEnumtype- Type Parameters:
- T- The type of- Enum
- Parameters:
- enumClass- The- Enumclass type
- Returns:
- A Parameter.Value.Builder
 
- 
literalstatic <T> Parameter.Value.Builder<T> literal(@NonNull Class<T> returnType, @NonNull T returnedValue, String @NonNull ... literal) Creates a builder that has aValueParameterthat requires an argument to be a literal specified- Type Parameters:
- T- The type of value
- Parameters:
- returnType- The type of object that will be returned by the parser to be built by this builder.
- returnedValue- The object to put in the- CommandContextif the literal matches.
- literal- The literal to match
- Returns:
- A Parameter.Value.Builder
 
- 
literalstatic <T> Parameter.Value.Builder<T> literal(@NonNull Class<T> returnType, @NonNull T returnedValue, @NonNull Supplier<? extends Collection<String>> literalSupplier) Creates a builder that has aValueParameterthat requires an argument to be a literal specified- Type Parameters:
- T- The type of parameter
- Parameters:
- returnedValue- The object to put in the- CommandContextif the literal matches
- literalSupplier- A function that provies the literal to match at invocation
- returnType- The type of return
- Returns:
- A Parameter.Value.Builder
 
- 
isOptionalboolean isOptional()Gets whether this parameter is optional.An optional parameter will not throw an exception if it cannot parse an input, instead passing control to another parameter. - Returns:
- true if optional, else false.
 
- 
isTerminalboolean isTerminal()Gets whether this parameter is known to be able to be explicitly considered a terminal parameter without regarding its place in a command.A terminal parameter will pass control to the command's associated CommandExecutorif the parameter consumes the end of an input string.Because this parameter may be reused across multiple commands, there may be some circumstances where this parameter will act as a terminal parameter but this is false, such as when this is at the end of a parameter chain or the following parameters are all optional. The return value from this method generally will return whether this element is terminal without regard to other parameters in a command. - Returns:
- true if known to be terminal.
 
 
-