org.apache.commons.collections.keyvalue
Class AbstractMapEntry
java.lang.Object
|
+--org.apache.commons.collections.keyvalue.AbstractKeyValue
|
+--org.apache.commons.collections.keyvalue.AbstractMapEntry
All Implemented Interfaces:
Map.Entry, KeyValueKnown Direct Subclasses:
BeanMap.MyMapEntry, DefaultMapEntry, UnmodifiableMapEntry
public abstract class
AbstractMapEntryextends
AbstractKeyValueimplements Map.Entry
Abstract Pair class to assist with creating correct Map Entry implementations.
- Commons Collections 3.0
- James Strachan
- Michael A. Smith
- Neil O'Toole
- Stephen Colebourne
AbstractMapEntry
protected AbstractMapEntry(Object key, Object value)
Constructs a new entry with the given key and given value.
- key - the key for the entry, may be null
- value - the value for the entry, may be null
equals
public boolean equals(Object obj)
Compares this Map Entry with another Map Entry.
Implemented per API documentation of java.util.Map.Entry.equals(Object)
- obj - the object to compare to
- true if equal key and value
hashCode
public int hashCode()
Gets a hashCode compatible with the equals method.
Implemented per API documentation of java.util.Map.Entry.hashCode()
- a suitable hash code
setValue
public Object setValue(Object value)
Sets the value stored in this Map Entry.
This Map Entry is not connected to a Map, so only the local data is changed.
- value - the new value
- the previous value