public class MapEntryParameter
extends java.lang.Object
implements java.util.Map.Entry
Map.Entry implementation that can be used as in
input parameter. Since a MapEntryParameter is not obtained
from a map, it is not attached to any map in particular. To emphasize that
changing this object does not change the map, the setValue(java.lang.Object) method
always throws UnsupportedOperationException.
Warning: Use of this interface violates the Java Collections
interface contract since these state that Map.Entry objects
should only be obtained from Map.entrySet() sets, while this
class allows constructing them directly. However, it is useful for
performing operations on an entry set such as add(), contains(), etc. For
restrictions see getValue() and setValue(java.lang.Object).
| Constructor and Description |
|---|
MapEntryParameter(java.lang.Object key,
java.lang.Object value)
Creates a map entry with a given key and value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other)
Compares this entry to a given entry as specified by
Map.Entry.equals(java.lang.Object). |
java.lang.Object |
getKey()
Returns the key of this entry.
|
java.lang.Object |
getValue()
Returns the value of this entry.
|
int |
hashCode()
Computes a hash code as specified by
Map.Entry.hashCode(). |
java.lang.Object |
setValue(java.lang.Object newValue)
Always throws
UnsupportedOperationException since this
object is not attached to a map. |
java.lang.String |
toString()
Converts the entry to a string representation for debugging.
|
public MapEntryParameter(java.lang.Object key,
java.lang.Object value)
key - is the key to use.value - is the value to use.public int hashCode()
Map.Entry.hashCode().hashCode in interface java.util.Map.EntryhashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
Map.Entry.equals(java.lang.Object).equals in interface java.util.Map.Entryequals in class java.lang.Objectpublic final java.lang.Object getKey()
getKey in interface java.util.Map.Entrypublic final java.lang.Object getValue()
setValue(java.lang.Object).
It will not reflect changes made to a Map.getValue in interface java.util.Map.Entrypublic java.lang.Object setValue(java.lang.Object newValue)
UnsupportedOperationException since this
object is not attached to a map.setValue in interface java.util.Map.Entrypublic java.lang.String toString()
toString in class java.lang.Object