Class KeyValuePair

java.lang.Object
net.solarnetwork.domain.KeyValuePair
All Implemented Interfaces:
Serializable, Comparable<KeyValuePair>

public class KeyValuePair extends Object implements Serializable, Comparable<KeyValuePair>
A mutable key and value pair.
Since:
1.43
Version:
1.0
Author:
matt
See Also:
  • Constructor Details

    • KeyValuePair

      public KeyValuePair()
      Default constructor.
    • KeyValuePair

      public KeyValuePair(String key, String value)
      Construct with values.
      Parameters:
      key - the key
      value - the value
  • Method Details

    • compareTo

      public int compareTo(KeyValuePair o)
      Compare the key values of two KeyValuePair objects, falling back to value if key is null in both objects.
      Specified by:
      compareTo in interface Comparable<KeyValuePair>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Compare the key values of two KeyValuePair objects.
      Overrides:
      equals in class Object
    • getKey

      public String getKey()
      Get the key.
      Returns:
      the key
    • setKey

      public void setKey(String key)
      Set the key.
      Parameters:
      key - the key to set
    • getValue

      public String getValue()
      Get the value.
      Returns:
      the value
    • setValue

      public void setValue(String value)
      Set the value.
      Parameters:
      value - the value to set