Package io.github.resilience4j.cache
Interface VavrCache
public interface VavrCache
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <K,R> io.vavr.CheckedFunction1<K, R> decorateCallable(io.github.resilience4j.cache.Cache<K, R> cache, Callable<R> callable) Creates a functions which returns a value from a cache, if it exists.static <K,R> io.vavr.CheckedFunction1<K, R> decorateCheckedSupplier(io.github.resilience4j.cache.Cache<K, R> cache, io.vavr.CheckedFunction0<R> supplier) Creates a functions which returns a value from a cache, if it exists.
-
Method Details
-
decorateCheckedSupplier
static <K,R> io.vavr.CheckedFunction1<K,R> decorateCheckedSupplier(io.github.resilience4j.cache.Cache<K, R> cache, io.vavr.CheckedFunction0<R> supplier) Creates a functions which returns a value from a cache, if it exists. Otherwise it calls the Supplier.- Type Parameters:
K- the type of keyR- the type of value- Parameters:
cache- the Cachesupplier- the original Supplier- Returns:
- a supplier which is secured by a CircuitBreaker.
-
decorateCallable
static <K,R> io.vavr.CheckedFunction1<K,R> decorateCallable(io.github.resilience4j.cache.Cache<K, R> cache, Callable<R> callable) Creates a functions which returns a value from a cache, if it exists. Otherwise it calls the Callable.- Type Parameters:
K- the type of keyR- the type of value- Parameters:
cache- the Cachecallable- the original Callable- Returns:
- a supplier which is secured by a CircuitBreaker.
-