public static class

AbstractMap.SimpleImmutableEntry

extends Object
implements Map.Entry<K, V>
java.lang.Object
   ↳ java.util.AbstractMap.SimpleImmutableEntry<K, V>

Class Overview

An immutable key-value mapping.

Summary

Public Constructors
SimpleImmutableEntry(K theKey, V theValue)
Constructs a new instance by key and value.
SimpleImmutableEntry(Entry<? extends K, ? extends V> entry)
Constructs a new instance by an entry
Public Methods
boolean equals(Object object)
Answers whether the object is equal to this entry.
K getKey()
Returns the key.
V getValue()
Returns the value.
int hashCode()
Answers the hash code of this entry.
V setValue(V object)
Throws an UnsupportedOperationException.
String toString()
Answers a String representation of this entry.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Map.Entry

Public Constructors

public SimpleImmutableEntry (K theKey, V theValue)

Constructs a new instance by key and value.

Parameters
theKey the key
theValue the value

public SimpleImmutableEntry (Entry<? extends K, ? extends V> entry)

Constructs a new instance by an entry

Parameters
entry the entry

Public Methods

public boolean equals (Object object)

Answers whether the object is equal to this entry. This works across all kinds of the Map.Entry interface.

Parameters
object the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public K getKey ()

Returns the key.

Returns
  • the key
See Also

public V getValue ()

Returns the value.

Returns
  • the value
See Also

public int hashCode ()

Answers the hash code of this entry.

Returns
  • a hash code value for this object.
See Also

public V setValue (V object)

Throws an UnsupportedOperationException.

Parameters
object new value
Returns
  • (Does not)

public String toString ()

Answers a String representation of this entry.

Returns
  • a string representation of the object.
See Also