org.pojomatic.internal
Class ClassProperties

java.lang.Object
  extended by org.pojomatic.internal.ClassProperties

public class ClassProperties
extends java.lang.Object

The properties of a class used for PojomatorImpl.doHashCode(Object), PojomatorImpl.doEquals(Object, Object), and PojomatorImpl.doToString(Object).


Method Summary
static ClassProperties forClass(java.lang.Class<?> pojoClass)
          Get an instance for the given pojoClass.
 java.util.Collection<PropertyElement> getEqualsProperties()
          Gets the properties to use for PojomatorImpl.doEquals(Object, Object).
 java.util.Collection<PropertyElement> getHashCodeProperties()
          Gets the properties to use for PojomatorImpl.doHashCode(Object).
 java.util.Collection<PropertyElement> getToStringProperties()
          Gets the properties to use for PojomatorImpl.doToString(Object).
 boolean isCompatibleForEquals(java.lang.Class<?> otherClass)
          Whether instances of otherClass are candidates for being equal to instances of the class this ClassProperties instance was created for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forClass

public static ClassProperties forClass(java.lang.Class<?> pojoClass)
                                throws NoPojomaticPropertiesException
Get an instance for the given pojoClass. Instances are cached, so calling this method repeatedly is not inefficient.

Parameters:
pojoClass - the class to inspect for properties
Returns:
The ClassProperties for pojoClass.
Throws:
NoPojomaticPropertiesException - if pojoClass has no properties annotated for use with Pojomatic.

getEqualsProperties

public java.util.Collection<PropertyElement> getEqualsProperties()
Gets the properties to use for PojomatorImpl.doEquals(Object, Object).

Returns:
the properties to use for PojomatorImpl.doEquals(Object, Object).

getHashCodeProperties

public java.util.Collection<PropertyElement> getHashCodeProperties()
Gets the properties to use for PojomatorImpl.doHashCode(Object).

Returns:
the properties to use for PojomatorImpl.doHashCode(Object).

getToStringProperties

public java.util.Collection<PropertyElement> getToStringProperties()
Gets the properties to use for PojomatorImpl.doToString(Object).

Returns:
the properties to use for PojomatorImpl.doToString(Object).

isCompatibleForEquals

public boolean isCompatibleForEquals(java.lang.Class<?> otherClass)
Whether instances of otherClass are candidates for being equal to instances of the class this ClassProperties instance was created for.

Parameters:
otherClass - the class to check for compatibility for equals with.
Returns:
true if instances of otherClass are candidates for being equal to instances of the class this ClassProperties instance was created for, or false otherwise.


Copyright © 2008-2010. All Rights Reserved.