Class ParameterSet
A set of Parameter objects that are grouped together, typically as a set of required inputs for something
that a user adds to their project. A ParameterSet is converted in to a BoundParameters object
via the bind(BindingContext, Map) method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterSetSomewhat useful constant to represent an empty parameter set -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbind(BindingContext context, Map<String, List<?>> unbound) Attempt to bind the given raw, unbound, parameter values to aBoundParametersobject.bindConfig(BindingContext context, Map<ConfigString, List<ConfigString>> unboundConfig) Attempt to bind the given config map (SeeConfigSection.toConfigMap()) to this set of parameters.protected booleanbooleanbooleanstatic ParameterSetstatic ParameterSetfromList(Collection<Parameter> declaredParameters) inthashCode()normaliseParameterMap(Map<String, ?> optionsMap) Accepts a wild-card map and returns one where all values are lists.intsize()The number of parameters in this settoList()toString()
-
Field Details
-
EMPTY
Somewhat useful constant to represent an empty parameter set
-
-
Constructor Details
-
ParameterSet
-
-
Method Details
-
normaliseParameterMap
Accepts a wild-card map and returns one where all values are lists. If an existing value is already a List, it's left alone, and everything else (including collections) are returned in a list.
-
from
-
fromList
-
bindConfig
public BoundParameters bindConfig(BindingContext context, Map<ConfigString, List<ConfigString>> unboundConfig) Attempt to bind the given config map (See
ConfigSection.toConfigMap()) to this set of parameters. Using this method will improve any error messages by adding source information (where available). -
bind
Attempt to bind the given raw, unbound, parameter values to a
BoundParametersobject.- Parameters:
context- aBindingContextto use to convert values.unbound- the values to bind.- Returns:
- a
BoundParametersobject with the results of binding. Note that a result is returned even if there were binding errors. ABoundParametersobject has map and flatMap methods for treating theBoundParametersobject like aResultOrProblems
-
contains
- Returns:
- if this parameter set contains a parameter with the given name
-
get
- Returns:
- the parameter in this set with the given name, or throw an
IllegalArgumentExceptionif no parameter with this name exists in the parameter set.
-
toString
-
size
public int size()The number of parameters in this set
-
toList
- Returns:
- the declared parameters within, in the order they were declared
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getDeclared
-