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 someType.- Since:
- 7.1
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.schema.types.constraints.Constraint
Constraint.Description
-
-
Field Summary
Fields Modifier and Type Field Description protected PrimitiveTypetype-
Fields inherited from interface org.nuxeo.ecm.core.schema.types.constraints.Constraint
MESSAGES_BUNDLE, MESSAGES_DEFAULT_LANG, MESSAGES_KEY
-
-
Constructor Summary
Constructors Constructor Description TypeConstraint(PrimitiveType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Constraint.DescriptiongetDescription()TypegetType()inthashCode()booleanvalidate(Object object)Validates the given object against this constraint.-
Methods inherited from class org.nuxeo.ecm.core.schema.types.constraints.AbstractConstraint
getErrorMessage, getMessageKey, getMessageString, toString
-
-
-
-
Field Detail
-
type
protected final PrimitiveType type
-
-
Constructor Detail
-
TypeConstraint
public TypeConstraint(PrimitiveType type)
-
-
Method Detail
-
validate
public boolean validate(Object object)
Description copied from interface:ConstraintValidates 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()
- Returns:
- The constraint description.
-
-