Examples of RangeConstraint


Examples of org.grails.validation.RangeConstraint

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public Comparable getMin() {
        Comparable minValue = null;

        MinConstraint minConstraint = (MinConstraint)appliedConstraints.get(MIN_CONSTRAINT);
        RangeConstraint rangeConstraint = (RangeConstraint)appliedConstraints.get(RANGE_CONSTRAINT);

        if (minConstraint != null || rangeConstraint != null) {
            Comparable minConstraintValue = minConstraint != null ? minConstraint.getMinValue() : null;
            Comparable rangeConstraintLowValue = rangeConstraint != null ? rangeConstraint.getRange().getFrom() : null;

            if (minConstraintValue != null && rangeConstraintLowValue != null) {
                minValue = (minConstraintValue.compareTo(rangeConstraintLowValue) > 0) ? minConstraintValue : rangeConstraintLowValue;
            }
            else if (minConstraintValue == null && rangeConstraintLowValue != null) {
View Full Code Here

Examples of org.grails.validation.RangeConstraint

     * @return Returns the range.
     */
    @Override
    @SuppressWarnings("rawtypes")
    public Range getRange() {
        RangeConstraint c = (RangeConstraint)appliedConstraints.get(RANGE_CONSTRAINT);
        return c == null ? null : c.getRange();
    }
View Full Code Here

Examples of org.grails.validation.RangeConstraint

            appliedConstraints.remove(RANGE_CONSTRAINT);
        }
        else {
            Constraint c = appliedConstraints.get(RANGE_CONSTRAINT);
            if (c == null) {
                c = new RangeConstraint();
                c.setOwningClass(owningClass);
                c.setPropertyName(propertyName);
                appliedConstraints.put(RANGE_CONSTRAINT,c);
            }
            c.setParameter(range);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.