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