An operational view of constraints as defined by the Matter specification.

A "constraint" limits possible data values.

Formally a constraint is not considered a quality by the specification. It is handled similarly to qualities, though, so we keep it in the same section.

Hierarchy (view full)

Implements

Constructors

  • Initialize from a Constraint.Definition or the constraint DSL defined by the Matter Specification.

    Parameters

    Returns Constraint

Properties

definition: Definition
desc?: boolean

Indicates constraint is defined in prose and cannot be enforced automatically.

entry?: Constraint

Constraint on list child element.

errors?: DefinitionError[]

Require set membership for the value.

Upper bound on value or sequence length.

Lower bound on value or sequence length.

parts?: Constraint[]

List of sub-constraints in a sequence.

value?: FieldValue

Constant value.

Accessors

  • get empty(): boolean
  • Returns boolean

  • get valid(): boolean
  • Returns boolean

Methods

  • Test for logical equivalence.

    Parameters

    • other: any

    Returns boolean

  • Parameters

    • code: string
    • message: string

    Returns void

  • Returns void

  • Test a value against a constraint. Does not recurse into arrays.

    Parameters

    • value: FieldValue
    • Optionalproperties: Record<string, any>

    Returns boolean

  • Returns string

  • Returns string