| 构造器和说明 |
|---|
AbstractCache() |
| 限定符和类型 | 方法和说明 |
|---|---|
V |
computeIfAbsent(K key,
Function<K,V> loader,
boolean cacheNullWhenLoaderReturnNull)
If there is a value associated with the key, return the value;
otherwise use the loader load the value and return, and then update the cache.
|
V |
computeIfAbsent(K key,
Function<K,V> loader,
boolean cacheNullWhenLoaderReturnNull,
long expireAfterWrite,
TimeUnit timeUnit)
If there is a value associated with the key, return the value;
otherwise use the loader load the value and return, and then update the cache.
|
MultiGetResult<K,V> |
GET_ALL(Set<? extends K> keys)
Gets a collection of entries from the Cache.
|
CacheGetResult<V> |
GET(K key)
Gets an entry from the cache.
|
void |
notify(CacheEvent e) |
CacheResult |
PUT_ALL(Map<? extends K,? extends V> map,
long expireAfterWrite,
TimeUnit timeUnit)
Copies all of the entries from the specified map to the cache.
|
CacheResult |
PUT_IF_ABSENT(K key,
V value,
long expireAfterWrite,
TimeUnit timeUnit)
If the specified key is not already associated with a value, associate it with the given value.
|
CacheResult |
PUT(K key,
V value,
long expireAfterWrite,
TimeUnit timeUnit)
Associates the specified value with the specified key in the cache.
|
CacheResult |
REMOVE_ALL(Set<? extends K> keys)
Removes entries for the specified keys.
|
CacheResult |
REMOVE(K key)
Removes the mapping for a key from this cache if it is present.
|
public void notify(CacheEvent e)
public final CacheGetResult<V> GET(K key)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage()/getValue() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
public final MultiGetResult<K,V> GET_ALL(Set<? extends K> keys)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage()/getValue() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
public final V computeIfAbsent(K key, Function<K,V> loader, boolean cacheNullWhenLoaderReturnNull)
CachecomputeIfAbsent 在接口中 Cache<K,V>key - the keyloader - the value loadercacheNullWhenLoaderReturnNull - true if null value returned by loader should put into cache use the keypublic final V computeIfAbsent(K key, Function<K,V> loader, boolean cacheNullWhenLoaderReturnNull, long expireAfterWrite, TimeUnit timeUnit)
CachecomputeIfAbsent 在接口中 Cache<K,V>key - the keyloader - the value loadercacheNullWhenLoaderReturnNull - true if null value returned by loader should put into cache use the keyexpireAfterWrite - the TTL(time to live) of the KV associationtimeUnit - the time unit of expireAfterWritepublic final CacheResult PUT(K key, V value, long expireAfterWrite, TimeUnit timeUnit)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
public final CacheResult PUT_ALL(Map<? extends K,? extends V> map, long expireAfterWrite, TimeUnit timeUnit)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
public final CacheResult REMOVE(K key)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
public final CacheResult REMOVE_ALL(Set<? extends K> keys)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
REMOVE_ALL 在接口中 Cache<K,V>keys - the keys to removepublic final CacheResult PUT_IF_ABSENT(K key, V value, long expireAfterWrite, TimeUnit timeUnit)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
PUT_IF_ABSENT 在接口中 Cache<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyexpireAfterWrite - the TTL(time to live) of the KV associationtimeUnit - the time unit of expireAfterWriteCopyright © 2013–2019. All rights reserved.