org.thymeleaf.cache
Interface ICache<K,V>

Type Parameters:
K - the type of the cache keys
V - the type of the cache values
All Known Implementing Classes:
StandardCache

public interface ICache<K,V>

Common interface for all the cache objects used by the template engine.

This is the interface that must be implemented by all cache objects managed by ICacheManager implementations.

Since:
2.0.0
Author:
Daniel Fernández

Method Summary
 void clear()
           Clear the entire cache.
 void clearKey(K key)
           Clears a specific entry in the cache.
 V get(K key)
           Retrieve a value from the cache.
 V get(K key, ICacheEntryValidityChecker<? super K,? super V> validityChecker)
           Retrieve a value from the cache, using the specified validity checker to ensure the entry is still valid.
 void put(K key, V value)
           Insert a new value into the cache.
 

Method Detail

put

void put(K key,
         V value)

Insert a new value into the cache.

Parameters:
key - the key of the new entry
value - the value to be cached

get

V get(K key)

Retrieve a value from the cache.

Parameters:
key - the key of the value to be retrieved
Returns:
the retrieved value, or null if no value exists for the specified key.

get

V get(K key,
      ICacheEntryValidityChecker<? super K,? super V> validityChecker)

Retrieve a value from the cache, using the specified validity checker to ensure the entry is still valid. If the cache already has a default validity checker, this method should override this setting and use the one specified instead.

Parameters:
key - the key of the value to be retrieved
validityChecker - the validity checker to be used to ensure the entry is still valid.
Returns:
the retrieved value, or null if no value exists for the specified key.

clear

void clear()

Clear the entire cache.


clearKey

void clearKey(K key)

Clears a specific entry in the cache.

Parameters:
key - the key of the entry to be cleared.


Copyright © 2012 The THYMELEAF team. All Rights Reserved.