# Class AbstractMap.SimpleImmutableEntry<K,V>

java.lang.Object
java.util.AbstractMap.SimpleImmutableEntry<K,V>

Type Parameters:
  `K` - the type of key
  `V` - the type of value

All Implemented Interfaces:
  `Map.Entry<K,V>`

Enclosing class:
  `AbstractMap<K,V>`

public static class AbstractMap.SimpleImmutableEntry<K,V> extends Object implements Map.Entry<K,V>
An immutable key-value mapping.

Since:
  1.6

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleImmutableEntry(Map.Entry<? extends K, ? extends V> entry)`
  Constructs a new instance by an entry
  `SimpleImmutableEntry(K theKey, V theValue)`
  Constructs a new instance by key and value.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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.

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Constructor Details

  - ### SimpleImmutableEntry

    public SimpleImmutableEntry(K theKey, V theValue)
    Constructs a new instance by key and value.
    Parameters:
      `theKey` - the key
      `theValue` - the value

  - ### SimpleImmutableEntry

    public SimpleImmutableEntry(Map.Entry<? extends K, ? extends V> entry)
    Constructs a new instance by an entry
    Parameters:
      `entry` - the entry

- ## Method Details

  - ### getKey

    public K getKey()
    Returns the key.
    Specified by:
      `getKey` in interface `Map.Entry<K,V>`
    Returns:
      the key
    See Also:
      - `Map.Entry.getKey()`

  - ### getValue

    public V getValue()
    Returns the value.
    Specified by:
      `getValue` in interface `Map.Entry<K,V>`
    Returns:
      the value
    See Also:
      - `Map.Entry.getValue()`

  - ### setValue

    public V setValue(V object)
    Throws an UnsupportedOperationException.
    Specified by:
      `setValue` in interface `Map.Entry<K,V>`
    Parameters:
      `object` - new value
    Returns:
      (Does not)
    Throws:
      `UnsupportedOperationException` - always
    See Also:
      - `Map.Entry.setValue(java.lang.Object)`

  - ### 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.
    Specified by:
      `equals` in interface `Map.Entry<K,V>`
    Overrides:
      `equals` in class `Object`
    Parameters:
      `object` - the `Object` to compare with this `Object`.
    Returns:
      `true` if the specified `Object` is equal to this `Map.Entry`, `false` otherwise.
    See Also:
      - `Object.equals(java.lang.Object)`

  - ### hashCode

    public int hashCode()
    Answers the hash code of this entry.
    Specified by:
      `hashCode` in interface `Map.Entry<K,V>`
    Overrides:
      `hashCode` in class `Object`
    Returns:
      the receiver's hash code.
    See Also:
      - `Object.hashCode()`

  - ### toString

    public String toString()
    Answers a String representation of this entry.
    Overrides:
      `toString` in class `Object`
    See Also:
      - `Object.toString()`