Interface MapState<K,V> 
- Type Parameters:
- K- the type of keys maintained by this map
- V- the type of mapped values
- All Superinterfaces:
- State
ReadableState cell mapping keys to values.
 Implementations of this form of state are expected to implement map operations efficiently as supported by some associated backing key-value store.
- 
Method SummaryModifier and TypeMethodDescriptioncomputeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) A deferred read-followed-by-write.entries()Returns anIterableover the key-value pairs contained in this map.A deferred lookup, using null values if the item is not found.getOrDefault(K key, V defaultValue) A deferred lookup.isEmpty()Returns aReadableStatewhoseReadableState.read()method will return true if this state is empty at the point when thatReadableState.read()call returns.keys()Returns anIterableover the keys contained in this map.voidAssociates the specified value with the specified key in this state.default ReadableState<V> putIfAbsent(K key, V value) A deferred read-followed-by-write.voidRemove the mapping for a key from this map if it is present.values()Returns anIterableover the values contained in this map.
- 
Method Details- 
putAssociates the specified value with the specified key in this state.Changes will not be reflected in the results returned by previous calls to ReadableState.read()on the results any of the reading methods (get(K),keys(),values(), andentries()).
- 
putIfAbsentA deferred read-followed-by-write.When read()is called on the result or state is committed, it forces a read of the map and reconciliation with any pending modifications.If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returnsnull, else returns the current value.Changes will not be reflected in the results returned by previous calls to ReadableState.read()on the results any of the reading methods (get(K),keys(),values(), andentries()).
- 
computeIfAbsentA deferred read-followed-by-write.When read()is called on the result or state is committed, it forces a read of the map and reconciliation with any pending modifications.If the specified key is not already associated with a value (or is mapped to null) associates it with the computed and returnsnull, else returns the current value.Changes will not be reflected in the results returned by previous calls to ReadableState.read()on the results any of the reading methods (get(K),keys(),values(), andentries()).
- 
removeRemove the mapping for a key from this map if it is present.Changes will not be reflected in the results returned by previous calls to ReadableState.read()on the results any of the reading methods (get(K),keys(),values(), andentries()).
- 
getA deferred lookup, using null values if the item is not found.A user is encouraged to call getfor all relevant keys and callreadLater()on the results.When read()is called, a particular state implementation is encouraged to perform all pending reads in a single batch.
- 
getOrDefaultA deferred lookup.A user is encouraged to call getfor all relevant keys and callreadLater()on the results.When read()is called, a particular state implementation is encouraged to perform all pending reads in a single batch.
- 
keysReadableState<Iterable<K>> keys()Returns anIterableover the keys contained in this map.
- 
valuesReadableState<Iterable<V>> values()Returns anIterableover the values contained in this map.
- 
entriesReadableState<Iterable<Map.Entry<K,V>>> entries()Returns anIterableover the key-value pairs contained in this map.
- 
isEmptyReadableState<Boolean> isEmpty()Returns aReadableStatewhoseReadableState.read()method will return true if this state is empty at the point when thatReadableState.read()call returns.
 
-