Interface Parameter.Value<T>
- Type Parameters:
- T- The type of value returned from the- ValueParsers
- All Superinterfaces:
- Parameter
- Enclosing interface:
- Parameter
Represents a 
Parameter that attempts to parse an argument to
 obtain a value of type T.
 This type of Parameter will attempt to parse an input
 using the ValueParsers in the order that they are returned in
 parsers(). If a ValueParser fails to parse an
 argument, the next in the list will be tried, if the final
 ValueParser cannot parse the argument, this element will
 throw a ArgumentParseException.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilds aParameterfrom constituent components.Nested classes/interfaces inherited from interface org.spongepowered.api.command.parameter.ParameterParameter.Factory, Parameter.FirstOfBuilder, Parameter.Key<T>, Parameter.Multi, Parameter.SequenceBuilder, Parameter.Subcommand, Parameter.Value<T>
- 
Method SummaryModifier and TypeMethodDescriptioncomplete(@NonNull ArgumentReader.Immutable reader, @NonNull CommandContext context) Returns potential completions of the current tokenized argument.Gets theValueCompleterassociated with thisParameter.Value.key()The key that a parameter result is stored under.modifier()Gets theValueParameterModifierthat affects this parameter, if any.voidparse(@NonNull ArgumentReader.Mutable reader, @NonNull CommandContext.Builder context) Parses the next element(s) in theCommandContext.Collection<ValueParser<? extends T>>parsers()TheValueParsers to use when parsing an argument.usage(CommandCause cause) Gets the usage of this parameter.Gets theValueUsageassociated with thisParameter.Value, if any was set.booleanIf set, this parameter will repeat until the argument string has been parsed.Methods inherited from interface org.spongepowered.api.command.parameter.ParameterisOptional, isTerminal
- 
Method Details- 
keyParameter.Key<T> key()The key that a parameter result is stored under.- Returns:
- The key.
 
- 
parsersCollection<ValueParser<? extends T>> parsers()TheValueParsers to use when parsing an argument. They will be tried in this order.There must always be at least one ValueParser. If this element is optional and has a default result, it will be the last element in the returnedCollection.- Returns:
- The parameters.
 
- 
completerValueCompleter completer()Gets theValueCompleterassociated with thisParameter.Value.- Returns:
- The ValueCompleter.
 
- 
modifierOptional<ValueParameterModifier<T>> modifier()Gets theValueParameterModifierthat affects this parameter, if any.- Returns:
- The ValueParameterModifier, if set.
 
- 
valueUsageOptional<ValueUsage> valueUsage()Gets theValueUsageassociated with thisParameter.Value, if any was set.- Returns:
- The ValueUsage, if set.
 
- 
requirementPredicate<CommandCause> requirement()- Returns:
- the predicate
 
- 
parsevoid parse(@NonNull ArgumentReader.Mutable reader, @NonNull CommandContext.Builder context) throws ArgumentParseException Parses the next element(s) in theCommandContext.- Parameters:
- reader- The- ArgumentReader.Mutablecontaining the strings that need to be parsed
- context- The- CommandContext.Builderthat contains the current state of the execution
- Throws:
- ArgumentParseException- thrown if the parameter could not be parsed
 
- 
completeList<CommandCompletion> complete(@NonNull ArgumentReader.Immutable reader, @NonNull CommandContext context) throws ArgumentParseException Returns potential completions of the current tokenized argument. The completion will be based onArgumentReader.remaining().- Parameters:
- reader- The- ArgumentReadercontaining the strings that need to be parsed
- context- The- CommandContextthat contains the current state of the execution.
- Returns:
- The potential completions.
- Throws:
- ArgumentParseException- thrown if the parameter could not be parsed
 
- 
usageGets the usage of this parameter.- Parameters:
- cause- The- CommandCausethat requested the usage
- Returns:
- The usage
 
- 
willConsumeAllRemainingboolean willConsumeAllRemaining()If set, this parameter will repeat until the argument string has been parsed.- Returns:
- if true, consumes all arguments
 
 
-