Package org.jboss.msc.value
Class MapEntry<K,V>
- java.lang.Object
-
- org.jboss.msc.value.MapEntry<K,V>
-
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
java.io.Serializable,java.util.Map.Entry<K,V>
public final class MapEntry<K,V> extends java.lang.Object implements java.util.Map.Entry<K,V>, java.io.SerializableAn immutable key-value object for constructing map instances programmatically.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Kkeyprivate static longserialVersionUIDprivate Vvalue
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.booleanequals(java.lang.Object obj)Compare this entry with another.booleanequals(MapEntry<?,?> obj)Compare this entry with another.KgetKey()Get the map key.VgetValue()Get the map value.inthashCode()Get the hash code of this object.VsetValue(V value)Unsupported operation.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
key
private final K key
-
value
private final V value
-
-
Method Detail
-
entry
public static <K,V> MapEntry<K,V> entry(K key, V value)
Construct a new instance.- Type Parameters:
K- the key typeV- the value type- Parameters:
key- the map keyvalue- the map value- Returns:
- the entry
-
getKey
public K getKey()
Get the map key.
-
getValue
public V getValue()
Get the map value.
-
equals
public boolean equals(java.lang.Object obj)
Compare this entry with another.
-
equals
public boolean equals(MapEntry<?,?> obj)
Compare this entry with another.- Parameters:
obj- the other entry- Returns:
trueif this object equals the otherMapEntryinstance,falseotherwise
-
hashCode
public int hashCode()
Get the hash code of this object.
-
addTo
public 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.- Type Parameters:
K- the key typeV- the value type- Parameters:
map- the map to add toentries- the entries to add- Returns:
- the map
-
-