org.apache.commons.lang3
Class Pair<L,R>

java.lang.Object
  extended by org.apache.commons.lang3.Pair<L,R>
All Implemented Interfaces:
Serializable

public final class Pair<L,R>
extends Object
implements Serializable

A basic immutable Object pair.

#ThreadSafe# if the objects are threadsafe

Since:
Lang 3.0
Version:
$Id: Pair.java 967237 2010-07-23 20:08:57Z mbenson $
Author:
Matt Benson
See Also:
Serialized Form

Field Summary
 L left
          Left object
 R right
          Right object
 
Constructor Summary
Pair(L left, R right)
          Create a new Pair instance.
 
Method Summary
 boolean equals(Object obj)
          
 int hashCode()
          
static
<L,R> Pair<L,R>
of(L left, R right)
          Static creation method for a Pair.
 String toString()
          Returns a String representation of the Pair in the form: (L,R)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

left

public final L left
Left object


right

public final R right
Right object

Constructor Detail

Pair

public Pair(L left,
            R right)
Create a new Pair instance.

Parameters:
left -
right -
Method Detail

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()
Returns a String representation of the Pair in the form: (L,R)

Overrides:
toString in class Object

of

public static <L,R> Pair<L,R> of(L left,
                                 R right)
Static creation method for a Pair.

Type Parameters:
L -
R -
Parameters:
left -
right -
Returns:
Pair(left, right)


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.