Class Pair<L,​R>

java.lang.Object
com.ryandw11.structure.utils.Pair<L,​R>
Type Parameters:
L - The type of the left item.
R - The type of the right item.

public class Pair<L,​R> extends Object
A utility class to represent a Pair.
  • Constructor Details

    • Pair

      public Pair(L left, R right)
      Create a Pair.
      Parameters:
      left - The left value.
      right - The right value.
  • Method Details

    • getLeft

      public L getLeft()
      Get the left value.
      Returns:
      The left value.
    • getRight

      public R getRight()
      Get the right value.
      Returns:
      The right value.
    • of

      public static <L,​ R> Pair<L,​R> of(L left, R right)
      Quick way of creating a pair.
      Type Parameters:
      L - The left type.
      R - The right type.
      Parameters:
      left - The left value.
      right - The right value.
      Returns:
      A new pair.