Class NameValuePair<N,​V>

    • Constructor Summary

      Constructors 
      Constructor Description
      NameValuePair​(N newName, V newValue)
      Constructor specifying the name and value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)
      Determines if the given object is another name value pair with the same name and value.
      static <MEK,​MEV>
      NameValuePair<MEK,​MEV>
      fromMapEntry​(java.util.Map.Entry<MEK,​MEV> mapEntry)
      Static factory method to create a name-value pair from a map entry copy.
      N getID()  
      V getValue()  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NameValuePair

        public NameValuePair​(N newName,
                             V newValue)
        Constructor specifying the name and value.
        Parameters:
        newName - The object's new name.
        newValue - The object's new value
    • Method Detail

      • getValue

        public V getValue()
        Specified by:
        getValue in interface Valued<N>
        Returns:
        The value of the object.
      • getID

        public N getID()
        Specified by:
        getID in interface IDed<N>
        Returns:
        The name of the name-value pair, allowing identification.
      • fromMapEntry

        public static <MEK,​MEV> NameValuePair<MEK,​MEV> fromMapEntry​(@Nonnull
                                                                                java.util.Map.Entry<MEK,​MEV> mapEntry)
        Static factory method to create a name-value pair from a map entry copy.
        Type Parameters:
        MEK - The type of map entry key.
        MEV - The type of map entry value.
        Parameters:
        mapEntry - The map entry the values of which to use in creating this name/value pair.
        Returns:
        A name-value pair from the map entry.
        Throws:
        java.lang.NullPointerException - if the given map entry is null.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class DefaultNamed<N>
        Returns:
        A hashcode value composed from the name.
      • equals

        public boolean equals​(java.lang.Object object)
        Determines if the given object is another name value pair with the same name and value.
        Overrides:
        equals in class DefaultNamed<N>
        Parameters:
        object - 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(), getValue()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class DefaultNamed<N>
        Returns:
        A string representation of this object in the format "name=\"value\"".