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
@ScheduledForRemoval(inVersion="1.0.0")
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 TypeMethodDescriptionvoid
clear()
Deprecated.protected abstract void
Deprecated.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 V
getUnlocked
(K key) Deprecated.Deprecated.Deprecated.void
Deprecated.putIfAbsent
(K key, V value) Deprecated.protected abstract void
putUnlocked
(K key, V value) Deprecated.protected <T> T
Deprecated.Deprecated.protected abstract void
removeUnlocked
(K key) Deprecated.boolean
Deprecated.boolean
Deprecated.long
size()
Deprecated.protected abstract long
Deprecated.protected <T> T
Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.
-