Package org.atlanmod.commons.tuple
Class Pair<L,R>
- java.lang.Object
-
- org.atlanmod.commons.tuple.Pair<L,R>
-
- Type Parameters:
L- the Generic Type of the left element of this PairR- the Generic Type of right element of this Pair
- All Implemented Interfaces:
Serializable
@ParametersAreNonnullByDefault public class Pair<L,R> extends Object implements Serializable
A simple, immutable Tuple with 2 elements: left and right.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()static <L,R>
Pair<L,R>of(L left, R right)Creates a new Pair with values left and rightPair<R,L>swap()Creates a new Pair by swapping the elements left and right
-
-
-
Method Detail
-
of
@Nonnull public static <L,R> Pair<L,R> of(L left, R right)
Creates a new Pair with values left and right- Type Parameters:
L- the Class of the left valueR- the Class of the right value- Parameters:
left- the left valueright- the right value- Returns:
- a new Pair
-
-