Package 

Class CachesKt

    • Method Summary

      Modifier and Type Method Description
      final <T extends Any> T getOrCache(Id<T> id, String type, Function0<T> valueProvider) Returns the value for specified id and type.
      final <T extends Any> T getFromCache(Id<T> id, String type) Returns the value for specified id and type.
      final <T extends Any> Unit putInCache(Id<T> id, String type, T value) Adds in cache the specified value.
      final <T extends Any> Unit removeFromCache(Id<T> id, String type) Remove the value for specified id and type from cache.
      final <T extends Any> Map<Id<T>, Object> getCachedValuesForType(String type) Returns all cached value for specified type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getOrCache

         final <T extends Any> T getOrCache(Id<T> id, String type, Function0<T> valueProvider)

        Returns the value for specified id and type. If no value exists, valueProvider provides the value to cache. If valueProvider throws exception or returns null, no value is cached and null is returned.

      • getFromCache

         final <T extends Any> T getFromCache(Id<T> id, String type)

        Returns the value for specified id and type. If no value exists, null is returned.