public class CachesKt
@Nullable
public static <T> T getOrCache(@NotNull
org.litote.kmongo.Id<T> id,
@NotNull
java.lang.String type,
@NotNull
kotlin.jvm.functions.Function0<? extends 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.
valueProvider,
valueProvider@Nullable
public static <T> T getFromCache(@NotNull
org.litote.kmongo.Id<T> id,
@NotNull
java.lang.String type)
Returns the value for specified id and type. If no value exists, null is returned.
public static <T> void putInCache(@NotNull
org.litote.kmongo.Id<T> id,
@NotNull
java.lang.String type,
@NotNull
T value)
Adds in cache the specified value.
public static <T> void removeFromCache(@NotNull
org.litote.kmongo.Id<T> id,
@NotNull
java.lang.String type)
Remove the value for specified id and type from cache.
@NotNull
public static <T> java.util.Map<org.litote.kmongo.Id,java.lang.Object> getCachedValuesForType(@NotNull
java.lang.String type)
Returns all cached value for specified type.