net.anotheria.anoprise.cache.CachedObjectWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ano-prise Show documentation
Show all versions of ano-prise Show documentation
Collection of utils for different enterprise class projects. Among other stuff contains
Caches, Mocking, DualCrud, MetaFactory and SessionDistributorService. Visit https://opensource.anotheria.net for details.
package net.anotheria.anoprise.cache;
/**
* Wrapper object. This object is used for expiration caches to add the timestamp of the object creation.
* @author lrosenberg
* @param a cacheable that we wrap.
*/
public class CachedObjectWrapper {
/**
* The wrapped object.
*/
private T obj;
/**
* Timestamp of wrapper creation.
*/
private long timestamp;
public CachedObjectWrapper(T anObject){
obj = anObject;
timestamp = System.currentTimeMillis();
}
/**
* Returns the underlying object.
* @return
*/
public T getObj() {
return obj;
}
public void setObj(T anObj) {
obj = anObj;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy