Class DefaultCache
java.lang.Object
io.fluxcapacitor.javaclient.persisting.caching.DefaultCache
- All Implemented Interfaces:
Cache,AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCache(int maxSize) DefaultCache(int maxSize, Executor evictionNotifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclose()<T> Tcompute(Object id, BiFunction<? super Object, ? super T, ? extends T> mappingFunction) <T> TcomputeIfAbsent(Object id, Function<? super Object, T> mappingFunction) <T> TcomputeIfPresent(Object id, BiFunction<? super Object, ? super T, ? extends T> mappingFunction) booleancontainsKey(Object id) <T> Tprotected voidnotifyEvictionListeners(Object id, io.fluxcapacitor.javaclient.persisting.caching.CacheEvictionEvent.Reason reason) protected voidputIfAbsent(Object id, Object value) registerEvictionListener(Consumer<CacheEvictionEvent> listener) <T> Tintsize()protected <T> Tprotected DefaultCache.CacheReferenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxcapacitor.javaclient.persisting.caching.Cache
getOrDefault, isEmpty
-
Field Details
-
mutexPrecursor
- See Also:
-
-
Constructor Details
-
DefaultCache
public DefaultCache() -
DefaultCache
public DefaultCache(int maxSize) -
DefaultCache
-
-
Method Details
-
compute
-
put
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceCache
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceCache
-
computeIfPresent
public <T> T computeIfPresent(Object id, BiFunction<? super Object, ? super T, ? extends T> mappingFunction) - Specified by:
computeIfPresentin interfaceCache
-
remove
-
get
-
containsKey
- Specified by:
containsKeyin interfaceCache
-
clear
public void clear() -
size
public int size() -
registerEvictionListener
- Specified by:
registerEvictionListenerin interfaceCache
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCache
-
wrap
-
unwrap
-
pollReferenceQueue
protected void pollReferenceQueue() -
notifyEvictionListeners
protected void notifyEvictionListeners(Object id, io.fluxcapacitor.javaclient.persisting.caching.CacheEvictionEvent.Reason reason)
-