Package com.atlassian.jira.util.lang
Class Pair<F,S>
java.lang.Object
com.atlassian.jira.util.lang.Pair<F,S>
- Type Parameters:
F
- type of the first elementS
- type of the second element
Immutable, generic pair of values.
How coool is that!
- Since:
- v4.2
-
Method Summary
Modifier and TypeMethodDescriptionboolean
first()
int
hashCode()
static <U,
V> Pair<U, V> nicePairOf
(U first, V second) A pair that does allowsnull
values.static <U,
V> Pair<U, V> of
(U first, V second) By default we create a strict pair of non-null values.second()
static <U,
V> Pair<U, V> strictPairOf
(U first, V second) A pair that doesn't allownull
values.toString()
-
Method Details
-
of
By default we create a strict pair of non-null values.- Type Parameters:
U
- type of first valueV
- type of second value- Parameters:
first
- first valuesecond
- second value- Returns:
- new pair
- See Also:
-
strictPairOf
A pair that doesn't allownull
values.- Type Parameters:
U
- type of first valueV
- type of second value- Parameters:
first
- first value, may not benull
second
- second value, may not benull
- Returns:
- new strict pair
-
nicePairOf
A pair that does allowsnull
values.- Type Parameters:
U
- type of first valueV
- type of second value- Parameters:
first
- first value, may benull
second
- second value, may benull
- Returns:
- new nice pair
-
first
-
second
-
hashCode
public int hashCode() -
equals
-
toString
-