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

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.BetweenIncludingLowerBoundCondition
All Implemented Interfaces:
Condition

public class BetweenIncludingLowerBoundCondition
extends AbstractBetweenCondition

An AbstractBetweenCondition implementation that checks whether the checked value is greater than or equals the lower bound and smaller than the upper bound.

Author:
Uri Boness

Constructor Summary
BetweenIncludingLowerBoundCondition(Comparable lowerBound, Comparable upperBound)
          Constructs a new BetweenIncludingLowerBoundCondition with given lower and upper bounds.
BetweenIncludingLowerBoundCondition(Object lowerBound, Object upperBound, Comparator comparator)
          Constructs a new BetweenIncludingLowerBoundCondition with given lower and upper bounds and the comparator that will be used to compared the checked object.
 
Method Summary
protected  boolean checkRange(Object value, Comparator comparator)
          Checks whether the given value is greater than or equals the lower bound and smaller than the upper bound.
 
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

BetweenIncludingLowerBoundCondition

public BetweenIncludingLowerBoundCondition(Comparable lowerBound,
                                           Comparable upperBound)
Constructs a new BetweenIncludingLowerBoundCondition with given lower and upper bounds.

Parameters:
lowerBound - The lower bound.
upperBound - The higher bound.

BetweenIncludingLowerBoundCondition

public BetweenIncludingLowerBoundCondition(Object lowerBound,
                                           Object upperBound,
                                           Comparator comparator)
Constructs a new BetweenIncludingLowerBoundCondition with given lower and upper bounds and the comparator that will be used to compared the checked object.

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

checkRange

protected boolean checkRange(Object value,
                             Comparator comparator)
Checks whether the given value is greater than or equals the lower bound and smaller than the upper bound.

Specified by:
checkRange in class AbstractRangeCondition
Parameters:
value - The value to be compared.
comparator - The comparator to be used to compare the checked value.
Returns:
true if the value is within the range, false otherwise.


Copyright © 2009. All Rights Reserved.