Package icyllis.arc3d.core

# Class Pair<L,R>

java.lang.Object
icyllis.arc3d.core.Pair<L,R>

Type Parameters:
  `L` - the left element type
  `R` - the right element type

All Implemented Interfaces:
  `Map.Entry<L,R>`

public class Pair<L,R> extends Object implements Map.Entry<L,R>
Immutable pair of two elements by default.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Pair()`
  `Pair(L left, R right)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `final L`
  `getFirst()`
  `final L`
  `getKey()`
  `final L`
  `getLeft()`
  `final R`
  `getRight()`
  `final R`
  `getSecond()`
  `final R`
  `getValue()`
  `int`
  `hashCode()`
  Same as `Map.Entry.hashCode()`.
  `static <L, R> Pair<L,R>`
  `of(Map.Entry<L,R> entry)`
  `static <L, R> Pair<L,R>`
  `of(L left, R right)`
  `R`
  `setValue(R value)`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Pair

    public Pair()

  - ### Pair

    public Pair(L left, R right)

- ## Method Details

  - ### of

    @Nonnull public static <L, R> Pair<L,R> of(L left, R right)

  - ### of

    @Nonnull public static <L, R> Pair<L,R> of(Map.Entry<L,R> entry)

  - ### getKey

    public final L getKey()
    Specified by:
      `getKey` in interface `Map.Entry<L,R>`
    Returns:
      the key, may be null

  - ### getValue

    public final R getValue()
    Specified by:
      `getValue` in interface `Map.Entry<L,R>`
    Returns:
      the value, may be null

  - ### setValue

    public R setValue(R value)
    Specified by:
      `setValue` in interface `Map.Entry<L,R>`

  - ### getLeft

    public final L getLeft()
    Returns:
      the left element, may be null

  - ### getRight

    public final R getRight()
    Returns:
      the right element, may be null

  - ### getFirst

    public final L getFirst()
    Returns:
      the first element, may be null

  - ### getSecond

    public final R getSecond()
    Returns:
      the second element, may be null

  - ### hashCode

    public int hashCode()
    Same as `Map.Entry.hashCode()`.
    Specified by:
      `hashCode` in interface `Map.Entry<L,R>`
    Overrides:
      `hashCode` in class `Object`
    Returns:
      the hash code

  - ### equals

    public boolean equals(Object o)
    Specified by:
      `equals` in interface `Map.Entry<L,R>`
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of this object