org.springframework.rules.constraint
Class Not

java.lang.Object
  extended by org.springframework.rules.constraint.Not
All Implemented Interfaces:
Constraint
Direct Known Subclasses:
NegatedPropertyConstraint

public class Not
extends Object
implements Constraint

"Nots" another unary constraint (the inverse) by using composition.

Author:
Keith Donald

Constructor Summary
Not()
          Creates a UnaryNot in temporary invalid state - please use only if you have to, the well-formed constructor is much preferred.
Not(Constraint constraint)
          Creates a UnaryNot
 
Method Summary
 Constraint getConstraint()
           
 void setConstraint(Constraint constraint)
           
 boolean test(Object value)
          Negates the boolean result returned by testing the wrapped constraint.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Not

public Not()
Creates a UnaryNot in temporary invalid state - please use only if you have to, the well-formed constructor is much preferred.


Not

public Not(Constraint constraint)
Creates a UnaryNot

Parameters:
constraint - The constraint to negate.
Method Detail

setConstraint

public void setConstraint(Constraint constraint)

test

public boolean test(Object value)
Negates the boolean result returned by testing the wrapped constraint.

Specified by:
test in interface Constraint
Parameters:
value - the argument value
Returns:
true if the condition was satisfied, false otherwise
See Also:
Constraint.test(java.lang.Object)

toString

public String toString()
Overrides:
toString in class Object

getConstraint

public Constraint getConstraint()


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.