Interface Pair<F,S>

Type Parameters:
F - type of the first value
S - type of the second value
All Known Subinterfaces:
MutablePair<F,S>
All Known Implementing Classes:
MutablePair.SimpleMutablePair, Pair.SimplePair

public interface Pair<F,S>
A container holding two values.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Simple implementation of Pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the first value.
    Gets the second value.
    static <F, S> @NotNull Pair<F,S>
    of(F first, S second)
    Creates a new pair of the given values.
  • Method Details

    • getFirst

      F getFirst()
      Gets the first value.
      Returns:
      the first value
    • getSecond

      S getSecond()
      Gets the second value.
      Returns:
      the second value
    • of

      @NotNull static <F, S> @NotNull Pair<F,S> of(F first, S second)
      Creates a new pair of the given values.
      Type Parameters:
      F - type of the first value of the pair
      S - type of the second value of the pair
      Parameters:
      first - first value of the pair
      second - second value of the pair
      Returns:
      created pair of the given values