public class MapEntry<K,V>
extends java.lang.Object
implements java.util.Map.Entry, java.io.Serializable
Map.Entry,
Serialized Form| Constructor and Description |
|---|
MapEntry()
Default Constructor for MapEntry.
|
MapEntry(K key)
Constructor for MapEntry.
|
MapEntry(K key,
V value)
Constructor for MapEntry.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B> java.util.Map<A,B> |
createMap(java.util.List<? extends MapEntry<A,B>> list)
static method to create a normal Map from a list of MapEntry(s)
|
boolean |
equals(java.lang.Object obj)
Compares this EntryImpl to another object to see if they are equal
The following rules apply:
If comparing a EntryImpl equals returns true if they have the same key
If comparing a Object equals returns true if the Object equals the key
In all other cases false is returned.
|
K |
getKey() |
V |
getValue() |
int |
hashCode() |
K |
setKey(K key)
sets the Key
|
V |
setValue(java.lang.Object value) |
public MapEntry()
public MapEntry(K key)
Initializes the MapEntry with key. use setValue to set the value
key - Objectpublic static final <A,B> java.util.Map<A,B> createMap(java.util.List<? extends MapEntry<A,B>> list)
A - Object type of KeyB - Object type of Valuelist - List of MapEntry items with key A and value Bpublic K getKey()
getKey in interface java.util.Map.EntryMap.Entry.getKey()public V getValue()
getValue in interface java.util.Map.EntryMap.Entry.getValue()public V setValue(java.lang.Object value)
setValue in interface java.util.Map.EntrysetValue(Object)public K setKey(K key)
Prefered method is using the Constructor to initialize the object with at least the key instead of setting or updating the key here.
key - Stringpublic boolean equals(java.lang.Object obj)
equals in interface java.util.Map.Entryequals in class java.lang.ObjectObject.equals(Object)public int hashCode()
hashCode in interface java.util.Map.EntryhashCode in class java.lang.Object