Class Pair<L,R>

java.lang.Object
com.nimbusds.jose.util.Pair<L,R>
Type Parameters:
L - the left object type.
R - the right object type

@Immutable public class Pair<L,R> extends Object
A pair of two objects.

This class is immutable.

Version:
2021-09-30
Author:
Alexander Martynov
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Pair(L left, R right)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the left object of this pair.
    Returns the right object of this pair.
    static <L, R> Pair<L,R>
    of(L left, R right)
    Creates a new pair of two objects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pair

      protected Pair(L left, R right)
  • Method Details

    • of

      public static <L, R> Pair<L,R> of(L left, R right)
      Creates a new pair of two objects.
      Parameters:
      left - The left object, null if not specified.
      right - The right object, null if not specified.
      Returns:
      The pair.
    • getLeft

      public L getLeft()
      Returns the left object of this pair.
      Returns:
      The left object, null if not specified.
    • getRight

      public R getRight()
      Returns the right object of this pair.
      Returns:
      The right object, null if not specified.