Class MatchesPattern
- java.lang.Object
-
- cdc.util.validation.checkers.defaults.AbstractStringChecker
-
- cdc.util.validation.checkers.defaults.MatchesPattern
-
public final class MatchesPattern extends AbstractStringChecker
-
-
Field Summary
Fields Modifier and Type Field Description static MatchesPatternDIGITSstatic cdc.util.args.Factory<MatchesPattern>FACTORYstatic cdc.util.args.FormalArgsFARGSstatic MatchesPatternLC_LETTERSstatic MatchesPatternLC_LETTERS_OR_DIGITSstatic MatchesPatternLETTERSstatic MatchesPatternLETTERS_OR_DIGITSstatic cdc.util.args.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 argName)Explains the conditions at which a positive or negative result is obtained.PatterngetPattern()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
-
PATTERN
public static final cdc.util.args.FormalArg<String> PATTERN
-
FARGS
public static final cdc.util.args.FormalArgs FARGS
-
FACTORY
public static final cdc.util.args.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 argName)
Description copied from interface:CheckerExplains the conditions at which a positive or negative result is obtained.- Parameters:
result- The result to explain.argName- The argument name to use in explanations.- Returns:
- A string explaining the conditions leading to
result.
-
getPattern
public Pattern getPattern()
-
-