com.netflix.util
Class Pair<E1,E2>

java.lang.Object
  extended by com.netflix.util.Pair<E1,E2>
All Implemented Interfaces:
java.io.Serializable

public class Pair<E1,E2>
extends java.lang.Object
implements java.io.Serializable

A simple class that holds a pair of values. This may be useful for methods that care to return two values (instead of just one).

See Also:
Serialized Form

Constructor Summary
Pair(E1 first, E2 second)
          Construct a new pair
 
Method Summary
 boolean equals(java.lang.Object obj)
          Pair objects are equal iff they have the same content.
 E1 first()
          Get the first value from the pair.
 int hashCode()
           
 E2 second()
          Get the second value from the pair.
 void setFirst(E1 first)
          Set the first value of the pair.
 void setSecond(E2 second)
          Set the second value of the pair.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(E1 first,
            E2 second)
Construct a new pair

Parameters:
first - the object to store as the first value
second - the object to store as the second value
Method Detail

first

public E1 first()
Get the first value from the pair.

Returns:
the first value

second

public E2 second()
Get the second value from the pair.

Returns:
the second value

setFirst

public void setFirst(E1 first)
Set the first value of the pair.

Parameters:
first - the new first value

setSecond

public void setSecond(E2 second)
Set the second value of the pair.

Parameters:
second - the new second value

equals

public boolean equals(java.lang.Object obj)
Pair objects are equal iff they have the same content.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object