public class VanillaMapView<K,V> extends Object implements MapView<K,V>
Modifier and Type | Field and Description |
---|---|
protected @NotNull Asset |
asset |
protected @NotNull RequestContext |
context |
protected Class<K> |
keyClass |
protected boolean |
putReturnsNull |
protected boolean |
removeReturnsNull |
protected Class<V> |
valueType |
Constructor and Description |
---|
VanillaMapView(@NotNull(exception=java.lang.NullPointerException.class) RequestContext context,
@NotNull(exception=java.lang.NullPointerException.class) Asset asset,
@NotNull(exception=java.lang.NullPointerException.class) KeyValueStore<K,V> kvStore) |
Modifier and Type | Method and Description |
---|---|
@NotNull Asset |
asset() |
protected void |
checkKey(@Nullable Object key) |
protected void |
checkValue(@Nullable Object value) |
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
@NotNull EntrySetView<K,V> |
entrySet() |
boolean |
equals(Object obj) |
V |
get(Object key) |
V |
getAndPut(K key,
V value)
Explicitly get the old value before putting a new one.
|
V |
getAndRemove(K key)
Explicitly get the old value before removing.
|
V |
getUsing(K key,
Object usingValue)
Obtain a value using a mutable buffer provided.
|
int |
hashCode() |
boolean |
isEmpty() |
@NotNull KeySetView<K> |
keySet() |
Class<K> |
keyType() |
long |
longSize() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
putIfAbsent(K key,
V value) |
@NotNull Reference<V> |
referenceFor(K key)
Obtain a reference the value for a key
|
void |
registerKeySubscriber(@NotNull(exception=java.lang.NullPointerException.class) Subscriber<? super K> subscriber)
Add a Subscription for the keys changed on this Map
|
void |
registerKeySubscriber(@NotNull(exception=java.lang.NullPointerException.class) Subscriber<? super K> subscriber,
@NotNull(exception=java.lang.NullPointerException.class) Filter filter,
@NotNull(exception=java.lang.NullPointerException.class) Set<RequestContext.Operation> operations)
Add a Subscription for the keys changed on this Map
|
void |
registerSubscriber(@NotNull(exception=java.lang.NullPointerException.class) Subscriber<? extends MapEvent<? super K,? super V>> subscriber)
Add a Subscription for the MapEvents triggered by changes on this Map.
|
void |
registerSubscriber(@NotNull(exception=java.lang.NullPointerException.class) Subscriber<? extends MapEvent<? super K,? super V>> subscriber,
@NotNull(exception=java.lang.NullPointerException.class) Filter<? extends MapEvent<? super K,? super V>> filter,
@NotNull(exception=java.lang.NullPointerException.class) Set<RequestContext.Operation> operations)
Add a Subscription for the MapEvents triggered by changes on this Map.
|
void |
registerTopicSubscriber(@NotNull(exception=java.lang.NullPointerException.class) TopicSubscriber<? super K,? super V> topicSubscriber)
Add a TopicSubscriber to this Map.
|
V |
remove(Object key) |
boolean |
remove(@NotNull(exception=java.lang.NullPointerException.class) Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
void |
set(K key,
V value) |
@NotNull String |
toString() |
KeyValueStore<K,V> |
underlying() |
@NotNull Collection<V> |
values() |
Class<V> |
valueType() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
applyTo, applyTo, asyncUpdate, asyncUpdate, syncUpdate, syncUpdate
applyToKey, applyToKey, asyncUpdateKey, asyncUpdateKey, syncUpdateKey, syncUpdateKey
@NotNull protected final @NotNull Asset asset
@NotNull protected final @NotNull RequestContext context
protected final boolean putReturnsNull
protected final boolean removeReturnsNull
public VanillaMapView(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) RequestContext context, @NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Asset asset, @NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) KeyValueStore<K,V> kvStore)
@Nullable public V getUsing(K key, Object usingValue)
MapView
@NotNull public @NotNull KeySetView<K> keySet()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
protected void checkKey(@Nullable @Nullable Object key)
protected void checkValue(@Nullable @Nullable Object value)
@NotNull public @NotNull Asset asset()
public KeyValueStore<K,V> underlying()
underlying
in interface Assetted<Object>
public void set(K key, V value)
set
in interface KeyedVisitable<K,V>
key
- to set within this collection.value
- replace the current state of the visitable Assetpublic long longSize()
@Nullable public V getAndPut(K key, V value)
MapView
@Nullable public V getAndRemove(K key)
MapView
getAndRemove
in interface MapView<K,V>
key
- to remove@NotNull public @NotNull EntrySetView<K,V> entrySet()
@Nullable public V putIfAbsent(@NotNull(exception=java.lang.NullPointerException.class) K key, V value)
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in interface Map<K,V>
public boolean remove(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Object key, Object value)
public boolean replace(@NotNull(exception=java.lang.NullPointerException.class) K key, @NotNull(exception=java.lang.NullPointerException.class) V oldValue, @NotNull(exception=java.lang.NullPointerException.class) V newValue)
@Nullable public V replace(@NotNull(exception=java.lang.NullPointerException.class) K key, @NotNull(exception=java.lang.NullPointerException.class) V value)
public void registerTopicSubscriber(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) TopicSubscriber<? super K,? super V> topicSubscriber)
MapView
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
registerTopicSubscriber
in interface MapView<K,V>
topicSubscriber
- to addpublic void registerKeySubscriber(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Subscriber<? super K> subscriber)
MapView
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
registerKeySubscriber
in interface MapView<K,V>
subscriber
- to addpublic void registerKeySubscriber(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Subscriber<? super K> subscriber, @NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Filter filter, @NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Set<RequestContext.Operation> operations)
MapView
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
registerKeySubscriber
in interface MapView<K,V>
subscriber
- to addfilter
- a list of filter operationsoperations
- which optional operations to consider (e.g. bootstrap and ending after bootstrap)public void registerSubscriber(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Subscriber<? extends MapEvent<? super K,? super V>> subscriber)
MapView
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
registerSubscriber
in interface MapView<K,V>
subscriber
- the subscriber to the subscriptionpublic void registerSubscriber(@NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Subscriber<? extends MapEvent<? super K,? super V>> subscriber, @NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Filter<? extends MapEvent<? super K,? super V>> filter, @NotNull(exception=java.lang.NullPointerException.class) @NotNull(exception=java.lang.NullPointerException.class) Set<RequestContext.Operation> operations)
MapView
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
registerSubscriber
in interface MapView<K,V>
subscriber
- the subscriber to the subscriptionfilter
- to apply on keys and valuesoperations
- which optional operations to consider (e.g. bootstrap and ending after bootstrap)@NotNull public @NotNull Reference<V> referenceFor(K key)
MapView
referenceFor
in interface MapView<K,V>
key
- to bind the reference topublic int hashCode()
public boolean equals(Object obj)
Copyright © 2021. All rights reserved.