se.citerus.dddsample.domain.shared.experimental
Class EntitySupport<T extends Entity,ID>

java.lang.Object
  extended by se.citerus.dddsample.domain.shared.experimental.EntitySupport<T,ID>
All Implemented Interfaces:
Entity<T,ID>

public abstract class EntitySupport<T extends Entity,ID>
extends java.lang.Object
implements Entity<T,ID>

Base class for entities.


Constructor Summary
EntitySupport()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 ID identity()
          Entities have an identity.
 boolean sameIdentityAs(T other)
          Entities compare by identity, not by attributes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntitySupport

public EntitySupport()
Method Detail

sameIdentityAs

public final boolean sameIdentityAs(T other)
Description copied from interface: Entity
Entities compare by identity, not by attributes.

Specified by:
sameIdentityAs in interface Entity<T extends Entity,ID>
Parameters:
other - The other entity.
Returns:
true if the identities are the same, regardles of other attributes.

identity

public final ID identity()
Description copied from interface: Entity
Entities have an identity.

Specified by:
identity in interface Entity<T extends Entity,ID>
Returns:
The identity of this entity.

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2009. All Rights Reserved.