K - The key type.V - The value type.public class MapEntry<K,V> extends Object implements Map.Entry<K,V>
Map.Entry implementation that can be constructed to either be read-only or not.
| Constructor and Description |
|---|
MapEntry(K key,
V value,
boolean modifiable)
Creates a map entry that can either allow modifications or not.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Determines if this entry is equal to the passed object.
|
K |
getKey()
Gets the entry key.
|
V |
getValue()
Gets the entry value.
|
int |
hashCode()
Returns the hashcode for this entry.
|
V |
setValue(V val)
Sets the entry value if the entry can be modified.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcomparingByKey, comparingByKey, comparingByValue, comparingByValuepublic K getKey()
Gets the entry key.
public V getValue()
Gets the entry value.
public V setValue(V val)
Sets the entry value if the entry can be modified.
setValue in interface Map.Entry<K,V>val - The new valueUnsupportedOperationException - If the entry cannot be modifiedpublic boolean equals(Object o)
Determines if this entry is equal to the passed object.
Copyright © 2000–2025 Apache Software Foundation. All rights reserved.