K
- the Object type used as keyV
- the Object type used as valuepublic class KeyValuePair<K,V> extends Object implements Map.Entry<K,V>
Constructor and Description |
---|
KeyValuePair(K k,
V v)
Constructs a Key-Value pair using the given key and value.
|
Modifier and Type | Method and Description |
---|---|
K |
getKey()
Returns the key corresponding to this entry.
|
V |
getValue()
Returns the value corresponding to this entry.
|
V |
setValue(V newValue)
Replaces the value corresponding to this entry with the specified value (optional operation).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCode
public KeyValuePair(K k, V v)
k
- The key objectv
- The value objectpublic V setValue(V newValue) throws UnsupportedOperationException
setValue
in interface Map.Entry<K,V>
newValue
- new value to be stored in this entry.UnsupportedOperationException
- if the put operation is not supported by the backing map.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.