Class VariableValueParameters
java.lang.Object
org.spongepowered.api.command.parameter.managed.standard.VariableValueParameters
Builders and factory for parameters that require configuration.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceA builder that creates aValueParameterthat tries to match an argument against a dynamic set of choices and returns an appropriate object based on the supplied argument.static interfaceA factory that createsValueParameters or their builders.static interfaceA builder that createsValueParameters that requires a specific sequence of arguments.static interfaceA builder that creates a parameter that can parse a boundedNumber.static interfaceA builder that creates aValueParameterthat attempts to get a specificregistryentry by the supplied ID.static interfaceA builder that creates aValueParameterthat tries to match an argument against a fixed set of choices and returns an appropriate object based on the supplied argument.static interfaceA builder that creates a parameter that serializes strings intoComponent.
- 
Method SummaryModifier and TypeMethodDescriptionCreates aVariableValueParameters.NumberRangeBuilderthat creates a bounded doubleValueParameter.static <T> VariableValueParameters.DynamicChoicesBuilder<T>dynamicChoicesBuilder(Class<T> returnType) Creates a builder that can build aValueParameterthat tries to match an argument against a dynamic list of choices.static <T extends Enum<T>>
 ValueParameter<T>enumChoices(Class<T> enumClass) Creates aValueParameterthat tries to match an argument with a value from a specified enum case-insensitively.Creates aVariableValueParameters.NumberRangeBuilderthat creates a bounded floatValueParameter.Creates aVariableValueParameters.NumberRangeBuilderthat creates a bounded integerValueParameter.static <T> VariableValueParameters.LiteralBuilder<T>literalBuilder(Class<T> returnType) Creates a builder that builds aValueParameterthat tries to match an a series of arguments with a supplied literal.Creates aVariableValueParameters.NumberRangeBuilderthat creates a bounded longValueParameter.static <T> VariableValueParameters.RegistryEntryBuilder<T>registryEntryBuilder(Function<CommandContext, @Nullable RegistryHolder> holderProvider, RegistryType<T> registryKey) Creates a builder that can build aValueParameterthat returns an appropriateregistryentry from an argument.static <T> VariableValueParameters.RegistryEntryBuilder<T>registryEntryBuilder(List<Function<CommandContext, @Nullable RegistryHolder>> holderProviders, RegistryType<T> registryKey) Creates a builder that can build aValueParameterthat returns an appropriateregistryentry from an argument.static <T> VariableValueParameters.RegistryEntryBuilder<T>Creates a builder that can build aValueParameterthat returns an appropriate type from the providedRegistryfrom an argument.static <T> VariableValueParameters.StaticChoicesBuilder<T>staticChoicesBuilder(Class<T> returnType) Creates a builder that can build aValueParameterthat tries to match an argument against a fixed list of choices.Creates a builder that builds aValueParameterthat tries to construct aComponentfrom an argument.static ValueParameter<String>validatedString(Pattern pattern) Creates aValueParameterthat validates the input.
- 
Method Details- 
registryEntryBuilderpublic static <T> VariableValueParameters.RegistryEntryBuilder<T> registryEntryBuilder(Function<CommandContext, @Nullable RegistryHolder> holderProvider, RegistryType<T> registryKey) Creates a builder that can build aValueParameterthat returns an appropriateregistryentry from an argument.- Type Parameters:
- T- The type in the- Registry
- Parameters:
- holderProvider- The provider for a- RegistryHolderto retrieve the selected- Registryfrom
- registryKey- The- RegistryKeythat represents the target- Registryto get objects from
- Returns:
- The builder
 
- 
registryEntryBuilderpublic static <T> VariableValueParameters.RegistryEntryBuilder<T> registryEntryBuilder(List<Function<CommandContext, @Nullable RegistryHolder>> holderProviders, RegistryType<T> registryKey) Creates a builder that can build aValueParameterthat returns an appropriateregistryentry from an argument.- Type Parameters:
- T- The type in the- Registry
- Parameters:
- holderProviders- The providers for- RegistryHolders to retrieve the selected- Registryfrom
- registryKey- The- RegistryKeythat represents the target- Registryto get objects from
- Returns:
- The builder
 
- 
registryEntryBuilderpublic static <T> VariableValueParameters.RegistryEntryBuilder<T> registryEntryBuilder(DefaultedRegistryType<T> type) Creates a builder that can build aValueParameterthat returns an appropriate type from the providedRegistryfrom an argument.- Type Parameters:
- T- The type in the- Registry
- Parameters:
- type- The- DefaultedRegistryTypeto use to retrieve a- Registrythat contains the objects to retrieve
- Returns:
- The builder
 
- 
staticChoicesBuilderpublic static <T> VariableValueParameters.StaticChoicesBuilder<T> staticChoicesBuilder(Class<T> returnType) Creates a builder that can build aValueParameterthat tries to match an argument against a fixed list of choices.If the list of choices changes during the lifetime of the server, use dynamicChoicesBuilder(Class)instead.- Type Parameters:
- T- The type that will be returned
- Parameters:
- returnType- The type of object that the resulting- ValueParameterwill return.
- Returns:
- The builder
 
- 
dynamicChoicesBuilderpublic static <T> VariableValueParameters.DynamicChoicesBuilder<T> dynamicChoicesBuilder(Class<T> returnType) Creates a builder that can build aValueParameterthat tries to match an argument against a dynamic list of choices.If the list of choices does not change during the lifetime of the server, use staticChoicesBuilder(Class)instead.- Type Parameters:
- T- The type that will be returned
- Parameters:
- returnType- The type of object that the resulting- ValueParameterwill return.
- Returns:
- The builder
 
- 
literalBuilderCreates a builder that builds aValueParameterthat tries to match an a series of arguments with a supplied literal.- Type Parameters:
- T- The type that will be returned
- Parameters:
- returnType- The type of object that the resulting- ValueParameterwill return.
- Returns:
- The builder
 
- 
textBuilderCreates a builder that builds aValueParameterthat tries to construct aComponentfrom an argument.- Returns:
- The new builder
 
- 
enumChoicesCreates aValueParameterthat tries to match an argument with a value from a specified enum case-insensitively.- Type Parameters:
- T- The- Enumclass type
- Parameters:
- enumClass- The- Enumclass type that this will represent
- Returns:
- The appropriate ValueParameter
 
- 
doubleRangeCreates aVariableValueParameters.NumberRangeBuilderthat creates a bounded doubleValueParameter.- Returns:
- The VariableValueParameters.NumberRangeBuilder
 
- 
floatRangeCreates aVariableValueParameters.NumberRangeBuilderthat creates a bounded floatValueParameter.- Returns:
- The VariableValueParameters.NumberRangeBuilder
 
- 
integerRangeCreates aVariableValueParameters.NumberRangeBuilderthat creates a bounded integerValueParameter.- Returns:
- The VariableValueParameters.NumberRangeBuilder
 
- 
longRangeCreates aVariableValueParameters.NumberRangeBuilderthat creates a bounded longValueParameter.- Returns:
- The VariableValueParameters.NumberRangeBuilder
 
- 
validatedStringCreates aValueParameterthat validates the input.- Parameters:
- pattern- The- Patternused to validate the string
- Returns:
- The ValueParameter
 
 
-