K
- the key typeV
- the value typepublic final class MapEntry<K,V>
extends java.lang.Object
implements java.util.Map.Entry<K,V>, java.io.Serializable
Constructor and Description |
---|
MapEntry(K key,
V value)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> java.util.Map<K,V> |
addTo(java.util.Map<K,V> map,
MapEntry<? extends K,? extends V>... entries)
Add entries to a map.
|
static <K,V> MapEntry<K,V> |
entry(K key,
V value)
Construct a new instance.
|
boolean |
equals(MapEntry<?,?> obj)
Compare this entry with another.
|
boolean |
equals(java.lang.Object obj)
Compare this entry with another.
|
K |
getKey()
Get the map key.
|
V |
getValue()
Get the map value.
|
int |
hashCode()
Get the hash code of this object.
|
V |
setValue(V value)
Unsupported operation.
|
public static <K,V> MapEntry<K,V> entry(K key, V value)
K
- the key typeV
- the value typekey
- the map keyvalue
- the map valuepublic K getKey()
public V getValue()
public boolean equals(java.lang.Object obj)
public boolean equals(MapEntry<?,?> obj)
obj
- the other entrytrue
if this object equals the other MapEntry
instance, false
otherwisepublic int hashCode()
public static <K,V> java.util.Map<K,V> addTo(java.util.Map<K,V> map, MapEntry<? extends K,? extends V>... entries)
K
- the key typeV
- the value typemap
- the map to add toentries
- the entries to addCopyright © 2011 JBoss, a division of Red Hat, Inc.