public static class StringValidator.StartsWith extends BaseValidator<String>
| Constructor and Description |
|---|
StartsWith(String prefix,
boolean ignoreCase) |
| Modifier and Type | Method and Description |
|---|---|
String |
getInvalidSpecificationMessage()
If the specification itself is invalid (such as a bad regex string), this
will build a message describing the problem to the user.
|
String |
getTheValueMustDescription()
Get a description of the validation rule.
|
boolean |
isSpecificationValid()
Returns true if the validation criteria itself is valid.
|
boolean |
isValidWithoutNull(String value)
Same as isValid, but no null checking is needed.
|
getInvalidMessage, isValidpublic StartsWith(String prefix, boolean ignoreCase)
public boolean isSpecificationValid()
ValidatorFor things like regex expressions, this would check to see if the regex expression is a valid expression.
public String getInvalidSpecificationMessage()
ValidatorThis method may return a message regardless of if the validation is invalid or not - use isSpecificationValid() to determine if the Validator is configured correctly or not.
public boolean isValidWithoutNull(String value)
BaseValidatorisValidWithoutNull in class BaseValidator<String>value - The value, which is guaranteed to not be null.public String getTheValueMustDescription()
ValidatorAssume that the text returned is prefixed with 'The value must...'
As an example for a regex rule with the pattern 'ABC.*', the return could be: "match the regex pattern 'ABC.*'"
Copyright © 2022. All rights reserved.