public class HasSubstringConstraint extends java.lang.Object implements ValidationConstraint<HasSubstring>
Modifier and Type | Field and Description |
---|---|
protected boolean |
ignoreCase |
protected java.lang.String |
substring |
Constructor and Description |
---|
HasSubstringConstraint() |
HasSubstringConstraint(java.lang.String substring,
boolean ignoreCase) |
Modifier and Type | Method and Description |
---|---|
void |
configure(HasSubstring annotation)
Configures constraint from associated annotation.
|
java.lang.String |
getSubstring() |
boolean |
isIgnoreCase() |
boolean |
isValid(ValidationConstraintContext vcc,
java.lang.Object value)
Performs validation in context of target object on provided value.
|
void |
setIgnoreCase(boolean ignoreCase) |
void |
setSubstring(java.lang.String substring) |
static boolean |
validate(java.lang.Object value,
java.lang.String substring,
boolean ignoreCase) |
public HasSubstringConstraint()
public HasSubstringConstraint(java.lang.String substring, boolean ignoreCase)
public java.lang.String getSubstring()
public void setSubstring(java.lang.String substring)
public boolean isIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
public void configure(HasSubstring annotation)
ValidationConstraint
configure
in interface ValidationConstraint<HasSubstring>
public boolean isValid(ValidationConstraintContext vcc, java.lang.Object value)
ValidationConstraint
isValid
in interface ValidationConstraint<HasSubstring>
true
if validation passes, otherwise false
.public static boolean validate(java.lang.Object value, java.lang.String substring, boolean ignoreCase)
Copyright © 2003-present Jodd Team