java.io.Serializable
, java.util.Map.Entry
, KeyValue
public class TiedMapEntry extends java.lang.Object implements java.util.Map.Entry, KeyValue, java.io.Serializable
Map.Entry
tied to a map underneath.
This can be used to enable a map entry to make changes on the underlying map, however this will probably mess up any iterators.
Constructor | Description |
---|---|
TiedMapEntry(java.util.Map map,
java.lang.Object key) |
Constructs a new entry with the given Map and key.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object obj) |
Compares this
Map.Entry with another Map.Entry . |
java.lang.Object |
getKey() |
Gets the key of this entry
|
java.lang.Object |
getValue() |
Gets the value of this entry direct from the map.
|
int |
hashCode() |
Gets a hashCode compatible with the equals method.
|
java.lang.Object |
setValue(java.lang.Object value) |
Sets the value associated with the key direct onto the map.
|
java.lang.String |
toString() |
Gets a string version of the entry.
|
public TiedMapEntry(java.util.Map map, java.lang.Object key)
map
- the mapkey
- the keypublic java.lang.Object getKey()
public java.lang.Object getValue()
public java.lang.Object setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry
value
- the new valuejava.lang.IllegalArgumentException
- if the value is set to this map entrypublic boolean equals(java.lang.Object obj)
Map.Entry
with another Map.Entry
.
Implemented per API documentation of Map.Entry.equals(Object)
equals
in interface java.util.Map.Entry
equals
in class java.lang.Object
obj
- the object to compare topublic int hashCode()
Implemented per API documentation of Map.Entry.hashCode()
hashCode
in interface java.util.Map.Entry
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2001-2017 Apache Software Foundation. All Rights Reserved.