Class AbstractMapEntry<K,V>
- java.lang.Object
-
- org.apache.commons.collections4.keyvalue.AbstractKeyValue<K,V>
-
- org.apache.commons.collections4.keyvalue.AbstractMapEntry<K,V>
-
- Direct Known Subclasses:
DefaultMapEntry
,UnmodifiableMapEntry
public abstract class AbstractMapEntry<K,V> extends AbstractKeyValue<K,V> implements Map.Entry<K,V>
Abstract Pair class to assist with creating correctMap.Entry
implementations.- Since:
- 3.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMapEntry(K key, V value)
Constructs a new entry with the given key and given value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Compares thisMap.Entry
with anotherMap.Entry
.int
hashCode()
Gets a hashCode compatible with the equals method.V
setValue(V value)
Sets the value stored in thisMap.Entry
.-
Methods inherited from class org.apache.commons.collections4.keyvalue.AbstractKeyValue
getKey, getValue, setKey, toString
-
-
-
-
Method Detail
-
setValue
public V setValue(V value)
Sets the value stored in thisMap.Entry
.This
Map.Entry
is not connected to a Map, so only the local data is changed.
-
equals
public boolean equals(Object obj)
Compares thisMap.Entry
with anotherMap.Entry
.Implemented per API documentation of
Map.Entry.equals(Object)
-
-