Class TiedMapEntry
- java.lang.Object
-
- org.apache.commons.collections.keyvalue.TiedMapEntry
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Map.Entry,KeyValue
@Deprecated(since="2021-04-30") public class TiedMapEntry extends java.lang.Object implements java.util.Map.Entry, KeyValue, java.io.Serializable
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.AMap.Entrytied 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.
- Since:
- Commons Collections 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TiedMapEntry(java.util.Map map, java.lang.Object key)Deprecated.Constructs a new entry with the given Map and key.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Deprecated.Compares thisMap.Entrywith anotherMap.Entry.java.lang.ObjectgetKey()Deprecated.Gets the key of this entryjava.lang.ObjectgetValue()Deprecated.Gets the value of this entry direct from the map.inthashCode()Deprecated.Gets a hashCode compatible with the equals method.java.lang.ObjectsetValue(java.lang.Object value)Deprecated.Sets the value associated with the key direct onto the map.java.lang.StringtoString()Deprecated.Gets a string version of the entry.
-
-
-
Method Detail
-
getKey
public java.lang.Object getKey()
Deprecated.Gets the key of this entry
-
getValue
public java.lang.Object getValue()
Deprecated.Gets the value of this entry direct from the map.
-
setValue
public java.lang.Object setValue(java.lang.Object value)
Deprecated.Sets the value associated with the key direct onto the map.- Specified by:
setValuein interfacejava.util.Map.Entry- Parameters:
value- the new value- Returns:
- the old value
- Throws:
java.lang.IllegalArgumentException- if the value is set to this map entry
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.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()
Deprecated.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
-
toString
public java.lang.String toString()
Deprecated.Gets a string version of the entry.- Overrides:
toStringin classjava.lang.Object- Returns:
- entry as a string
-
-