public class KeyValue
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
A key value pair.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
key
The unique identifier of a key value pair.
|
private java.lang.String |
value
The value part of the identified key.
|
Constructor and Description |
---|
KeyValue()
Default constructor for KeyValue object.
|
KeyValue(java.lang.String key,
java.lang.String value)
Constructs a new KeyValue object.
|
Modifier and Type | Method and Description |
---|---|
KeyValue |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getKey()
The unique identifier of a key value pair.
|
java.lang.String |
getValue()
The value part of the identified key.
|
int |
hashCode() |
void |
setKey(java.lang.String key)
The unique identifier of a key value pair.
|
void |
setValue(java.lang.String value)
The value part of the identified key.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
KeyValue |
withKey(java.lang.String key)
The unique identifier of a key value pair.
|
KeyValue |
withValue(java.lang.String value)
The value part of the identified key.
|
private java.lang.String key
The unique identifier of a key value pair.
private java.lang.String value
The value part of the identified key.
public KeyValue()
public KeyValue(java.lang.String key, java.lang.String value)
key
- The unique identifier of a key value pair.value
- The value part of the identified key.public void setKey(java.lang.String key)
The unique identifier of a key value pair.
key
- The unique identifier of a key value pair.public java.lang.String getKey()
The unique identifier of a key value pair.
public KeyValue withKey(java.lang.String key)
The unique identifier of a key value pair.
key
- The unique identifier of a key value pair.public void setValue(java.lang.String value)
The value part of the identified key.
value
- The value part of the identified key.public java.lang.String getValue()
The value part of the identified key.
public KeyValue withValue(java.lang.String value)
The value part of the identified key.
value
- The value part of the identified key.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public KeyValue clone()
clone
in class java.lang.Object