public static class AbstractMap.SimpleImmutableEntry<K, V>
- Object
- AbstractMap.SimpleImmutableEntry
ImplementsMap.Entry<K, V>
An immutable key-value mapping.
Type parameter K: the type of key
Type parameter V: the type of value
Constructors
public SimpleImmutableEntry(K theKey, V theValue) | Constructs a new instance by key and value. |
public SimpleImmutableEntry(Map.Entry<? extends K, ? extends V> entry) | Constructs a new instance by an entry |
Methods
public K getKey() | Returns the key. |
public V getValue() | Returns the value. |
public V setValue(V object) | Throws an UnsupportedOperationException. |
public boolean equals(Object object) | Answers whether the object is equal to this entry. |
public int hashCode() | Answers the hash code of this entry. |
public String toString() | Answers a String representation of this entry. |
Inherited methods
Constructor details
SimpleImmutableEntry
public SimpleImmutableEntry(K theKey, V theValue)Constructs a new instance by key and value.
Parameters
theKeyK- the key
theValueV- the value
SimpleImmutableEntry
public SimpleImmutableEntry(Map.Entry<? extends K, ? extends V> entry)Constructs a new instance by an entry
Parameters
entryMap.Entry<? extends K, ? extends V>- the entry
Method details
getKey
public K getKey()Returns the key.
Returns
the key
See also
getValue
public V getValue()Returns the value.
Returns
the value
See also
setValue
public V setValue(V object)Throws an UnsupportedOperationException.
Parameters
objectV- new value
Returns
(Does not)
Throws
equals
public boolean equals(Object object)Answers whether the object is equal to this entry. This works across
all kinds of the Map.Entry interface.
hashCode
public int hashCode()Answers the hash code of this entry.
See also
toString
public String toString()Answers a String representation of this entry.