Class AbstractMapEntry
- java.lang.Object
-
- org.apache.commons.collections.keyvalue.AbstractKeyValue
-
- org.apache.commons.collections.keyvalue.AbstractMapEntry
-
- All Implemented Interfaces:
java.util.Map.Entry,KeyValue
- Direct Known Subclasses:
DefaultMapEntry,UnmodifiableMapEntry
public abstract class AbstractMapEntry extends AbstractKeyValue implements java.util.Map.Entry
Abstract Pair class to assist with creating correctMap.Entryimplementations.- Since:
- Commons Collections 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compares thisMap.Entrywith anotherMap.Entry.inthashCode()Gets a hashCode compatible with the equals method.java.lang.ObjectsetValue(java.lang.Object value)Sets the value stored in thisMap.Entry.-
Methods inherited from class org.apache.commons.collections.keyvalue.AbstractKeyValue
getKey, getValue, toString
-
-
-
-
Method Detail
-
setValue
public java.lang.Object setValue(java.lang.Object value)
Sets the value stored in thisMap.Entry.This
Map.Entryis not connected to a Map, so only the local data is changed.- Specified by:
setValuein interfacejava.util.Map.Entry- Parameters:
value- the new value- Returns:
- the previous value
-
equals
public boolean equals(java.lang.Object obj)
Compares thisMap.Entrywith anotherMap.Entry.Implemented per API documentation of
Map.Entry.equals(Object)- Specified by:
equalsin interfacejava.util.Map.Entry- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to compare to- Returns:
- true if equal key and value
-
hashCode
public int hashCode()
Gets a hashCode compatible with the equals method.Implemented per API documentation of
Map.Entry.hashCode()- Specified by:
hashCodein interfacejava.util.Map.Entry- Overrides:
hashCodein classjava.lang.Object- Returns:
- a suitable hash code
-
-