Package io.github.xanthic.cache.core
Class AbstractCache<K,V>
java.lang.Object
io.github.xanthic.cache.core.AbstractCache<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 AbstractCache<K,V>
extends Object
implements io.github.xanthic.cache.api.Cache<K,V>
Deprecated.
no longer used by Xanthic; synchronization generally should be avoided
Provides a common implementation of:
Cache.computeIfAbsent(Object, Function)Cache.putIfAbsent(Object, Object)Cache.merge(Object, Object, BiFunction)
Subclasses ought to synchronize on getLock() for correctness.
Avoid this abstraction if the backing cache provider already provides an implementation for these methods.
Does not support null values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.computeIfAbsent(K key, @NotNull Function<K, V> computeFunc) Deprecated.computeIfPresent(K key, @NotNull BiFunction<? super K, ? super V, ? extends V> computeFunc) Deprecated.protected @NotNull ObjectgetLock()Deprecated.Deprecated.putIfAbsent(K key, V value) Deprecated.booleanDeprecated.booleanDeprecated.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
clear, forEach, get, getOrDefault, put, putAll, remove, size
-
Constructor Details
-
AbstractCache
public AbstractCache()Deprecated.
-
-
Method Details
-
computeIfAbsent
Deprecated. -
compute
@Nullable public V compute(@NotNull K key, @NotNull @NotNull BiFunction<? super K, ? super V, ? extends V> computeFunc) 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. -
getLock
Deprecated.
-