org.springmodules.validation.util.condition.range
Class LessThanOrEqualsCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.condition.NonNullAcceptingCondition
          extended by org.springmodules.validation.util.condition.range.AbstractRangeCondition
              extended by org.springmodules.validation.util.condition.range.AbstractSingleBoundCondition
                  extended by org.springmodules.validation.util.condition.range.LessThanOrEqualsCondition
All Implemented Interfaces:
Condition

public class LessThanOrEqualsCondition
extends AbstractSingleBoundCondition

An AbstractSingleBoundCondition implementation that checks whether the checked value is less than or equals as specific upper bound.

Author:
Uri Boness

Field Summary
 
Fields inherited from class org.springmodules.validation.util.condition.range.AbstractSingleBoundCondition
bound
 
Constructor Summary
LessThanOrEqualsCondition(Comparable upperBound)
          Constructs a new LessThanCondition with a given upper bound.
LessThanOrEqualsCondition(Object upperBound, Comparator comparator)
          Constructs a new LessThanOrEqualsCondition with given upper bound and the comparator to be used to compare the checked value.
 
Method Summary
protected  boolean checkRange(Object value, Comparator comparator)
          Checks whether the given value is less than or equals the upper bound associated with this condition.
 
Methods inherited from class org.springmodules.validation.util.condition.range.AbstractRangeCondition
doCheck
 
Methods inherited from class org.springmodules.validation.util.condition.NonNullAcceptingCondition
beforeObjectChecked
 
Methods inherited from class org.springmodules.validation.util.condition.AbstractCondition
afterObjectChecked, and, check, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LessThanOrEqualsCondition

public LessThanOrEqualsCondition(Comparable upperBound)
Constructs a new LessThanCondition with a given upper bound.

Parameters:
upperBound - The upper bound.

LessThanOrEqualsCondition

public LessThanOrEqualsCondition(Object upperBound,
                                 Comparator comparator)
Constructs a new LessThanOrEqualsCondition with given upper bound and the comparator to be used to compare the checked value.

Parameters:
upperBound - The upper bound.
comparator - The comparator.
Method Detail

checkRange

protected boolean checkRange(Object value,
                             Comparator comparator)
Checks whether the given value is less than or equals the upper bound associated with this condition.

Specified by:
checkRange in class AbstractRangeCondition
Parameters:
value - The value to be checked.
comparator - The comparator to be used to compare the checked value.
Returns:
true if the given value is less than or equals the upper bound, false otherwise.


Copyright © 2009. All Rights Reserved.