public class Pair<K,V>
extends java.lang.Object
implements java.util.Map.Entry
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.util.Map.Entry other) |
boolean |
equals(java.lang.Object other) |
K |
getKey()
Returns the key corresponding to this entry.
|
V |
getValue()
Returns the value corresponding to this entry.
|
int |
hashCode() |
V |
setValue(java.lang.Object value)
Replaces the value corresponding to this entry with the specified
value (optional operation).
|
public boolean equals(java.util.Map.Entry other)
public boolean equals(java.lang.Object other)
equals
in interface java.util.Map.Entry
equals
in class java.lang.Object
public K getKey()
getKey
in interface java.util.Map.Entry
java.lang.IllegalStateException
- implementations may, but are not
required to, throw this exception if the entry has been
removed from the backing map.public V getValue()
getValue
in interface java.util.Map.Entry
java.lang.IllegalStateException
- implementations may, but are not
required to, throw this exception if the entry has been
removed from the backing map.public int hashCode()
hashCode
in interface java.util.Map.Entry
hashCode
in class java.lang.Object
public V setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry
value
- new value to be stored in this entryjava.lang.UnsupportedOperationException
- if the put operation
is not supported by the backing mapjava.lang.ClassCastException
- if the class of the specified value
prevents it from being stored in the backing mapjava.lang.NullPointerException
- if the backing map does not permit
null values, and the specified value is nulljava.lang.IllegalArgumentException
- if some property of this value
prevents it from being stored in the backing mapjava.lang.IllegalStateException
- implementations may, but are not
required to, throw this exception if the entry has been
removed from the backing map.