Interface VavrCache


public interface VavrCache
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    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.
    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 key
      R - the type of value
      Parameters:
      cache - the Cache
      supplier - 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 key
      R - the type of value
      Parameters:
      cache - the Cache
      callable - the original Callable
      Returns:
      a supplier which is secured by a CircuitBreaker.