Package cdc.validation.checkers.defaults
Class MatchesPattern
- java.lang.Object
-
- cdc.validation.checkers.defaults.AbstractStringChecker
-
- cdc.validation.checkers.defaults.MatchesPattern
-
public final class MatchesPattern extends AbstractStringChecker
-
-
Field Summary
Fields Modifier and Type Field Description static MatchesPatternDIGITSstatic Factory<MatchesPattern>FACTORYstatic FormalArgsFARGSstatic MatchesPatternLC_LETTERSstatic MatchesPatternLC_LETTERS_OR_DIGITSstatic MatchesPatternLETTERSstatic MatchesPatternLETTERS_OR_DIGITSstatic FormalArg<String>PATTERNstatic MatchesPatternUC_LETTERSstatic MatchesPatternUC_LETTERS_OR_DIGITS
-
Constructor Summary
Constructors Constructor Description MatchesPattern(String regex)MatchesPattern(Pattern pattern)
-
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.PatterngetPattern()booleantest(String value)-
Methods inherited from class cdc.validation.checkers.defaults.AbstractStringChecker
getValueClass
-
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
-
FARGS
public static final FormalArgs FARGS
-
FACTORY
public static final Factory<MatchesPattern> FACTORY
-
LETTERS
public static final MatchesPattern LETTERS
-
DIGITS
public static final MatchesPattern DIGITS
-
LETTERS_OR_DIGITS
public static final MatchesPattern LETTERS_OR_DIGITS
-
UC_LETTERS
public static final MatchesPattern UC_LETTERS
-
UC_LETTERS_OR_DIGITS
public static final MatchesPattern UC_LETTERS_OR_DIGITS
-
LC_LETTERS
public static final MatchesPattern LC_LETTERS
-
LC_LETTERS_OR_DIGITS
public static final MatchesPattern LC_LETTERS_OR_DIGITS
-
-
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.
-
getPattern
public Pattern getPattern()
-
-