Package cdc.validation.checkers.defaults
Class IsInRange<T extends Comparable<T>>
- java.lang.Object
-
- cdc.validation.checkers.defaults.IsInRange<T>
-
public class IsInRange<T extends Comparable<T>> extends Object implements Checker<T>
-
-
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 IsInRange<Byte>from(byte min, byte max)static IsInRange<Character>from(char min, char max)static IsInRange<Double>from(double min, double max)static IsInRange<Float>from(float min, float max)static IsInRange<Integer>from(int min, int max)static IsInRange<Long>from(long min, long max)static IsInRange<Short>from(short min, short max)static IsInRange<String>from(String min, String max)TgetMax()TgetMin()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
-
CMIN
public static final FormalArg<Comparable> CMIN
-
CMAX
public static final FormalArg<Comparable> CMAX
-
SFARGS
public static final FormalArgs SFARGS
-
CFARGS
public static final FormalArgs CFARGS
-
-
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.
-
getMin
public T getMin()
-
getMax
public T getMax()
-
-