|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The Class used as an id for the cacheable objects. Has to be identical to the Class used by the corresponding
Cache
.public interface Cacheable<T>
Interface to manage the life cycle of objects in combination with a Cache
. All objects which are to be added
to a Cache
must implement this interface.
The object's id
is used to discern different entities internally, therefore it is vital for the correct
functioning of the Cache
that every distinct Cacheable
has a unique id.
Method Summary | |
---|---|
T |
getId()
|
void |
merge(Cacheable<T> object)
Merges (replace values of this with values of object ) the values of two Cacheable
objects if possible. |
void |
setId(T id)
Sets the id of this object. |
Methods inherited from interface org.clazzes.util.lifecycle.ObjectCreatable |
---|
setObjectFactory |
Method Detail |
---|
void setId(T id)
id
of this object.
id
- The id to set.T getId()
id
of this object.void merge(Cacheable<T> object) throws java.lang.UnsupportedOperationException
this
with values of object
) the values of two Cacheable
objects if possible. Throws an UnsupportedOperationException
if the objects can not be merged (e.g. are not
of the same class).Cacheable
is added to a Cache
in which another Cacheable
with the same id is already present.
object
- the object with which the current instance will be merged.
java.lang.UnsupportedOperationException
- if the current instance can not be merged with the given object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |