|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.tuple.KeyValue<K,V>
public class KeyValue<K,V>
Two arguments Tuple supporting hashCode(), equals(Object) and toString() using the values of
the given elements.
Tuple2,
Serialized Form| Field Summary | |
|---|---|
protected K |
key
|
protected V |
value
|
| Constructor Summary | |
|---|---|
KeyValue()
|
|
KeyValue(KeyValue<K,V> keyValue)
Creates a new KeyValue instance based on the values of an already existing instance |
|
KeyValue(K key,
V value)
|
|
| Method Summary | |
|---|---|
Map<K,V> |
asMap()
Returns a Map containing an entry based on this KeyValue |
boolean |
equals(Object obj)
|
K |
getKey()
Returns the key |
V |
getValue()
Returns the value |
int |
hashCode()
|
KeyValue<V,K> |
newInvertedInstance()
Returns a new KeyValue instance with inverted first and second value |
void |
setKey(K key)
Sets the key |
void |
setValue(V value)
Sets the value |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected K key
protected V value
| Constructor Detail |
|---|
public KeyValue()
KeyValue
public KeyValue(K key,
V value)
key - value - KeyValuepublic KeyValue(KeyValue<K,V> keyValue)
KeyValue instance based on the values of an already existing instance
keyValue - KeyValue| Method Detail |
|---|
public KeyValue<V,K> newInvertedInstance()
KeyValue instance with inverted first and second value
KeyValuepublic K getKey()
public void setKey(K key)
key - public V getValue()
public void setValue(V value)
value - public Map<K,V> asMap()
Map containing an entry based on this KeyValue
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||