Class TypeConstraint

java.lang.Object
org.nuxeo.ecm.core.schema.types.constraints.AbstractConstraint
org.nuxeo.ecm.core.schema.types.constraints.TypeConstraint
All Implemented Interfaces:
Serializable, Constraint

public class TypeConstraint extends AbstractConstraint
This constraint ensures some object's is supported by some Type.
Since:
7.1
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • validate

      public boolean validate(Object object)
      Description copied from interface: Constraint
      Validates the given object against this constraint.

      If some object is null. Constraint should return true while validating unless the constraint deals with nullable state.

      Parameters:
      object - the object to validate
      Returns:
      true if the object was successfully validated, false otherwise
    • getDescription

      public Constraint.Description getDescription()
      Here, value is :
      name = AbstractType.getName()
      parameters =
      Returns:
      The constraint description.
    • getType

      public Type getType()
      Returns:
      The type used by this constraint to validate.
      Since:
      7.1
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object