public static class AbstractMap.SimpleImmutableEntry
extends java.lang.Object
implements java.util.Map.Entry
Constructor and Description |
---|
AbstractMap.SimpleImmutableEntry(java.util.Map.Entry entry)
Creates an entry representing the same mapping as the
specified entry.
|
AbstractMap.SimpleImmutableEntry(java.lang.Object key,
java.lang.Object value)
Creates an entry representing a mapping from the specified
key to the specified value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Object |
getKey()
Returns the key corresponding to this entry.
|
java.lang.Object |
getValue()
Returns the value corresponding to this entry.
|
int |
hashCode() |
java.lang.Object |
setValue(java.lang.Object value)
Replaces the value corresponding to this entry with the specified
value (optional operation).
|
java.lang.String |
toString()
Returns a String representation of this map entry.
|
public AbstractMap.SimpleImmutableEntry(java.lang.Object key, java.lang.Object value)
key
- the key represented by this entryvalue
- the value represented by this entrypublic AbstractMap.SimpleImmutableEntry(java.util.Map.Entry entry)
entry
- the entry to copypublic java.lang.Object getKey()
getKey
in interface java.util.Map.Entry
public java.lang.Object getValue()
getValue
in interface java.util.Map.Entry
public java.lang.Object setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry
value
- new value to be stored in this entryjava.lang.UnsupportedOperationException
- alwayspublic boolean equals(java.lang.Object o)
equals
in interface java.util.Map.Entry
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Map.Entry
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object