Interface ValueParameter.Simple<T>
- 
- Type Parameters:
- T- The type of object that is returned from the- ValueParserupon successful parsing.
 - All Superinterfaces:
- DefaultedRegistryValue,- ValueCompleter,- ValueParameter<T>,- ValueParser<T>,- ValueUsage
 - All Known Subinterfaces:
- ResourceKeyedValueParameter<T>
 - Enclosing interface:
- ValueParameter<T>
 
 public static interface ValueParameter.Simple<T> extends ValueParameter<T> 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.command.parameter.managed.ValueParameterValueParameter.Simple<T>
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<CommandCompletion>complete(CommandCause context, String currentInput)Gets valid completions for this element, given the suppliedCommandCauseand current input for this element.default List<CommandCompletion>complete(CommandContext context, String currentInput)This should not be overridden by implementations of this class.Optional<? extends T>parseValue(CommandCause commandCause, ArgumentReader.Mutable reader)Gets the value for this parameter.default Optional<? extends T>parseValue(Parameter.Key<? super T> parameterKey, ArgumentReader.Mutable reader, CommandContext.Builder context)This should not be overridden by implementations of this class.- 
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValueasDefaultedReference, findKey, key
 - 
Methods inherited from interface org.spongepowered.api.command.parameter.managed.ValueParameterusage
 - 
Methods inherited from interface org.spongepowered.api.command.parameter.managed.ValueParserclientCompletionType
 
- 
 
- 
- 
- 
Method Detail- 
parseValueOptional<? extends T> parseValue(CommandCause commandCause, ArgumentReader.Mutable reader) throws ArgumentParseException Gets the value for this parameter.This should have no side effects on anything except on the state of the ArgumentReader.This element may return nothing in the form of an empty optional. This indicates that a parse succeeded, but no meaningful value was returned. - Parameters:
- commandCause- The- causeof this parse
- reader- The- ArgumentReaderthat contains the unparsed arguments
- Returns:
- Returns the value(s)
- Throws:
- ArgumentParseException- if a parameter could not be parsed
 
 - 
parseValuedefault Optional<? extends T> parseValue(Parameter.Key<? super T> parameterKey, ArgumentReader.Mutable reader, CommandContext.Builder context) throws ArgumentParseException This should not be overridden by implementations of this class. If you wish to do so, implementValueParameterinstead. Gets the value for the parameter. This may return more than one value by adding additional values to the suppliedCommandContext.Builder.This should have no side effects on anything except on the state of the ArgumentReaderand, in rare cases, theCommandContext.Builder.This element may return nothing in the form of an empty optional. This indicates that a parse succeeded, but no meaningful value was returned, for example, the argument must be passed but it's not necessary for the associated CommandExecutorto know what the result of the parse was. TheCommandContext.Buildermay be updated in this case.While the CommandContext.Builderis provided, in general, you do not need to add the parsed value to it yourself, instead preferring to return your parsed value. It is permissible, however, to add additional information to the context should it be required.The Causeof this parse is provided in theCommandContext.Builder.- Specified by:
- parseValuein interface- ValueParser<T>
- Parameters:
- parameterKey- The- Parameter.Keyof the parameter being parsed
- reader- The- ArgumentReaderthat contains the unparsed arguments
- context- The- CommandContextcontaining the state about this command
- Returns:
- Returns the value(s)
- Throws:
- ArgumentParseException- if a parameter could not be parsed
 
 - 
completeList<CommandCompletion> complete(CommandCause context, String currentInput) Gets valid completions for this element, given the suppliedCommandCauseand current input for this element.- Parameters:
- context- The- CommandCausethat contains the parsed arguments
- currentInput- The current input for this argument
- Returns:
- The list of values
 
 - 
completedefault List<CommandCompletion> complete(CommandContext context, String currentInput) This should not be overridden by implementations of this class. If you wish to do so, implementValueParameterinstead. Gets valid completions for this element, given the suppliedCommandContextand current input for this element.- Specified by:
- completein interface- ValueCompleter
- Parameters:
- context- The- CommandContextthat contains the parsed arguments
- currentInput- The current input for this argument
- Returns:
- The list of values
 
 
- 
 
-