org.gcube.informationsystem.glitebridge.util
Class KeyValueCouple<K,V>

java.lang.Object
  extended by org.gcube.informationsystem.glitebridge.util.KeyValueCouple<K,V>
Type Parameters:
K - Type of Key
V - Type of Value

public class KeyValueCouple<K,V>
extends java.lang.Object

Author:
Luca Frosini (ISTI-CNR) This class can be used when we need a Key-Value pair. Normally used as Object of a List when a Map cannot be used because the key can be duplicated.

Constructor Summary
KeyValueCouple(K key, V value)
           
 
Method Summary
 K getKey()
           
 V getValue()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyValueCouple

public KeyValueCouple(K key,
                      V value)
               throws java.lang.IllegalArgumentException
Parameters:
key - the key. It cannot be null.
value - the value requested for the key. It cannot be null.
Throws:
java.lang.IllegalArgumentException - if a null parameter is passed to constructor.
Method Detail

getKey

public K getKey()
Returns:
the key

getValue

public V getValue()
Returns:
the value requested for the key

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the String representation of the Object in the format KEY=VALUE The method toString is used for KEY and VALUE representation