All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anoprise.cache.Cache Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.0
Show newest version
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