org.pojomatic
Interface Pojomator<T>

Type Parameters:
T - the class this Pojomator is generated for.
All Known Implementing Classes:
PojomatorImpl

public interface Pojomator<T>

A provider of the three standard Object methods, Object.equals(Object), Object.hashCode() and Object.toString().


Method Summary
 Differences doDiff(T instance, T other)
          Compute the differences between instance and other among the properties examined by doEquals(Object, Object).
 boolean doEquals(T instance, java.lang.Object other)
          Compute whether instance and other are equal to each other in the sense of Object's equals method.
 int doHashCode(T instance)
          Compute the hashCode for a given instance of T.
 java.lang.String doToString(T instance)
          Compute the toString representation for a given instance of T
 

Method Detail

doHashCode

int doHashCode(T instance)
Compute the hashCode for a given instance of T.

Parameters:
instance - the instance to compute the hashCode for - must not be null
Returns:
the hashCode of instance
See Also:
Object.hashCode()

doToString

java.lang.String doToString(T instance)
Compute the toString representation for a given instance of T

Parameters:
instance - the instance to compute the toString representation for - must not be null
Returns:
the toString representation of instance
See Also:
Object.toString()

doEquals

boolean doEquals(T instance,
                 java.lang.Object other)
Compute whether instance and other are equal to each other in the sense of Object's equals method.

Parameters:
instance - the instance to test against - must not be null
other - the instance to test
Returns:
true if instance should be considered equal to other, and false otherwise.
See Also:
Object.equals(Object)

doDiff

Differences doDiff(T instance,
                   T other)
Compute the differences between instance and other among the properties examined by doEquals(Object, Object). It is guaranteed that invoking Differences.areEqual() on the returned object will return true iff instance.equals(other).

Parameters:
instance - the instance to diff against - must not be null
other - the instance to diff
Returns:
the differences between instance and other among the properties examined by doEquals(Object, Object).


Copyright © 2008-2009. All Rights Reserved.