Package cdc.validation.checkers.defaults
Class IsLessThan<T extends Comparable<T>>
- java.lang.Object
-
- cdc.validation.checkers.defaults.IsLessThan<T>
-
public class IsLessThan<T extends Comparable<T>> extends Object implements Checker<T>
-
-
Field Summary
Fields Modifier and Type Field Description static FormalArgsCFARGSstatic FormalArg<Class>CLASSstatic FormalArg<Comparable>CMAXstatic Factory<IsLessThan>FACTORYstatic FormalArgsSFARGSstatic FormalArg<String>SMAX
-
Constructor Summary
Constructors Constructor Description IsLessThan(Class<T> valueClass, T max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringexplain(boolean result, String arg)Explains the conditions at which a positive or negative result is obtained.static IsLessThan<Byte>from(byte max)static IsLessThan<Character>from(char max)static IsLessThan<Double>from(double max)static IsLessThan<Float>from(float max)static IsLessThan<Integer>from(int max)static IsLessThan<Long>from(long max)static IsLessThan<Short>from(short max)static IsLessThan<String>from(String max)TgetMax()Class<T>getValueClass()booleantest(T value)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cdc.validation.checkers.Checker
after, after, afterRaw, and, andRaw, cast, cast, explain, explain, negate, or, orRaw, testAndExplain, testAndExplain, testAndExplainRaw, testAndExplainRaw, testRaw, wrap
-
-
-
-
Field Detail
-
CMAX
public static final FormalArg<Comparable> CMAX
-
SFARGS
public static final FormalArgs SFARGS
-
CFARGS
public static final FormalArgs CFARGS
-
FACTORY
public static final Factory<IsLessThan> FACTORY
-
-
Method Detail
-
getValueClass
public Class<T> getValueClass()
- Specified by:
getValueClassin interfaceChecker<T extends Comparable<T>>- Returns:
- The class of tested values.
-
test
public boolean test(T value)
- Specified by:
testin interfaceChecker<T extends Comparable<T>>- Specified by:
testin interfacePredicate<T extends Comparable<T>>
-
explain
public String explain(boolean result, String arg)
Description copied from interface:CheckerExplains the conditions at which a positive or negative result is obtained.- Specified by:
explainin interfaceChecker<T extends Comparable<T>>- Parameters:
result- The result to explain.arg- The argument name to use in explanations.- Returns:
- A string explaining the conditions leading to
result.
-
getMax
public T getMax()
-
from
public static IsLessThan<String> from(String max)
-
from
public static IsLessThan<Character> from(char max)
-
from
public static IsLessThan<Double> from(double max)
-
from
public static IsLessThan<Float> from(float max)
-
from
public static IsLessThan<Long> from(long max)
-
from
public static IsLessThan<Integer> from(int max)
-
from
public static IsLessThan<Short> from(short max)
-
from
public static IsLessThan<Byte> from(byte max)
-
-