org.eobjects.metamodel.util
Class BaseObject

java.lang.Object
  extended by org.eobjects.metamodel.util.BaseObject
Direct Known Subclasses:
AbstractDataSet, AbstractQueryClause, AbstractRelationship, FilterItem, FromItem, GroupByItem, InitFromBuilderImpl, OrderByItem, Query, SelectItem

public abstract class BaseObject
extends Object

A base object type with conveniently implemented base methods like hashCode() and equals(). Subclasses should implement the decorateIdentity(List) method to have equals(Object) and hashCode() automatically implemented.

Author:
Kasper Sørensen

Constructor Summary
BaseObject()
           
 
Method Summary
protected  boolean classEquals(BaseObject obj)
          Override this method if the equals method should support different subtypes.
protected abstract  void decorateIdentity(List<Object> identifiers)
          Subclasses should implement this method and add all fields to the list that are to be included in equals(...) and hashCode() evaluation
 boolean equals(Object obj)
          
 int hashCode()
          
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseObject

public BaseObject()
Method Detail

toString

public String toString()
Overrides:
toString in class Object

hashCode

public final int hashCode()

Overrides:
hashCode in class Object

classEquals

protected boolean classEquals(BaseObject obj)
Override this method if the equals method should support different subtypes. For example, if different subtypes of Number should be supported, implement this method with: obj instanceof Number and make sure that the decorateIdentity(...) method will always return a comparable list of identity-objects.

Parameters:
obj -
Returns:
true if the provided object's class is accepted for equals comparison

equals

public final boolean equals(Object obj)

Overrides:
equals in class Object

decorateIdentity

protected abstract void decorateIdentity(List<Object> identifiers)
Subclasses should implement this method and add all fields to the list that are to be included in equals(...) and hashCode() evaluation

Parameters:
identifiers -


Copyright © 2007-2013. All Rights Reserved.