Module java.base
Package java.util

Class AbstractMap.SimpleImmutableEntry<K,V>

Type Parameters:
K - the type of the keys
V - the type of the value
All Implemented Interfaces:
Serializable, Map.Entry<K,V>
Enclosing class:

public static class AbstractMap.SimpleImmutableEntry<K,V> extends Object implements Map.Entry<K,V>, Serializable
An unmodifiable Entry maintaining a key and a value. This class does not support the setValue method. Instances of this class are not associated with any map nor with any map's entry-set view.
API Note:
Instances of this class are not necessarily immutable, as the key and value may be mutable. An instance of this specific class is unmodifiable, because the key and value references cannot be changed. A reference of this type may not be unmodifiable, as a subclass may be modifiable or may provide the appearance of modifiability.

This class may be convenient in methods that return thread-safe snapshots of key-value mappings. For alternatives, see the Map::entry and Map.Entry::copyOf methods.

See Also: