Class DefaultCache
java.lang.Object
io.fluxcapacitor.javaclient.persisting.caching.DefaultCache
- All Implemented Interfaces:
Cache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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) <T> TgetIfPresent(Object id) voidinvalidate(Object id) voidputIfAbsent(Object id, @NonNull Object value) intsize()Methods 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
-
Constructor Details
-
DefaultCache
public DefaultCache() -
DefaultCache
public DefaultCache(int maxSize)
-
-
Method Details
-
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
-
compute
-
getIfPresent
- Specified by:
getIfPresentin interfaceCache
-
invalidate
- Specified by:
invalidatein interfaceCache
-
invalidateAll
public void invalidateAll()- Specified by:
invalidateAllin interfaceCache
-
size
public int size()
-