Package org.qubership.atp.dataset.db
Interface IdentifiedCache
- All Known Implementing Classes:
CacheRepository,DataSetListTreeRepository.ToLoadLater,IdentifiedCacheDelegate,StrongIdentifiedCache,WeakIdentifiedCache
public interface IdentifiedCache
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()default <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>
voiddefault <T extends Identified>
TtryComputeIfAbsent(Class<T> type, UUID id, Function<UUID, ? extends T> sourceFunc) Returns value if it is already present in the cache.
-
Method Details
-
computeIfAbsent
@Nonnull default <T extends Identified> T computeIfAbsent(@Nonnull Class<T> type, @Nonnull UUID id, @Nonnull Function<UUID, ? extends T> sourceFunc) Returns value if it is already present in the cache. Invokes function otherwise. Function should not return null. Caches new provided value. -
tryComputeIfAbsent
@Nullable default <T extends Identified> T tryComputeIfAbsent(@Nonnull Class<T> type, @Nonnull UUID id, @Nonnull Function<UUID, ? extends T> sourceFunc) Returns value if it is already present in the cache. Invokes function otherwise. Function may return null. Caches new provided value (if it is not null). -
getIfPresent
-
put
-
clear
void clear()
-