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.
|
public 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 © 2001-2017 The Apache Software Foundation. All Rights Reserved.