Map
instances.
This is a value-based class; programmers should treat instances that are equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail.
API Note
This class is not public. Instances can be created using the
Map.
factory method, which is public.
This class differs from AbstractMap.SimpleImmutableEntry in the following ways: it is not serializable, it is final, and its key and value must be non-null.
Map.ofEntries()
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public boolean | equals(Object
object to be compared for equality with this map entry o)Overrides java. Implements java. |
public K | |
public V | Returns: the valueImplements java. |
public int | hashCode()
Overrides java. Implements java. |
public V | Returns: never returns normallyignored value)Implements java. UnsupportedOperationException .
|
public String | Returns: a String representation of this map entryOverrides java. |
key | back to summary |
---|---|
pack-priv final K key
|
value | back to summary |
---|---|
pack-priv final V value
|
KeyValueHolder | back to summary |
---|---|
pack-priv KeyValueHolder(K k, V v) |
equals | back to summary |
---|---|
public boolean equals(Object o) Overrides java. Implements java. Compares the specified object with this entry for equality.
Returns
|
getKey | back to summary |
---|---|
public K getKey() Implements java. Gets the key from this holder.
|
getValue | back to summary |
---|---|
public V getValue() Implements java. Gets the value from this holder.
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Implements java. Returns the hash code value for this map entry. The hash code
is
|
setValue | back to summary |
---|---|
public V setValue(V value) Implements java. Throws
|
toString | back to summary |
---|---|
public String toString() Overrides java. Returns a String representation of this map entry. This
implementation returns the string representation of this
entry's key followed by the equals character (" |