public class SingletonMap<K,V> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SingletonMap.Builder<K,V> |
| Constructor and Description |
|---|
SingletonMap(SingletonMap.Builder<K,V> builder) |
SingletonMap(SingletonMap.Builder<K,V> builder,
long maxAge) |
SingletonMap(SingletonMap.Builder<K,V> builder,
long maxAge,
ScheduledExecutorService scheduledExecutorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
Set<Map.Entry<K,V>> |
entrySet() |
<C extends Collection<V>> |
fill(C collection,
Collection<K> keys) |
V |
get(K key) |
V |
getInstance(K key)
Deprecated.
|
protected K |
getNullKeyOnce() |
Set<K> |
keySet() |
V |
remove(K key) |
Collection<V> |
values() |
public SingletonMap(SingletonMap.Builder<K,V> builder)
public SingletonMap(SingletonMap.Builder<K,V> builder, long maxAge)
builder - buildermaxAge - map内对象的最大存在时长,单位为毫秒public SingletonMap(SingletonMap.Builder<K,V> builder, long maxAge, ScheduledExecutorService scheduledExecutorService)
builder - buildermaxAge - map内对象的最大存在时长,单位为毫秒scheduledExecutorService - scheduledExecutorServiceprotected K getNullKeyOnce()
public boolean containsKey(Object key)
public <C extends Collection<V>> C fill(C collection, Collection<K> keys)
@Deprecated public V getInstance(K key)
key - get(Object)public Collection<V> values()
public void clear()
Copyright © 2020. All rights reserved.