Package org.openremote.model.value
Class ValueConstraint.AllowedValues
java.lang.Object
org.openremote.model.value.ValueConstraint
org.openremote.model.value.ValueConstraint.AllowedValues
- All Implemented Interfaces:
Serializable
- Enclosing class:
ValueConstraint
The attribute value must match any of the specified values in the
allowedValues
property. The
associated input in the UI will change to a select input with the options specified in the
allowedValues
property. The allowedValueNames
property accepts a list of names that
replace the labels in the select input, if the allowedValueNames
list matches the length of
the allowedValues
list otherwise it falls back to the allowedValues
as labels. Null
values are considered valid. If allowedValues
is not specified or empty the constraint only
accepts null values.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openremote.model.value.ValueConstraint
ValueConstraint.AllowedValues, ValueConstraint.Future, ValueConstraint.FutureOrPresent, ValueConstraint.Max, ValueConstraint.Min, ValueConstraint.NotBlank, ValueConstraint.NotEmpty, ValueConstraint.NotNull, ValueConstraint.Past, ValueConstraint.PastOrPresent, ValueConstraint.Pattern, ValueConstraint.Size
-
Field Summary
Fields inherited from class org.openremote.model.value.ValueConstraint
ALLOWED_VALUES_MESSAGE_TEMPLATE, FUTURE_MESSAGE_TEMPLATE, FUTURE_OR_PRESENT_MESSAGE_TEMPLATE, MAX_MESSAGE_TEMPLATE, message, MIN_MESSAGE_TEMPLATE, NOT_BLANK_MESSAGE_TEMPLATE, NOT_EMPTY_MESSAGE_TEMPLATE, NOT_NULL_MESSAGE_TEMPLATE, PAST_MESSAGE_TEMPLATE, PAST_OR_PRESENT_MESSAGE_TEMPLATE, PATTERN_MESSAGE_TEMPLATE, SIZE_MESSAGE_TEMPLATE, VALUE_CONSTRAINT_INVALID
-
Constructor Summary
ConstructorsConstructorDescriptionAllowedValues
(Object... allowedValues) AllowedValues
(String[] allowedValueNames, Object[] allowedValues) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static <T extends Enum<T>>
ValueConstraint.AllowedValuesfromEnumValues
(T[] enumValues) String[]
Object[]
Methods inherited from class org.openremote.model.value.ValueConstraint
constraints, getMessage
-
Constructor Details
-
AllowedValues
-
AllowedValues
-
-
Method Details
-
getAllowedValues
-
getParameters
- Specified by:
getParameters
in classValueConstraint
-
getAllowedValueNames
-
evaluate
- Specified by:
evaluate
in classValueConstraint
-
fromEnumValues
-