org.qi4j.library.constraints
Class RangeConstraint
java.lang.Object
org.qi4j.library.constraints.RangeConstraint
- All Implemented Interfaces:
- Serializable, Constraint<Range,Number>
public class RangeConstraint
- extends Object
- implements Constraint<Range,Number>
JAVADOC
- See Also:
- Serialized Form
Method Summary |
boolean |
isValid(Range range,
Number argument)
For each value or parameter which should be checked this method will be invoked. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RangeConstraint
public RangeConstraint()
isValid
public boolean isValid(Range range,
Number argument)
- Description copied from interface:
Constraint
- For each value or parameter which should be checked this method will be invoked.
If the method returns true the value is valid. If it returns false the value
is considered invalid. When all constraints have been checked a ConstraintViolationException
will be thrown with all the constraint violations that were found.
- Specified by:
isValid
in interface Constraint<Range,Number>
- Parameters:
range
- the annotation to matchargument
- the value to be checked
- Returns:
- true if valid, false if invalid