Class DefaultMapEntry
- java.lang.Object
-
- relocated.morphia.org.apache.commons.collections.DefaultMapEntry
-
- All Implemented Interfaces:
java.util.Map.Entry
public class DefaultMapEntry extends java.lang.Object implements java.util.Map.EntryA default implementation ofMap.Entry- Since:
- 1.0
- Author:
- James Strachan, Michael A. Smith
-
-
Constructor Summary
Constructors Constructor Description DefaultMapEntry()Constructs a newDefaultMapEntrywith a null key and null value.DefaultMapEntry(java.lang.Object key, java.lang.Object value)Constructs a newDefaultMapEntrywith the given key and given value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Implemented per API documentation ofMap.Entry.equals(Object)java.lang.ObjectgetKey()Returns the key.java.lang.ObjectgetValue()Returns the value.inthashCode()Implemented per API documentation ofMap.Entry.hashCode()voidsetKey(java.lang.Object key)Sets the key.java.lang.ObjectsetValue(java.lang.Object value)Note that this method only sets the local reference inside this object and does not modify the original Map.
-
-
-
Constructor Detail
-
DefaultMapEntry
public DefaultMapEntry()
Constructs a newDefaultMapEntrywith a null key and null value.
-
DefaultMapEntry
public DefaultMapEntry(java.lang.Object key, java.lang.Object value)Constructs a newDefaultMapEntrywith the given key and given value.- Parameters:
key- the key for the entry, may be nullvalue- the value for the entry, may be null
-
-
Method Detail
-
getKey
public java.lang.Object getKey()
Returns the key.- Specified by:
getKeyin interfacejava.util.Map.Entry- Returns:
- the key
-
getValue
public java.lang.Object getValue()
Returns the value.- Specified by:
getValuein interfacejava.util.Map.Entry- Returns:
- the value
-
setValue
public java.lang.Object setValue(java.lang.Object value)
Note that this method only sets the local reference inside this object and does not modify the original Map.- Specified by:
setValuein interfacejava.util.Map.Entry- Parameters:
value- the new value- Returns:
- the old value of the value
-
setKey
public void setKey(java.lang.Object key)
Sets the key. This method does not modify any map.- Parameters:
key- the new key
-
hashCode
public int hashCode()
Implemented per API documentation ofMap.Entry.hashCode()- Specified by:
hashCodein interfacejava.util.Map.Entry- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Implemented per API documentation ofMap.Entry.equals(Object)- Specified by:
equalsin interfacejava.util.Map.Entry- Overrides:
equalsin classjava.lang.Object
-
-