@ThreadSafe public final class

Pair

extends Object
java.lang.Object
   ↳ com.atlassian.jira.util.lang.Pair<F, S>

Class Overview

Immutable, generic pair of values. How coool is that!

Summary

Public Methods
boolean equals(Object o)
F first()
int hashCode()
static <U, V> Pair<U, V> nicePairOf(U first, V second)
A pair that does allows null values.
static <U, V> Pair<U, V> of(U first, V second)
By default we create a strict pair of non-null values.
S second()
static <U, V> Pair<U, V> strictPairOf(U first, V second)
A pair that doesn't allow null values.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean equals (Object o)

public F first ()

public int hashCode ()

public static Pair<U, V> nicePairOf (U first, V second)

A pair that does allows null values.

Parameters
first first value, may be null
second second value, may be null
Returns
  • new nice pair

public static Pair<U, V> of (U first, V second)

By default we create a strict pair of non-null values.

Parameters
first first value
second second value
Returns
  • new pair

public S second ()

public static Pair<U, V> strictPairOf (U first, V second)

A pair that doesn't allow null values.

Parameters
first first value, may not be null
second second value, may not be null
Returns
  • new strict pair

public String toString ()