Package com.globalmentor.collections
Class NameValuePairMapEntry<K,V>
- java.lang.Object
-
- com.globalmentor.model.DefaultNamed<N>
-
- com.globalmentor.model.NameValuePair<K,V>
-
- com.globalmentor.collections.NameValuePairMapEntry<K,V>
-
- Type Parameters:
K
- The type of key contained in the map.V
- The type of value contained in the map.
public class NameValuePairMapEntry<K,V> extends NameValuePair<K,V> implements java.util.Map.Entry<K,V>
A read-only map entry that is also a name/value pair.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description NameValuePairMapEntry(NameValuePair<K,V> nameValuePair)
Name/value pair copy constructorNameValuePairMapEntry(java.util.Map.Entry<K,V> mapEntry)
Map entry copy constructorNameValuePairMapEntry(K name, V value)
Constructor specifying the name and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Determines if the given object is another name value pair with the same name and value.K
getKey()
V
setValue(V value)
-
Methods inherited from class com.globalmentor.model.NameValuePair
fromMapEntry, getID, getValue, hashCode, toString
-
Methods inherited from class com.globalmentor.model.DefaultNamed
getName
-
-
-
-
Constructor Detail
-
NameValuePairMapEntry
public NameValuePairMapEntry(K name, V value)
Constructor specifying the name and value.- Parameters:
name
- The object's new name.value
- The object's new value
-
NameValuePairMapEntry
public NameValuePairMapEntry(NameValuePair<K,V> nameValuePair)
Name/value pair copy constructor- Parameters:
nameValuePair
- The name/value pair the values of which to hold in the map entry.- Throws:
java.lang.NullPointerException
- if the given name/value pair isnull
.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
Determines if the given object is another name value pair with the same name and value.- Specified by:
equals
in interfacejava.util.Map.Entry<K,V>
- Overrides:
equals
in classNameValuePair<K,V>
- Parameters:
o
- The object with which to compare this name/value pair.- Returns:
true
if this name/value pair equals that specified inobject
.- See Also:
DefaultNamed.getName()
,NameValuePair.getValue()
-
-