Class GenericMapCacheDelegate<K,V>
java.lang.Object
io.github.xanthic.cache.core.delegate.GenericMapCacheDelegate<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>
public class GenericMapCacheDelegate<K,V>
extends java.lang.Object
implements io.github.xanthic.cache.api.Cache<K,V>
Delegates cache calls to a
Map view that already conforms to a desired ICacheSpec.
This class should only be used when implementing a CacheProvider, which yields a Map view.
-
Constructor Summary
Constructors Constructor Description GenericMapCacheDelegate(java.util.Map<K,V> map) -
Method Summary
Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)voidclear()Vcompute(K key, @NotNull java.util.function.BiFunction<? super K,? super V,? extends V> computeFunc)VcomputeIfAbsent(K key, @NotNull java.util.function.Function<K,V> computeFunc)VcomputeIfPresent(K key, @NotNull java.util.function.BiFunction<? super K,? super V,? extends V> computeFunc)booleanequals(java.lang.Object o)Vget(K key)java.util.Map<K,V>getMap()inthashCode()Vmerge(K key, V value, @NotNull java.util.function.BiFunction<V,V,V> mergeFunc)Vput(K key, V value)voidputAll(@NotNull java.util.Map<? extends K,? extends V> map)VputIfAbsent(K key, V value)Vremove(K key)booleanreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)longsize()java.lang.StringtoString()
-
Constructor Details
-
Method Details
-
get
-
put
-
compute
-
computeIfAbsent
-
computeIfPresent
-
remove
-
clear
public void clear() -
size
public long size() -
putIfAbsent
-
merge
-
replace
-
replace
-
putAll
-
getMap
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other) -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-