Package org.trellisldp.cache
Class TrellisCache<K,V>
- java.lang.Object
-
- org.trellisldp.cache.TrellisCache<K,V>
-
- Type Parameters:
K
- the key typeV
- the value type
- All Implemented Interfaces:
CacheService<K,V>
public class TrellisCache<K,V> extends Object implements CacheService<K,V>
A simple Guava-based cache service.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.trellisldp.api.CacheService
CacheService.TrellisProfileCache
-
-
Constructor Summary
Constructors Constructor Description TrellisCache(com.google.common.cache.Cache<K,V> cache)
Create a Trellis cache.
-
-
-
Method Detail
-
get
public V get(K key, Function<K,V> mapper)
Description copied from interface:CacheService
Get a value from the cache.- Specified by:
get
in interfaceCacheService<K,V>
- Parameters:
key
- the keymapper
- attempts to compute a mapping for the specified key- Returns:
- a value for that key, never
null
-
-