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 givenCallableinto a function that ignores the given parameter.static <K,V> Function<K, V> wrapSupplierAsFunction(Supplier<V> supplier) Wraps the givenSupplierinto a function that ignores the given parameter.
-
Method Details
-
wrapCallableAsFunction
Wraps the givenCallableinto a function that ignores the given parameter.Every
Exceptionthrown by theCallablewill be wrapped in aCacheRuntimeExceptionso that the returnedFunctiondoes not throw any checkedExceptions.- Type Parameters:
K- The type of the ignored key.V- The type of the value returned by theCallableandFunction.- Parameters:
callable- TheCallableto wrap.- Returns:
- A
Functionexecuting the givenCallablewithout looking at the parameter.
-
wrapSupplierAsFunction
Wraps the givenSupplierinto a function that ignores the given parameter.- Type Parameters:
K- The type of the ignored key.V- The type of the value returned by theSupplierandFunction.- Parameters:
supplier- TheSupplierto wrap.- Returns:
- A
Functionexecuting the givenSupplierwithout looking at the parameter.
-