Package io.github.xanthic.cache.core
Class LockedAbstractCache<K,V>
java.lang.Object
io.github.xanthic.cache.core.LockedAbstractCache<K,V>
- Type Parameters:
K- The type of keys that form the cacheV- The type of values contained in the cache
- All Implemented Interfaces:
io.github.xanthic.cache.api.Cache<K,V>
@Deprecated
public abstract class LockedAbstractCache<K,V>
extends Object
implements io.github.xanthic.cache.api.Cache<K,V>
Deprecated.
no longer used by Xanthic to implement any canonical cache provider
Safely implements
Cache methods using ReadWriteLock.
This abstraction allows for underlying cache providers to implement
the Cache interface in a thread-safe manner, even if the
underlying cache does not already implement the more "exotic"
write methods required by the Cache contract.
As this abstraction has a performance hit, it should be avoided if the backing cache provider already provides an implementation for these methods.
Does not support null values.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated.protected abstract voidDeprecated.Deprecated.computeIfAbsent(K key, @NotNull Function<K, V> computeFunc) Deprecated.computeIfPresent(K key, @NotNull BiFunction<? super K, ? super V, ? extends V> computeFunc) Deprecated.Deprecated.protected abstract VgetUnlocked(K key) Deprecated.Deprecated.Deprecated.voidDeprecated.putIfAbsent(K key, V value) Deprecated.protected abstract voidputUnlocked(K key, V value) Deprecated.protected <T> TDeprecated.Deprecated.protected abstract voidremoveUnlocked(K key) Deprecated.booleanDeprecated.booleanDeprecated.longsize()Deprecated.protected abstract longDeprecated.protected <T> TDeprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.xanthic.cache.api.Cache
forEach, getOrDefault
-
Field Details
-
lock
Deprecated.
-
-
Constructor Details
-
LockedAbstractCache
public LockedAbstractCache()Deprecated.
-
-
Method Details
-
get
Deprecated. -
put
Deprecated. -
remove
Deprecated. -
clear
public void clear()Deprecated. -
size
public long size()Deprecated. -
compute
public V compute(@NotNull K key, @NotNull @NotNull BiFunction<? super K, ? super V, ? extends V> computeFunc) Deprecated. -
computeIfAbsent
Deprecated. -
computeIfPresent
public V computeIfPresent(@NotNull K key, @NotNull @NotNull BiFunction<? super K, ? super V, ? extends V> computeFunc) Deprecated. -
putIfAbsent
Deprecated. -
merge
Deprecated. -
replace
Deprecated. -
replace
Deprecated. -
putAll
Deprecated. -
getUnlocked
Deprecated. -
putUnlocked
Deprecated. -
removeUnlocked
Deprecated. -
clearUnlocked
protected abstract void clearUnlocked()Deprecated. -
sizeUnlocked
protected abstract long sizeUnlocked()Deprecated. -
read
Deprecated. -
write
Deprecated.
-