Package com.graphaware.common.util
Class Pair<FIRST,SECOND>
- java.lang.Object
-
- com.graphaware.common.util.Pair<FIRST,SECOND>
-
- Type Parameters:
FIRST
- type of the first object in the pair.SECOND
- type of the second object in the pair.
- Direct Known Subclasses:
SameTypePair
public class Pair<FIRST,SECOND> extends Object
An immutable pair of objects.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
FIRST
first()
Return the first element of the pair.int
hashCode()
static <FIRST,SECOND>
Pair<FIRST,SECOND>of(FIRST first, SECOND second)
SECOND
second()
Return the second element of the pair.String
toString()
-
-
-
Method Detail
-
of
public static <FIRST,SECOND> Pair<FIRST,SECOND> of(FIRST first, SECOND second)
-
first
public FIRST first()
Return the first element of the pair.- Returns:
- first element, can be null.
-
second
public SECOND second()
Return the second element of the pair.- Returns:
- second element, can be null.
-
-