Package nz.org.riskscape.engine.bind
Class ParameterTemplate
java.lang.Object
nz.org.riskscape.engine.bind.ParameterTemplate
Contains the aspects of a parameter that the user can customize themselves. In general,
these aspects relate to how the parameter is presented to other users, especially via a UI.
A ParameterTemplate can be associated with one or more ModelParameter
s.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A parameter can have a set of pre-defined choices, i.e. -
Field Summary
-
Constructor Summary
ConstructorDescriptionParameterTemplate
(Optional<String> label, Optional<String> description, Set<ParameterProperty> properties, List<ParameterTemplate.Choice> choices) ParameterTemplate
(Optional<String> label, Optional<String> description, Set<ParameterProperty> properties, List<ParameterTemplate.Choice> choices, Optional<String> defaultValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
getLabel()
Returns all properties for the parameter.<T extends ParameterProperty>
Optional<T>getProperty
(T property) Returns the specified property, if present in the template.int
hashCode()
boolean
hasProperty
(ParameterProperty property) toString()
validate
(BindingContext context, Object bound) withDefaultValue
(String newDefault) withProperties
(Set<ParameterProperty> newProperties)
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ParameterTemplate
public ParameterTemplate(Optional<String> label, Optional<String> description, Set<ParameterProperty> properties, List<ParameterTemplate.Choice> choices) -
ParameterTemplate
public ParameterTemplate(Optional<String> label, Optional<String> description, Set<ParameterProperty> properties, List<ParameterTemplate.Choice> choices, Optional<String> defaultValue)
-
-
Method Details
-
hasProperty
-
getProperty
Returns the specified property, if present in the template. This is mainly useful for
KeyValueProperty
, where the actual ParameterProperty instance has more info associated with it. -
withLabel
-
withProperties
- Returns:
- a cloned copy of this template with the newProperties specified
-
withDefaultValue
-
validate
-
getProperties
Returns all properties for the parameter. These properties may be explicitly set by the user, implied (e.g. MIN_VALUE implies NUMERIC), or inferred (e.g. if no properties are explicitly set, then we can tell from the default value
[1,2,3]
that the parameter is both NUMERIC and a LIST). -
getLabel
-
getDescription
-
getChoices
-
getDefaultValue
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-