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 TypeMethodDescriptionbooleanfirst()inthashCode()static <U,V> Pair <U, V> nicePairOf(U first, V second) A pair that does allowsnullvalues.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 allownullvalues.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 allownullvalues.- Type Parameters:
U- type of first valueV- type of second value- Parameters:
first- first value, may not benullsecond- second value, may not benull- Returns:
- new strict pair
-
nicePairOf
A pair that does allowsnullvalues.- Type Parameters:
U- type of first valueV- type of second value- Parameters:
first- first value, may benullsecond- second value, may benull- Returns:
- new nice pair
-
first
-
second
-
hashCode
public int hashCode() -
equals
-
toString
-