jodd.vtor.constraint
Class RangeConstraint

java.lang.Object
  extended by jodd.vtor.constraint.RangeConstraint
All Implemented Interfaces:
ValidationConstraint<Range>

public class RangeConstraint
extends java.lang.Object
implements ValidationConstraint<Range>


Field Summary
protected  double max
           
protected  double min
           
 
Constructor Summary
RangeConstraint()
           
RangeConstraint(double min, double max)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

min

protected double min

max

protected double max
Constructor Detail

RangeConstraint

public RangeConstraint()

RangeConstraint

public RangeConstraint(double min,
                       double max)
Method Detail

getMin

public double getMin()

setMin

public void setMin(double min)

getMax

public double getMax()

setMax

public void setMax(double max)

configure

public void configure(Range annotation)
Description copied from interface: ValidationConstraint
Configures constraint from associated annotation.

Specified by:
configure in interface ValidationConstraint<Range>

isValid

public boolean isValid(ValidationConstraintContext vcc,
                       java.lang.Object value)
Description copied from interface: ValidationConstraint
Performs validation in context of target object on provided value.

Specified by:
isValid in interface ValidationConstraint<Range>
Returns:
true if validation passes, otherwise false.

validate

public static boolean validate(java.lang.Object value,
                               double min,
                               double max)


Copyright © 2003-2013 Jodd Team