Class LengthIsInRange
- java.lang.Object
-
- cdc.util.validation.checkers.defaults.AbstractStringChecker
-
- cdc.util.validation.checkers.defaults.LengthIsInRange
-
public class LengthIsInRange extends AbstractStringChecker
Check that the length of string is in a given range.- Author:
- Damien Carbonne
-
-
Constructor Summary
Constructors Constructor Description LengthIsInRange(int min, int max)
-
Method Summary
All 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.intgetMax()intgetMin()booleantest(String value)-
Methods inherited from class cdc.util.validation.checkers.defaults.AbstractStringChecker
getValueClass
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
MIN
public static final cdc.util.args.FormalArg<Integer> MIN
-
MAX
public static final cdc.util.args.FormalArg<Integer> MAX
-
FARGS
public static final cdc.util.args.FormalArgs FARGS
-
FACTORY
public static final cdc.util.args.Factory<LengthIsInRange> FACTORY
-
-
Method Detail
-
test
public boolean test(String value)
-
explain
public String explain(boolean result, String arg)
Description copied from interface:CheckerExplains the conditions at which a positive or negative result is obtained.- 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 int getMin()
-
getMax
public int getMax()
-
-