Package net.solarnetwork.domain
Class KeyValuePair
java.lang.Object
net.solarnetwork.domain.KeyValuePair
- All Implemented Interfaces:
Serializable,Comparable<KeyValuePair>
A mutable key and value pair.
- Since:
- 1.43
- Version:
- 1.0
- Author:
- matt
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.KeyValuePair(String key, String value) Construct with values. -
Method Summary
Modifier and TypeMethodDescriptionintCompare thekeyvalues of two KeyValuePair objects, falling back tovalueifkeyis null in both objects.booleanCompare thekeyvalues of twoKeyValuePairobjects.getKey()Get the key.getValue()Get the value.inthashCode()voidSet the key.voidSet the value.toString()
-
Constructor Details
-
KeyValuePair
public KeyValuePair()Default constructor. -
KeyValuePair
Construct with values.- Parameters:
key- the keyvalue- the value
-
-
Method Details
-
compareTo
Compare thekeyvalues of two KeyValuePair objects, falling back tovalueifkeyis null in both objects.- Specified by:
compareToin interfaceComparable<KeyValuePair>
-
toString
-
hashCode
public int hashCode() -
equals
Compare thekeyvalues of twoKeyValuePairobjects. -
getKey
Get the key.- Returns:
- the key
-
setKey
Set the key.- Parameters:
key- the key to set
-
getValue
Get the value.- Returns:
- the value
-
setValue
Set the value.- Parameters:
value- the value to set
-