K - The type of the keyV - The type of the valuepublic interface MapValue<K,V> extends Value<Map<K,V>>
Value that is different from
a CollectionValue such that the "elements" are
Map.Entry. Usually, this type of value is used to represent
a particular "type" of "key" that is associated to a particular "value".| Modifier and Type | Method and Description |
|---|---|
ImmutableMapValue<K,V> |
asImmutable()
Gets the
ImmutableValue version of this Value such that
all data is duplicated across to the new ImmutableValue. |
boolean |
containsKey(K key)
Checks if the provided key is contained within this map.
|
boolean |
containsValue(V value)
Checks if the provided value is contained within this map.
|
MapValue<K,V> |
copy()
Makes an independent copy of this
Value with the same initial
data. |
ImmutableSet<Map.Entry<K,V>> |
entrySet()
Retrieves an
ImmutableSet of the Map.Entrys contained
within this map value. |
ImmutableSet<K> |
keySet()
Gets an
ImmutableSet of all keys contained in this map value. |
MapValue<K,V> |
put(K key,
V value)
Associates the provided key to the provided value.
|
MapValue<K,V> |
putAll(Map<K,V> map)
Associates all provided
Map.Entry to this map value. |
MapValue<K,V> |
remove(K key)
Removes the association of the provided key to the value currently
associated.
|
MapValue<K,V> |
removeAll(Iterable<K> keys)
Removes all key value associations of the provided keys.
|
MapValue<K,V> |
removeAll(Predicate<Map.Entry<K,V>> predicate)
|
int |
size()
Gets the size of this map.
|
MapValue<K,V> |
transform(Function<Map<K,V>,Map<K,V>> function)
Attempts to transform the underlying value based on the provided
Function such that the result of Function.apply(Object)
will replace the underlying value. |
ImmutableCollection<V> |
values()
Retrieves an
ImmutableCollection of all available values within
this map. |
int size()
MapValue<K,V> put(K key, V value)
key - The key to associate to the valuevalue - The value associated with the keyMapValue<K,V> putAll(Map<K,V> map)
Map.Entry to this map value.map - The map of key values to setMapValue<K,V> remove(K key)
key - The key to removeMapValue<K,V> removeAll(Iterable<K> keys)
keys - The keys to removeMapValue<K,V> removeAll(Predicate<Map.Entry<K,V>> predicate)
Predicate to all Map.Entry within this
MapValue. Any entries that are false will be removed from the
map value.predicate - The predicate to filerboolean containsKey(K key)
key - The key to checkboolean containsValue(V value)
value - The value to checkImmutableSet<K> keySet()
ImmutableSet of all keys contained in this map value.ImmutableSet<Map.Entry<K,V>> entrySet()
ImmutableSet of the Map.Entrys contained
within this map value.ImmutableCollection<V> values()
ImmutableCollection of all available values within
this map.MapValue<K,V> transform(Function<Map<K,V>,Map<K,V>> function)
ValueFunction such that the result of Function.apply(Object)
will replace the underlying value.ImmutableMapValue<K,V> asImmutable()
ValueImmutableValue version of this Value such that
all data is duplicated across to the new ImmutableValue. Note
that once created, the ImmutableValue is not going to change.asImmutable in interface Value<Map<K,V>>ImmutableValue instance