Package org.cyclos.utils
Class Pair<First,Second>
- java.lang.Object
-
- org.cyclos.utils.Pair<First,Second>
-
- All Implemented Interfaces:
Serializable
public class Pair<First,Second> extends Object implements Serializable
A pair of values- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <F,S>
Pair<F,S>create(F first, S second)Create a new pair with the given valuesstatic <F,S>
Pair<F,S>createOnlyFirst(F first)Create a new pair with the given first value and null as secondstatic <F,S>
Pair<F,S>createOnlySecond(S second)Create a new pair with null as first and the given second valuebooleanequals(Object obj)FirstgetFirst()SecondgetSecond()inthashCode()static <F,S>
Pair<F,S>ofNulls()Returns the pair <null, null>.voidsetFirst(First first)voidsetSecond(Second second)StringtoString()
-
-
-
Method Detail
-
create
public static <F,S> Pair<F,S> create(F first, S second)
Create a new pair with the given values
-
createOnlyFirst
public static <F,S> Pair<F,S> createOnlyFirst(F first)
Create a new pair with the given first value and null as second
-
createOnlySecond
public static <F,S> Pair<F,S> createOnlySecond(S second)
Create a new pair with null as first and the given second value
-
ofNulls
public static <F,S> Pair<F,S> ofNulls()
Returns the pair <null, null>.
-
getFirst
public First getFirst()
-
getSecond
public Second getSecond()
-
setFirst
public void setFirst(First first)
-
setSecond
public void setSecond(Second second)
-
-