AbstractConstraint

Monster.Constraints. AbstractConstraint

Constraints are used to define conditions that must be met by the value of a variable.

The uniform API of the constraints allows chains to be formed.

The abstract constraint defines the api for all constraints. mainly the method isValid() is defined.

derived classes must implement the method isValid().

Constructor

# new AbstractConstraint()

The abstract constraint

Since:
  • 1.3.0

Methods

# isValid(value) → {Promise}

this method must return a promise containing the result of the check.

Parameters:
Name Type Description
value *
Returns:
Type
Promise