javastrava.cache.StravaCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javastrava-api Show documentation
Show all versions of javastrava-api Show documentation
Java implementation of the Strava API
package javastrava.cache;
import java.util.List;
/**
*
* The caching mechanism caches data temporarily in memory
*
*
*
* Data is cached per unique token and cannot be read by a session with an access token different to the one that stored data
*
*
* @author Dan Shannon
*
* @param Class of object to be stored in cache
* @param Class of object's id
*/
public interface StravaCache, U> {
/**
*
* Retrieves the object from the cache.
*
*
* @param key The key
* @return the object, or null
if not in cache
*/
public T get(U key);
/**
*
* Returns a list of the objects in the cache
*
* @return List of the objects in the cache
*/
public List list();
/**
*
* Stores the given object in the cache
*
*
* @param object Object
*/
public void put(T object);
/**
*
* Puts all the contents of the list in the cache
*
* @param list List of objects to be stored in cache
*/
public void putAll(List list);
/**
*
* Removes the object identified by the key from the cache
*
*
* @param key The key of the object to be removed
*/
public void remove(U key);
/**
*
* Removes all elements from the cache that are associated with the token
*
*/
public void removeAll();
/**
*
* Returns the number of objects in the cache
*
* @return Number of objects in the cache
*/
public int size();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy