Package org.dizitart.no2.common.tuples
Class Pair<A,B>
- java.lang.Object
-
- org.dizitart.no2.common.tuples.Pair<A,B>
-
- Type Parameters:
A
- the type of the first value in the pairB
- the type of the second value in the pair
- All Implemented Interfaces:
Serializable
public class Pair<A,B> extends Object implements Serializable
A simple generic class representing a pair of values.- Since:
- 4.0
- Author:
- Anindya Chatterjee.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
A
getFirst()
B
getSecond()
int
hashCode()
static <A,B>
Pair<A,B>pair(A first, B second)
Creates a new pair.void
setFirst(A first)
void
setSecond(B second)
String
toString()
-
-
-
Method Detail
-
pair
public static <A,B> Pair<A,B> pair(A first, B second)
Creates a new pair.- Type Parameters:
A
- the type parameterB
- the type parameter- Parameters:
first
- the firstsecond
- the second- Returns:
- the pair
-
getFirst
public A getFirst()
-
getSecond
public B getSecond()
-
setFirst
public void setFirst(A first)
-
setSecond
public void setSecond(B second)
-
-