Record Class CaffeineCacheMapper<K,R,V>
java.lang.Object
java.lang.Record
org.infinispan.container.impl.CaffeineCacheMapper<K,R,V>
- Type Parameters:
K- The original cache key typeR- The mapped typeV- The value type of the Caffeine cache which is unchanged- Record Components:
delegate- The actual Caffeine cache to map the key to and fromkeyMapper- the way to map the key to a different typekeyUnmapper- the way to unmap the different type to the cache key type
- All Implemented Interfaces:
com.github.benmanes.caffeine.cache.Cache<R,V>
public record CaffeineCacheMapper<K,R,V> (com.github.benmanes.caffeine.cache.Cache<K,V> delegate, InjectiveFunction<? super K, ? extends R> keyMapper, InjectiveFunction<? super R, ? extends K> keyUnmapper)
extends Record
implements com.github.benmanes.caffeine.cache.Cache<R,V>
Mapper class that can be used with caffeine based caches to map a key to a different key as necessary. Note this class
does not implement mapping for all optional classes provided from caffeine and is thus why it is in an impl package
of core and not in the commons module like
KeyMapperMap which does.-
Constructor Summary
ConstructorsConstructorDescriptionCaffeineCacheMapper(com.github.benmanes.caffeine.cache.Cache<K, V> delegate, InjectiveFunction<? super K, ? extends R> keyMapper, InjectiveFunction<? super R, ? extends K> keyUnmapper) Creates an instance of aCaffeineCacheMapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionConcurrentMap<R, @NonNull V> asMap()voidcleanUp()delegate()Returns the value of thedelegaterecord component.final booleanIndicates whether some other object is "equal to" this one.longgetAll(Iterable<? extends R> keys, Function<? super Set<? extends R>, ? extends Map<? extends R, ? extends @NonNull V>> mappingFunction) getAllPresent(Iterable<? extends R> keys) @Nullable VgetIfPresent(Object key) final inthashCode()Returns a hash code value for this object.voidinvalidate(Object key) voidvoidinvalidateAll(Iterable<? extends R> keys) InjectiveFunction<? super K, ? extends R> Returns the value of thekeyMapperrecord component.InjectiveFunction<? super R, ? extends K> Returns the value of thekeyUnmapperrecord component.policy()voidvoidcom.github.benmanes.caffeine.cache.stats.CacheStatsstats()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CaffeineCacheMapper
public CaffeineCacheMapper(com.github.benmanes.caffeine.cache.Cache<K, V> delegate, InjectiveFunction<? super K, ? extends R> keyMapper, InjectiveFunction<? super R, ? extends K> keyUnmapper) Creates an instance of aCaffeineCacheMapperrecord class.- Parameters:
delegate- the value for thedelegaterecord componentkeyMapper- the value for thekeyMapperrecord componentkeyUnmapper- the value for thekeyUnmapperrecord component
-
-
Method Details
-
getIfPresent
-
get
-
getAllPresent
-
getAll
-
put
-
putAll
-
invalidateAll
-
invalidate
-
invalidateAll
-
estimatedSize
-
stats
-
cleanUp
-
policy
-
asMap
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
delegate
-
keyMapper
-
keyUnmapper
Returns the value of thekeyUnmapperrecord component.- Returns:
- the value of the
keyUnmapperrecord component
-