Package org.eclipse.hono.util
Class Pair<A,B>
- java.lang.Object
-
- org.eclipse.hono.util.Pair<A,B>
-
- Type Parameters:
A
- The type of the first value.B
- The type of the second value.
public final class Pair<A,B> extends Object
A pair of two values of arbitrary type.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
static <A,B>
Pair<A,B>of(A one, B two)
Creates a new pair for two values of arbitrary type.A
one()
String
toString()
B
two()
-
-
-
Method Detail
-
of
public static <A,B> Pair<A,B> of(A one, B two)
Creates a new pair for two values of arbitrary type.- Type Parameters:
A
- The type of the first value.B
- The type of the second value.- Parameters:
one
- First value.two
- Second value.- Returns:
- The pair.
- Throws:
IllegalArgumentException
- if all values arenull
.
-
one
public A one()
- Returns:
- The one.
-
two
public B two()
- Returns:
- The two.
-
-