public final class

Pair

extends Object
java.lang.Object
   ↳ com.atlassian.upm.api.util.Pair<A, B>

Class Overview

A tuple of size 2.

Summary

Public Methods
boolean equals(Object o)
A first()
static <A, B> Function<Entry<A, B>, Pair<A, B>> fromMapEntry()
Function for converting key-value pairs from a Map.
int hashCode()
static <A, B> Pair<A, B> pair(A first, B second)
Static factory method for creating pairs.
B second()
static <A, B> Function<Pair<A, B>, A> toFirst()
Function for converting a Pair to its first value.
static <A, B> Function<Pair<A, B>, B> toSecond()
Function for converting a Pair to its second value.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean equals (Object o)

public A first ()

Returns
  • the first value

public static Function<Entry<A, B>, Pair<A, B>> fromMapEntry ()

Function for converting key-value pairs from a Map.

public int hashCode ()

public static Pair<A, B> pair (A first, B second)

Static factory method for creating pairs.

Parameters
first the first value of the pair
second the second value of the pair
Returns
  • a new pair consisting of the first and second values

public B second ()

Returns
  • the second value

public static Function<Pair<A, B>, A> toFirst ()

Function for converting a Pair to its first value.

public static Function<Pair<A, B>, B> toSecond ()

Function for converting a Pair to its second value.

public String toString ()

Give us feedback

Was this documentation helpful?