Package com.inrupt.client.caffeine
Class CaffeineCacheBuilder
java.lang.Object
com.inrupt.client.caffeine.CaffeineCacheBuilder
- All Implemented Interfaces:
CacheBuilderService
A
CacheBuilderService
using a Caffeine-based cache.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T,
U> ClientCache<T, U> Build a cache.static <T,
U> ClientCache<T, U> ofCache
(com.github.benmanes.caffeine.cache.Cache<T, U> cache) Create aClientCache
directly from an existing CaffeineCache
.
-
Constructor Details
-
CaffeineCacheBuilder
public CaffeineCacheBuilder()
-
-
Method Details
-
build
Description copied from interface:CacheBuilderService
Build a cache.- Specified by:
build
in interfaceCacheBuilderService
- Type Parameters:
T
- the key typeU
- the value type- Parameters:
maximumSize
- the maximum cache sizeduration
- the duration after which items should expire from the cache- Returns:
- the cache
-
ofCache
Create aClientCache
directly from an existing CaffeineCache
.- Type Parameters:
T
- the key typeU
- the value type- Parameters:
cache
- the pre-built cache- Returns:
- a cache suitable for use in the Inrupt Client libraries
-