Class KeyValuePair

  • All Implemented Interfaces:
    NameValuePair, java.io.Serializable

    public class KeyValuePair
    extends java.lang.Object
    implements NameValuePair
    A key value pair.

    Primarily used in configuration to avoid the use of maps.

    See Also:
    Serialized Form

    In the adapter configuration file this class is aliased as key-value-pair which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Summary

      Constructors 
      Constructor Description
      KeyValuePair()  
      KeyValuePair​(java.lang.String key, java.lang.String value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      KeyValuePairs are semantically equally if their keys only are equal.
      java.lang.String getKey()  
      java.lang.String getValue()  
      int hashCode()  
      void setKey​(java.lang.String key)
      Sets the 'key'.
      void setValue​(java.lang.String value)
      Sets the 'value'.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • KeyValuePair

        public KeyValuePair()
      • KeyValuePair

        public KeyValuePair​(java.lang.String key,
                            java.lang.String value)
    • Method Detail

      • setKey

        public void setKey​(java.lang.String key)

        Sets the 'key'.

        Specified by:
        setKey in interface NameValuePair
        Parameters:
        key - may not be null.
      • setValue

        public void setValue​(java.lang.String value)

        Sets the 'value'.

        Specified by:
        setValue in interface NameValuePair
        Parameters:
        value - may not be null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)

        KeyValuePairs are semantically equally if their keys only are equal.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the Object to test
        Returns:
        true if obj is semantically equal
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object