Class WeakIdentifiedCache
java.lang.Object
org.qubership.atp.dataset.db.utils.WeakIdentifiedCache
- All Implemented Interfaces:
IdentifiedCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()<T extends Identified>
TcomputeIfAbsent(Class<T> type, UUID id, Function<UUID, ? extends T> sourceFunc) Returns value if it is already present in the cache.<T extends Identified>
TgetIfPresent(Class<T> type, UUID id) <T extends Identified>
voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.qubership.atp.dataset.db.IdentifiedCache
tryComputeIfAbsent
-
Constructor Details
-
WeakIdentifiedCache
public WeakIdentifiedCache()
-
-
Method Details
-
computeIfAbsent
@Nonnull public <T extends Identified> T computeIfAbsent(@Nonnull Class<T> type, @Nonnull UUID id, @Nonnull Function<UUID, ? extends T> sourceFunc) Description copied from interface:IdentifiedCacheReturns value if it is already present in the cache. Invokes function otherwise. Function should not return null. Caches new provided value.- Specified by:
computeIfAbsentin interfaceIdentifiedCache
-
getIfPresent
- Specified by:
getIfPresentin interfaceIdentifiedCache
-
put
- Specified by:
putin interfaceIdentifiedCache
-
clear
public void clear()- Specified by:
clearin interfaceIdentifiedCache
-