org.specrunner.comparators.core
Class ComparatorNode

java.lang.Object
  extended by org.specrunner.comparators.core.ComparatorDefault
      extended by org.specrunner.comparators.core.ComparatorNode
All Implemented Interfaces:
Serializable, Comparator<Object>, IComparator, IResetable

public class ComparatorNode
extends ComparatorDefault

A default node comparator. Compare each node: text-by-text and attribute by attribute.

Author:
Thiago Santos.
See Also:
Serialized Form

Constructor Summary
ComparatorNode()
           
 
Method Summary
 Class<?> getType()
          The comparator reference type.
 boolean match(Object expected, Object received)
          Says if two objects can be considered equals.
protected  String toString(Object obj)
          Convert object to String.
 
Methods inherited from class org.specrunner.comparators.core.ComparatorDefault
compare, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ComparatorNode

public ComparatorNode()
Method Detail

getType

public Class<?> getType()
Description copied from interface: IComparator
The comparator reference type.

Specified by:
getType in interface IComparator
Overrides:
getType in class ComparatorDefault
Returns:
The comparator target.

match

public boolean match(Object expected,
                     Object received)
Description copied from interface: IComparator
Says if two objects can be considered equals.

Specified by:
match in interface IComparator
Overrides:
match in class ComparatorDefault
Parameters:
expected - The expected value.
received - The received value.
Returns:
true, if they are equal, false, otherwise.

toString

protected String toString(Object obj)
Description copied from class: ComparatorDefault
Convert object to String.

Overrides:
toString in class ComparatorDefault
Parameters:
obj - An object.
Returns:
A string for that object.


Copyright © 2014. All rights reserved.