nl.lxtreme.ols.util
Class Pair<T,V>

java.lang.Object
  extended by nl.lxtreme.ols.util.Pair<T,V>

public final class Pair<T,V>
extends Object

Denotes a pair of things with possible different types.


Constructor Summary
Pair(T aLeft, V aRight)
          Creates a new Pair instance.
 
Method Summary
 boolean equals(Object aObject)
          
 T getLeft()
           
 V getRight()
           
 int hashCode()
          
static
<T,V> Pair<T,V>
of(T aLeft, V aRight)
          Factory method to create a new pair of two given values.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(T aLeft,
            V aRight)
Creates a new Pair instance.

Parameters:
aLeft - the left-hand side of this pair;
aRight - the right-hand side of this pair.
Method Detail

of

public static <T,V> Pair<T,V> of(T aLeft,
                                 V aRight)
Factory method to create a new pair of two given values.

Parameters:
aLeft - the left-hand side of the pair;
aRight - the right-hand side of the pair.
Returns:
a new pair instance, never null.

equals

public boolean equals(Object aObject)

Overrides:
equals in class Object

getLeft

public T getLeft()
Returns:
the left-hand side, can be null.

getRight

public V getRight()
Returns:
the right-hand side, can be null.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.