Class ConstraintUtils
java.lang.Object
org.nuxeo.ecm.core.schema.types.constraints.ConstraintUtils
Some usefull utils for Constraint API.
- Since:
- 7.1
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleDateFormat
static <T extends Constraint>
TgetConstraint
(Collection<Constraint> constraints, Class<T> constraintClass) static BigDecimal
objectToBigDecimal
(Object object) Supports any object which toString method return a numeric as String.static Long
objectToPostiveLong
(Object object) Supports any object which toString method return a positive numeric as String.static Long
objectToTimeMillis
(Object object)
-
Field Details
-
DATE_FORMAT
- See Also:
-
-
Method Details
-
formatter
- Returns:
- a date formatter xsd compliant : "yyyy-MM-dd"
- Since:
- 7.1
-
objectToTimeMillis
- Parameters:
object
- Any object- Returns:
- a date represented as number of milliseconds since january 1 1970 if the object is supported, null otherwise.
- Since:
- 7.1
-
objectToBigDecimal
Supports any object which toString method return a numeric as String.- Parameters:
object
- Any object- Returns:
- a BigDecimal if the object represent a number, null otherwise.
- Since:
- 7.1
-
objectToPostiveLong
Supports any object which toString method return a positive numeric as String.- Parameters:
object
- Any object- Returns:
- a positive long value (rounded if needed) if the object represent a positive numeric, null otherwise.
- Since:
- 7.1
-
getConstraint
public static <T extends Constraint> T getConstraint(Collection<Constraint> constraints, Class<T> constraintClass)
-