Package nz.org.riskscape.engine.bind
Class ParameterSet
java.lang.Object
nz.org.riskscape.engine.bind.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
Modifier and TypeFieldDescriptionstatic final ParameterSet
Somewhat useful constant to represent an empty parameter set -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbind
(BindingContext context, Map<String, List<?>> unbound) Attempt to bind the given raw, unbound, parameter values to aBoundParameters
object.protected boolean
boolean
boolean
static ParameterSet
static ParameterSet
fromList
(Collection<Parameter> declaredParameters) int
hashCode()
normaliseParameterMap
(Map<String, ?> optionsMap) Accepts a wild-card map and returns one where all values are lists.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
-
bind
Attempt to bind the given raw, unbound, parameter values to a
BoundParameters
object.- Parameters:
context
- aBindingContext
to use to convert values.unbound
- the values to bind.- Returns:
- a
BoundParameters
object with the results of binding. Note that a result is returned even if there were binding errors. ABoundParameters
object has map and flatMap methods for treating theBoundParameters
object 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
IllegalArgumentException
if no parameter with this name exists in the parameter set.
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getDeclared
-