Map.Entry
with well-defined member names.
Using this class helps make Avro immune from the naming variations of
key/value fields among several Map.
implementations. If objects
of this class are used instead of the regular ones obtained by
Map#entrySet()
, then we need not worry about the actual field names
or any changes to them in the future.
Example: ConcurrentHashMap.MapEntry
does not name the fields as key/
value in Java 1.8 while it used to do so in Java 1.7
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public K | |
public V | |
public V | setValue(V
new value to be stored in this entry value)Implements java. |
MapEntry | back to summary |
---|---|
public MapEntry(K key, V value) |
getKey | back to summary |
---|---|
public K getKey() Implements java. Doc from java. Returns the key corresponding to this entry.
|
getValue | back to summary |
---|---|
public V getValue() Implements java. Doc from java. Returns the value corresponding to this entry. If the mapping
has been removed from the backing map (by the iterator's
|
setValue | back to summary |
---|---|
public V setValue(V value) Implements java. Doc from java. Replaces the value corresponding to this entry with the specified
value (optional operation). (Writes through to the map.) The
behavior of this call is undefined if the mapping has already been
removed from the map (by the iterator's
|