Class IsLessOrEqual<T extends Comparable<T>>
- java.lang.Object
-
- cdc.util.validation.checkers.defaults.IsLessOrEqual<T>
-
public class IsLessOrEqual<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.Factory<IsLessOrEqual>FACTORYstatic cdc.util.args.FormalArgsSFARGSstatic cdc.util.args.FormalArg<String>SMAX
-
Constructor Summary
Constructors Constructor Description IsLessOrEqual(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 IsLessOrEqual<Byte>from(byte max)static IsLessOrEqual<Character>from(char max)static IsLessOrEqual<Double>from(double max)static IsLessOrEqual<Float>from(float max)static IsLessOrEqual<Integer>from(int max)static IsLessOrEqual<Long>from(long max)static IsLessOrEqual<Short>from(short max)static IsLessOrEqual<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
-
-
-
-
Field Detail
-
CLASS
public static final cdc.util.args.FormalArg<Class> CLASS
-
SMAX
public static final cdc.util.args.FormalArg<String> SMAX
-
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<IsLessOrEqual> 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 IsLessOrEqual<String> from(String max)
-
from
public static IsLessOrEqual<Character> from(char max)
-
from
public static IsLessOrEqual<Double> from(double max)
-
from
public static IsLessOrEqual<Float> from(float max)
-
from
public static IsLessOrEqual<Long> from(long max)
-
from
public static IsLessOrEqual<Integer> from(int max)
-
from
public static IsLessOrEqual<Short> from(short max)
-
from
public static IsLessOrEqual<Byte> from(byte max)
-
-