Interface IAllowedValuesConstraint
-
- All Superinterfaces:
IConstraint
- All Known Implementing Classes:
DefaultAllowedValuesConstraint
public interface IAllowedValuesConstraint extends IConstraint
Represents a rule requiring the value of a field or flag to match the name of one entry in a set of enumerated values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IAllowedValuesConstraint.Extensible
-
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.core.model.constraint.IConstraint
IConstraint.ExternalModelSource, IConstraint.ExternalSource, IConstraint.InternalModelSource, IConstraint.ISource, IConstraint.Level
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_ALLOW_OTHER
static IAllowedValuesConstraint.Extensible
DEFAULT_EXTENSIBLE
-
Fields inherited from interface gov.nist.secauto.metaschema.core.model.constraint.IConstraint
DEFAULT_LEVEL, DEFAULT_TARGET, DEFAULT_TARGET_METAPATH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IAllowedValue
getAllowedValue(String name)
Get a specific allowed value by name, if it is defined for this constraint.Map<String,? extends IAllowedValue>
getAllowedValues()
Get the collection allowed values associated with this constraint.IAllowedValuesConstraint.Extensible
getExtensible()
Determines the degree to which this constraint can be extended by other constraints applied to the same value.boolean
isAllowedOther()
Determines if this allowed value constraint is open-ended (true
) or closed.-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.constraint.IConstraint
accept, getDescription, getFormalName, getId, getLevel, getProperties, getRemarks, getSource, getTarget, matchTargets, matchTargets
-
-
-
-
Field Detail
-
DEFAULT_ALLOW_OTHER
static final boolean DEFAULT_ALLOW_OTHER
- See Also:
- Constant Field Values
-
DEFAULT_EXTENSIBLE
@NonNull static final IAllowedValuesConstraint.Extensible DEFAULT_EXTENSIBLE
-
-
Method Detail
-
getAllowedValues
@NonNull Map<String,? extends IAllowedValue> getAllowedValues()
Get the collection allowed values associated with this constraint.- Returns:
- a mapping of value to the associated
IAllowedValue
item
-
getAllowedValue
@Nullable default IAllowedValue getAllowedValue(String name)
Get a specific allowed value by name, if it is defined for this constraint.- Parameters:
name
- the value name- Returns:
- the allowed value or
null
if the value is not defined
-
isAllowedOther
boolean isAllowedOther()
Determines if this allowed value constraint is open-ended (true
) or closed. If "open-ended", the constraint allows the target's value to by any additional unspecified value. If "closed", the constraint requries the target's value to be one of the specified values.- Returns:
true
if the constraint is "open-ended", orfalse
otherwise
-
getExtensible
@NonNull IAllowedValuesConstraint.Extensible getExtensible()
Determines the degree to which this constraint can be extended by other constraints applied to the same value.- Returns:
- the enumeration value
-
-