org.springframework.rules.constraint
Class ParameterizedBinaryConstraint

Show UML class diagram
java.lang.Object
  extended by org.springframework.rules.constraint.ParameterizedBinaryConstraint
All Implemented Interfaces:
Constraint

public class ParameterizedBinaryConstraint
extends Object
implements Constraint

A unary constraint adapting a binary constraint that uses a parameterized constant value as the second argument when testing.

Author:
Keith Donald

Constructor Summary
ParameterizedBinaryConstraint(BinaryConstraint constraint, boolean bool)
          Convenience constructor for boolean parameters.
ParameterizedBinaryConstraint(BinaryConstraint constraint, byte b)
          Convenience constructor for byte parameters.
ParameterizedBinaryConstraint(BinaryConstraint constraint, double number)
          Convenience constructor for double parameters.
ParameterizedBinaryConstraint(BinaryConstraint constraint, float number)
          Convenience constructor for float parameters.
ParameterizedBinaryConstraint(BinaryConstraint constraint, int number)
          Convenience constructor for integer parameters.
ParameterizedBinaryConstraint(BinaryConstraint constraint, Object parameter)
          Creates a ParameterizedBinaryPredicate that binds the provided parameter constant as the second argument to the constraint during tests.
ParameterizedBinaryConstraint(BinaryConstraint constraint, short number)
          Convenience constructor for short parameters.
 
Method Summary
 BinaryConstraint getConstraint()
           
 Object getParameter()
           
 boolean test(Object value)
          Tests the wrapped binary constraint with the variable argument value, passing in the parameter constant as the second argument.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     Object parameter)
Creates a ParameterizedBinaryPredicate that binds the provided parameter constant as the second argument to the constraint during tests.

Parameters:
constraint - The binary constraint to adapt as a unary constraint
parameter - The constant parameter value

ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     short number)
Convenience constructor for short parameters.


ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     byte b)
Convenience constructor for byte parameters.


ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     int number)
Convenience constructor for integer parameters.


ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     float number)
Convenience constructor for float parameters.


ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     double number)
Convenience constructor for double parameters.


ParameterizedBinaryConstraint

public ParameterizedBinaryConstraint(BinaryConstraint constraint,
                                     boolean bool)
Convenience constructor for boolean parameters.

Method Detail

getParameter

public Object getParameter()

getConstraint

public BinaryConstraint getConstraint()

test

public boolean test(Object value)
Tests the wrapped binary constraint with the variable argument value, passing in the parameter constant as the second argument.

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


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