01: package org.jreform.criteria;
02:
03: /**
04: * Checks that value is greater than or equal to the given {@link Comparable}.
05: *
06: * @author armandino (at) gmail.com
07: */
08: public final class Min<T extends Comparable<T>> extends
09: AbstractCriterion<T> {
10: private T min;
11:
12: Min(T min) {
13: this .min = min;
14: }
15:
16: protected boolean verify(T value) {
17: return value.compareTo(min) >= 0;
18: }
19:
20: protected String generateErrorMessage() {
21: return "The value must not be less than " + min;
22: }
23:
24: }
|