public class AbstractKeyValueStore<K,MV,V> extends Object implements KeyValueStore<K,MV,V>
KeyValueStore.Entry<K,V>| Modifier and Type | Field and Description |
|---|---|
protected Asset |
asset |
protected Class<K> |
keyType |
protected KeyValueStore<K,MV,V> |
kvStore |
protected Class<V> |
valueType |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractKeyValueStore(RequestContext rc,
Asset asset,
KeyValueStore<K,MV,V> kvStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(EngineReplication.ReplicationEntry replicationEntry) |
Asset |
asset() |
void |
clear() |
void |
close() |
boolean |
containsKey(K key) |
boolean |
containsValue(V value) |
void |
entriesFor(int segment,
SubscriptionConsumer<MapEvent<K,V>> kvConsumer) |
Iterator<Map.Entry<K,V>> |
entrySetIterator() |
V |
get(K key) |
V |
getAndPut(K key,
V value) |
V |
getAndRemove(K key) |
V |
getUsing(K key,
MV value) |
boolean |
isKeyType(Object key) |
boolean |
isReadOnly() |
boolean |
keyedView()
If you attach a keyed view to an Asset, it is assumed that any child asset with be a SubAsset.
|
Iterator<K> |
keySetIterator() |
void |
keysFor(int segment,
SubscriptionConsumer<K> kConsumer) |
Class<K> |
keyType() |
long |
longSize() |
boolean |
put(K key,
V value)
put an entry
|
V |
putIfAbsent(K key,
V value) |
boolean |
remove(K key)
remove a key
|
boolean |
removeIfEqual(K key,
V value) |
V |
replace(K key,
V value) |
boolean |
replaceIfEqual(K key,
V oldValue,
V newValue) |
int |
segmentFor(K key) |
int |
segments() |
KeyValueStore |
underlying() |
Class<V> |
valueType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvaluesIteratorandThen@NotNull protected final Asset asset
@NotNull protected final KeyValueStore<K,MV,V> kvStore
protected AbstractKeyValueStore(@NotNull
RequestContext rc,
@NotNull
Asset asset,
@NotNull
KeyValueStore<K,MV,V> kvStore)
@NotNull public KeyValueStore underlying()
underlying in interface Assetted<KeyValueStore<K,MV,V>>@Nullable public V getAndPut(K key, V value)
getAndPut in interface KeyValueStore<K,MV,V>@Nullable public V getAndRemove(K key)
getAndRemove in interface KeyValueStore<K,MV,V>@Nullable public V getUsing(K key, MV value)
getUsing in interface KeyValueStore<K,MV,V>public Iterator<Map.Entry<K,V>> entrySetIterator()
entrySetIterator in interface KeyValueStore<K,MV,V>public long longSize()
longSize in interface KeyValueStore<K,MV,V>public void keysFor(int segment,
SubscriptionConsumer<K> kConsumer)
throws InvalidSubscriberException
keysFor in interface KeyValueStore<K,MV,V>InvalidSubscriberExceptionpublic void entriesFor(int segment,
SubscriptionConsumer<MapEvent<K,V>> kvConsumer)
throws InvalidSubscriberException
entriesFor in interface KeyValueStore<K,MV,V>InvalidSubscriberExceptionpublic Asset asset()
public void clear()
clear in interface KeyValueStore<K,MV,V>@Nullable public V replace(K key, V value)
replace in interface KeyValueStore<K,MV,V>public void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean put(K key, V value)
KeyValueStoreput in interface KeyValueStore<K,MV,V>key - to setvalue - to setpublic boolean remove(K key)
KeyValueStoreremove in interface KeyValueStore<K,MV,V>key - to removepublic boolean containsKey(K key)
containsKey in interface KeyValueStore<K,MV,V>public boolean isReadOnly()
isReadOnly in interface KeyValueStore<K,MV,V>public int segments()
segments in interface KeyValueStore<K,MV,V>public int segmentFor(K key)
segmentFor in interface KeyValueStore<K,MV,V>public boolean replaceIfEqual(K key, V oldValue, V newValue)
replaceIfEqual in interface KeyValueStore<K,MV,V>public boolean removeIfEqual(K key, V value)
removeIfEqual in interface KeyValueStore<K,MV,V>public boolean isKeyType(Object key)
isKeyType in interface KeyValueStore<K,MV,V>@Nullable public V putIfAbsent(K key, V value)
putIfAbsent in interface KeyValueStore<K,MV,V>public boolean keyedView()
Viewpublic boolean containsValue(V value)
containsValue in interface KeyValueStore<K,MV,V>public Iterator<K> keySetIterator()
keySetIterator in interface KeyValueStore<K,MV,V>public void accept(EngineReplication.ReplicationEntry replicationEntry)
accept in interface java.util.function.Consumer<EngineReplication.ReplicationEntry>Copyright © 2015. All rights reserved.