net.anotheria.anoprise.cache.Cache 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;
import net.anotheria.moskito.core.predefined.CacheStats;
/**
* An interface for the service side object cache.
*/
public interface Cache {
/**
* Returns the object for the given id from cache, null if no object is in cache.
* @param id the id to retrieve
* @return
*/
V get(K id);
/**
* Puts the cacheable object in cache.
* @param id the object id
* @param cacheable the object to cache.
*/
void put(K id, V cacheable);
/**
* Removes an object from the cache.
* @param id cache object id.
*/
void remove(K id);
/**
* Clears the cache.
*
*/
void clear();
/**
* Returns the cache stats.
* @return
*/
CacheStats getCacheStats();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy