public class MaxLengthConstraint extends java.lang.Object implements ValidationConstraint<MaxLength>
Modifier and Type | Field and Description |
---|---|
protected int |
max |
Constructor and Description |
---|
MaxLengthConstraint() |
MaxLengthConstraint(int max) |
Modifier and Type | Method and Description |
---|---|
void |
configure(MaxLength annotation)
Configures constraint from associated annotation.
|
int |
getMax() |
boolean |
isValid(ValidationConstraintContext vcc,
java.lang.Object value)
Performs validation in context of target object on provided value.
|
void |
setMax(int max) |
static boolean |
validate(java.lang.Object value,
int max) |
public MaxLengthConstraint()
public MaxLengthConstraint(int max)
public int getMax()
public void setMax(int max)
public void configure(MaxLength annotation)
ValidationConstraint
configure
in interface ValidationConstraint<MaxLength>
public boolean isValid(ValidationConstraintContext vcc, java.lang.Object value)
ValidationConstraint
isValid
in interface ValidationConstraint<MaxLength>
true
if validation passes, otherwise false
.public static boolean validate(java.lang.Object value, int max)
Copyright © 2003-present Jodd Team