org.springmodules.validation.util.condition.range
Class BetweenIncludingCondition
java.lang.Object
org.springmodules.validation.util.condition.AbstractCondition
org.springmodules.validation.util.condition.NonNullAcceptingCondition
org.springmodules.validation.util.condition.range.AbstractRangeCondition
org.springmodules.validation.util.condition.range.AbstractBetweenCondition
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.