Class IsInRange<T extends Comparable<T>>
- java.lang.Object
-
- cdc.util.validation.checkers.defaults.IsInRange<T>
-
public class IsInRange<T extends Comparable<T>> extends Object implements Checker<T>
-
-
Field Summary
Fields Modifier and Type Field Description static cdc.util.args.FormalArgsCFARGSstatic cdc.util.args.FormalArg<Class>CLASSstatic cdc.util.args.FormalArg<Comparable>CMAXstatic cdc.util.args.FormalArg<Comparable>CMINstatic cdc.util.args.Factory<IsInRange>FACTORYstatic cdc.util.args.FormalArgsSFARGSstatic cdc.util.args.FormalArg<String>SMAXstatic cdc.util.args.FormalArg<String>SMIN
-
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
-
-
-
-
Field Detail
-
CLASS
public static final cdc.util.args.FormalArg<Class> CLASS
-
SMIN
public static final cdc.util.args.FormalArg<String> SMIN
-
SMAX
public static final cdc.util.args.FormalArg<String> SMAX
-
CMIN
public static final cdc.util.args.FormalArg<Comparable> CMIN
-
CMAX
public static final cdc.util.args.FormalArg<Comparable> CMAX
-
SFARGS
public static final cdc.util.args.FormalArgs SFARGS
-
CFARGS
public static final cdc.util.args.FormalArgs CFARGS
-
FACTORY
public static final cdc.util.args.Factory<IsInRange> 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.
-
getMin
public T getMin()
-
getMax
public T getMax()
-
-