org.springframework.rules.constraint
Class EqualTo

java.lang.Object
  extended by org.springframework.core.closure.support.AlgorithmsAccessor
      extended by org.springframework.rules.constraint.ConstraintsAccessor
          extended by org.springframework.rules.constraint.AbstractBinaryConstraint
              extended by org.springframework.rules.constraint.ComparisonBinaryPredicate
                  extended by org.springframework.rules.constraint.EqualTo
All Implemented Interfaces:
Constraint, BinaryConstraint

public class EqualTo
extends ComparisonBinaryPredicate

Constraint that tests object equality (not identity.)

Author:
Keith Donald

Field Summary
static EqualTo INSTANCE
           
 
Constructor Summary
EqualTo()
           
EqualTo(Comparator comparator)
           
 
Method Summary
static BinaryConstraint instance()
           
static BinaryConstraint instance(Comparator c)
           
static void load(EqualTo instance)
           
 boolean test(Object argument1, Object argument2)
          Test if the two arguments are equal.
protected  boolean testCompareResult(int result)
          Template method for evaluating the compare result.
 String toString()
           
static Constraint value(Object value)
           
static Constraint value(Object value, Comparator comparator)
           
 
Methods inherited from class org.springframework.rules.constraint.ComparisonBinaryPredicate
getComparator
 
Methods inherited from class org.springframework.rules.constraint.AbstractBinaryConstraint
test
 
Methods inherited from class org.springframework.rules.constraint.ConstraintsAccessor
all, all, and, any, any, bind, bind, bind, bind, bind, conjunction, disjunction, eq, eq, eq, eq, eq, eqProperty, eqProperty, getConstraints, gt, gt, gt, gt, gt, gt, gt, gte, gte, gte, gte, gte, gte, gte, gteProperty, gteProperty, gtProperty, gtProperty, ifTrue, ifTrueElse, inGroup, inGroup, inGroup, inRange, inRange, inRangeProperties, inRangeProperties, like, like, lt, lt, lt, lt, lt, lt, lt, lte, lte, lte, lte, lte, lte, lte, lteProperty, lteProperty, ltProperty, ltProperty, maxLength, method, minLength, not, not, or, present, present, range, range, range, range, range, range, range, regexp, regexp, required, required, testResultOf, unique, value
 
Methods inherited from class org.springframework.core.closure.support.AlgorithmsAccessor
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static EqualTo INSTANCE
Constructor Detail

EqualTo

public EqualTo()

EqualTo

public EqualTo(Comparator comparator)
Method Detail

instance

public static BinaryConstraint instance()

load

public static void load(EqualTo instance)

instance

public static BinaryConstraint instance(Comparator c)

value

public static Constraint value(Object value)

value

public static Constraint value(Object value,
                               Comparator comparator)

test

public boolean test(Object argument1,
                    Object argument2)
Test if the two arguments are equal.

Specified by:
test in interface BinaryConstraint
Overrides:
test in class ComparisonBinaryPredicate
Parameters:
argument1 - the first argument
argument2 - the second argument
Returns:
true if they are equal, false otherwise

testCompareResult

protected boolean testCompareResult(int result)
Description copied from class: ComparisonBinaryPredicate
Template method for evaluating the compare result.

Specified by:
testCompareResult in class ComparisonBinaryPredicate
Parameters:
result - The compare result
Returns:
true or false

toString

public String toString()
Overrides:
toString in class Object


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