Constructor and Description |
---|
AbstractMapBasedSyncCache(ConversionService<?> conversionService,
C nativeCache) |
Modifier and Type | Method and Description |
---|---|
<T> Optional<T> |
get(Object key,
Argument<T> requiredType)
Resolve the given value for the given key.
|
<T> T |
get(Object key,
Argument<T> requiredType,
Supplier<T> supplier)
Resolve the given value for the given key.
|
ConversionService<?> |
getConversionService() |
abstract String |
getName() |
C |
getNativeCache() |
void |
invalidate(Object key)
Invalidate the value for the given key.
|
void |
invalidateAll()
Invalidate all cached values within this cache.
|
void |
put(Object key,
Object value)
Cache the specified value using the specified key.
|
<T> T |
putIfAbsent(Object key,
Supplier<T> value)
Cache the supplied value using the specified key if it is not already present.
|
<T> Optional<T> |
putIfAbsent(Object key,
T value)
Cache the specified value using the specified key if it is not already present.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
async, get, get, getExecutorService
getCacheInfo
public AbstractMapBasedSyncCache(ConversionService<?> conversionService, C nativeCache)
conversionService
- the conversion servicenativeCache
- the native cachepublic ConversionService<?> getConversionService()
@Nonnull public <T> Optional<T> get(@Nonnull Object key, @Nonnull Argument<T> requiredType)
SyncCache
public <T> T get(@Nonnull Object key, @Nonnull Argument<T> requiredType, @Nonnull Supplier<T> supplier)
SyncCache
Supplier
will
be invoked and the return value cached.get
in interface SyncCache<C extends Map<Object,Object>>
T
- The concrete typekey
- The cache keyrequiredType
- The required typesupplier
- The supplier that should be invoked if the value is not found@Nonnull public <T> Optional<T> putIfAbsent(@Nonnull Object key, @Nonnull T value)
SyncCache
Cache the specified value using the specified key if it is not already present.
putIfAbsent
in interface SyncCache<C extends Map<Object,Object>>
T
- The concrete typekey
- the key with which the specified value is to be associatedvalue
- the value to be associated with the specified keyOptional.empty()
if the specified value parameter was cached@Nonnull public <T> T putIfAbsent(@Nonnull Object key, @Nonnull Supplier<T> value)
SyncCache
Cache the supplied value using the specified key if it is not already present.
putIfAbsent
in interface SyncCache<C extends Map<Object,Object>>
T
- The concrete typekey
- the key with which the specified value is to be associatedvalue
- the value supplier to be associated with the specified keypublic void put(@Nonnull Object key, @Nonnull Object value)
SyncCache
Cache the specified value using the specified key.
public void invalidate(@Nonnull Object key)
SyncCache
public void invalidateAll()
SyncCache
public abstract String getName()