Class CacheUtil
java.lang.Object
com.sap.cloud.sdk.cloudplatform.cache.CacheUtil
Util class containing helper methods to work with caches.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> Function<K, V> wrapCallableAsFunction
(Callable<V> callable) Wraps the givenCallable
into a function that ignores the given parameter.static <K,
V> Function<K, V> wrapSupplierAsFunction
(Supplier<V> supplier) Wraps the givenSupplier
into a function that ignores the given parameter.
-
Method Details
-
wrapCallableAsFunction
Wraps the givenCallable
into a function that ignores the given parameter.Every
Exception
thrown by theCallable
will be wrapped in aCacheRuntimeException
so that the returnedFunction
does not throw any checkedExceptions
.- Type Parameters:
K
- The type of the ignored key.V
- The type of the value returned by theCallable
andFunction
.- Parameters:
callable
- TheCallable
to wrap.- Returns:
- A
Function
executing the givenCallable
without looking at the parameter.
-
wrapSupplierAsFunction
Wraps the givenSupplier
into a function that ignores the given parameter.- Type Parameters:
K
- The type of the ignored key.V
- The type of the value returned by theSupplier
andFunction
.- Parameters:
supplier
- TheSupplier
to wrap.- Returns:
- A
Function
executing the givenSupplier
without looking at the parameter.
-