@@ -0,0 +1,1014 @@
+package io.domisum.lib.auxiliumlib.contracts.iosource.impl;%0A%0Aimport io.domisum.lib.auxiliumlib.contracts.iosource.IoSource;%0Aimport io.domisum.lib.auxiliumlib.datastructures.ExpirationSettings;%0Aimport io.domisum.lib.auxiliumlib.datastructures.LazyCache;%0Aimport lombok.RequiredArgsConstructor;%0A%0Aimport java.io.IOException;%0A%0A@RequiredArgsConstructor%0Apublic abstract class IoSource_CacheInMemory%3CKeyT, T%3E%0A%09implements IoSource%3CKeyT, T%3E%0A%7B%0A%09%0A%09// DEPENDENCIES%0A%09private final IoSource%3CKeyT, T%3E backingSource;%0A%09%0A%09// CACHE%0A%09private final LazyCache%3CKeyT, T%3E cache = LazyCache.of(EXPIRATION_SETTINGS());%0A%09%0A%09%0A%09// CONSTANT METHODS%0A%09protected abstract ExpirationSettings EXPIRATION_SETTINGS();%0A%09%0A%09%0A%09// SOURCE%0A%09@Override%0A%09public T get(KeyT key)%0A%09%09throws IOException%0A%09%7B%0A%09%09var itemFromCacheOptional = cache.get(key);%0A%09%09if(itemFromCacheOptional.isPresent())%0A%09%09%09return itemFromCacheOptional.get();%0A%09%09%0A%09%09var itemFromBackingSource = backingSource.get(key);%0A%09%09cache.put(key, itemFromBackingSource);%0A%09%09return itemFromBackingSource;%0A%09%7D%0A%09%0A%7D%0A

Create IoSource_CacheInMemory