K
- The key type for the TupleV
- The associated Value typepublic class Tuple<K,V> extends Object
Constructor and Description |
---|
Tuple()
Do nothing default that has a null key and null value.
|
Tuple(K key,
V value)
Creates a Tuple using a key and a value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
K |
getKey()
Gets the key for this Tuple.
|
V |
getValue()
Gets the value for this Tuple.
|
int |
hashCode() |
Tuple<K,V> |
setBoth(K key,
V value)
Sets both the key and the value for this Tuple in one call and returns
this Tuple object.
|
Tuple<K,V> |
setBoth(Tuple<K,V> tupleToCopy)
Sets both the key and the value for this Tuple in one call and returns
this Tuple object.
|
Tuple<K,V> |
setKey(K key)
Sets the key for this Tuple.
|
Tuple<K,V> |
setValue(V value)
Sets the value for this Tuple.
|
String |
toString() |
public Tuple()
public Tuple<K,V> setKey(K key)
key
- the new key to setpublic Tuple<K,V> setValue(V value)
value
- the new value to setpublic Tuple<K,V> setBoth(K key, V value)
key
- the new key to setvalue
- the new value to setpublic Tuple<K,V> setBoth(Tuple<K,V> tupleToCopy)
tupleToCopy
- the tuple to copyCopyright © 2003–2015 The Apache Software Foundation. All rights reserved.