org.entityfs.support.util
Class TwoObjects<T,U>

java.lang.Object
  extended by org.entityfs.support.util.TwoObjects<T,U>
Direct Known Subclasses:
Pair

public class TwoObjects<T,U>
extends Object

This immutable value object contains two objects that may be of different types.

This object should probably have been named Tuple2 instead.

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
TwoObjects(T first, U second)
          Constructor.
 
Method Summary
 boolean equals(Object o)
           
 T getFirst()
          Get the first object.
 U getSecond()
          Get the second object.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwoObjects

public TwoObjects(T first,
                  U second)
Constructor.

Parameters:
first - The first object. This may be null.
second - The second object. This may be null.
Method Detail

getFirst

public T getFirst()
Get the first object.

Returns:
The first object.

getSecond

public U getSecond()
Get the second object.

Returns:
The second object.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object