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

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.AbstractBetweenCondition
                  extended by org.springmodules.validation.util.condition.range.BetweenIncludingCondition
All Implemented Interfaces:
Condition

public class BetweenIncludingCondition
extends AbstractBetweenCondition

An AbstractRangeCondition implementation that checks whether the checked range is between two specific values (including).

Author:
Uri Boness

Constructor Summary
BetweenIncludingCondition(Comparable lowerBound, Comparable upperBound)
          Constructs a new BetweenIncludingCondition with the given bounds (upper and lower) the checked range will be compared with.
BetweenIncludingCondition(Object lowerBound, Object upperBound, Comparator comparator)
          Constructs a new BetweenIncludingCondition with the given bounds (upper and lower) 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 between the bounds associated with this condition.
 
Methods inherited from class org.springmodules.validation.util.condition.range.AbstractBetweenCondition
getLowerBound, getUpperBound
 
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

BetweenIncludingCondition

public BetweenIncludingCondition(Comparable lowerBound,
                                 Comparable upperBound)
Constructs a new BetweenIncludingCondition with the given bounds (upper and lower) the checked range will be compared with.

Parameters:
lowerBound - The lower bound the checked object will be compared with.
upperBound - The upper bound the checked object will be compared with.

BetweenIncludingCondition

public BetweenIncludingCondition(Object lowerBound,
                                 Object upperBound,
                                 Comparator comparator)
Constructs a new BetweenIncludingCondition with the given bounds (upper and lower) and the comparator to be used to compare the checked value.

Parameters:
lowerBound - The lower bound the checked value will be compared with.
upperBound - The upper bound the checked value will be compared with.
comparator - The comparator that will be used to compare the checked value.
Method Detail

checkRange

protected boolean checkRange(Object value,
                             Comparator comparator)
Checks whether the given value is between the bounds 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 range is greater than or equals the lower bound and smaller than or equals the upper bound, false otherwise.


Copyright © 2009. All Rights Reserved.