Package w.util.pair

Interface Pair<L,R>

All Superinterfaces:
Cloneable
All Known Subinterfaces:
MutablePair<L,R>, UnorderedPair<L,R>

public interface Pair<L,R> extends Cloneable
Иммутабельная пара значений.
Author:
whilein
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Pair<L,R>
    Склонировать пару.
    @NotNull Pair<L,R>
    Склонировать пару.
    boolean
    equals(@NotNull Pair<?,?> pair)
     
     
     
    static <L, R> @NotNull Pair<L,R>
    of(Map.Entry<L,R> entry)
     
    static <L, R> @NotNull Pair<L,R>
    of(L left, R right)
     
    <L1> @NotNull Pair<L1,R>
    withLeft(L1 newValue)
     
    <R1> @NotNull Pair<L,R1>
    withRight(R1 newValue)
     
  • Method Details

    • of

      @NotNull static <L, R> @NotNull Pair<L,R> of(L left, R right)
    • of

      @NotNull static <L, R> @NotNull Pair<L,R> of(@NotNull Map.Entry<L,R> entry)
    • equals

      boolean equals(@NotNull @NotNull Pair<?,?> pair)
    • getLeft

      L getLeft()
    • getRight

      R getRight()
    • withLeft

      @NotNull <L1> @NotNull Pair<L1,R> withLeft(L1 newValue)
    • withRight

      @NotNull <R1> @NotNull Pair<L,R1> withRight(R1 newValue)
    • clone

      @NotNull @NotNull Pair<L,R> clone()
      Склонировать пару.
      Returns:
      новая склонированая пара
    • deepClone

      @NotNull @NotNull Pair<L,R> deepClone()
      Склонировать пару.

      Также, в отличие от clone(), клонируется L и R, если они наследуют Cloneable.

      Returns:
      новая склонированая пара