org.springframework.rules.constraint
Class ClosureResultConstraint
java.lang.Object
org.springframework.rules.constraint.ClosureResultConstraint
- All Implemented Interfaces:
- Constraint
public class ClosureResultConstraint
- extends Object
- implements Constraint
Tests the result returned from evaluating a closure closure.
- Author:
- Keith Donald
ClosureResultConstraint
public ClosureResultConstraint(Closure closure,
Constraint constraint)
- Creates a ClosureResultConstraint that tests the result returned from
evaulating the specified unary closure.
- Parameters:
closure
- The closure to test.constraint
- The predicate that will test the closure return value.
test
public boolean test(Object argument)
- Tests the result returned by evaluating the specified argument against
the configured closure.
- Specified by:
test
in interface Constraint
- Parameters:
argument
- the argument value
- Returns:
true
if the condition was satisfied,
false
otherwise- See Also:
Constraint.test(java.lang.Object)
getFunction
public Closure getFunction()
getPredicate
public Constraint getPredicate()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2004-2008 The Spring Framework. All Rights Reserved.