Class NameValuePairMapEntry<K,​V>

  • Type Parameters:
    K - The type of key contained in the map.
    V - The type of value contained in the map.
    All Implemented Interfaces:
    IDed<K>, Named<K>, Valued<V>, java.util.Map.Entry<K,​V>

    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 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 is null.
      • NameValuePairMapEntry

        public NameValuePairMapEntry​(java.util.Map.Entry<K,​V> mapEntry)
        Map entry copy constructor
        Parameters:
        mapEntry - The map entry the values of which to hold in the map entry.
        Throws:
        java.lang.NullPointerException - if the given map entry is null.
    • Method Detail

      • getKey

        public K getKey()
        Specified by:
        getKey in interface java.util.Map.Entry<K,​V>
      • setValue

        public V setValue​(V value)
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>
      • 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 interface java.util.Map.Entry<K,​V>
        Overrides:
        equals in class NameValuePair<K,​V>
        Parameters:
        o - The object with which to compare this name/value pair.
        Returns:
        true if this name/value pair equals that specified in object.
        See Also:
        DefaultNamed.getName(), NameValuePair.getValue()