org.onebusaway.container.model
Class IdentityBean<T extends Serializable>

java.lang.Object
  extended by org.onebusaway.container.model.IdentityBean<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Place, StopSequence, StopSequenceCollection, User

public abstract class IdentityBean<T extends Serializable>
extends Object
implements Serializable

Convenience base class for objects that have an id property and whose object equality is determined by that identi Defines abstract methods for getting and setting the objects id while also define equals(Object) and hashCode() based on the id value. Additionally, defines a CacheableKey key strategy based on the object id when the object is used in as an argument in a method annotated with Cacheable.

Author:
bdferris
See Also:
Serialized Form

Constructor Summary
IdentityBean()
           
 
Method Summary
 boolean equals(Object obj)
          Object
abstract  T getId()
           
 int hashCode()
           
abstract  void setId(T id)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityBean

public IdentityBean()
Method Detail

getId

public abstract T getId()

setId

public abstract void setId(T id)

equals

public boolean equals(Object obj)
Object

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011 OneBusAway. All Rights Reserved.