Pair - apache/ctakes GitHub Wiki

@Immutable final public class Pair<T>

Why oh why is there not a simple immutable class representing a pair of values in the jdk ?

  • Author: SPF , chip-nlp
  • Version: %I%
  • Since: 7/22/2016

public Pair( @Nonnull final T value1, @Nonnull final T value2 )

  • Parameters:
    • value1 not null
    • value2 not null

public T getValue1()

  • Returns: the first value in the Pair

public T getValue2()

  • Returns: the second value in the Pair

@Override public String toString()

  • Returns: the first value as a String followed by a comma followed by the second value as a String.

@Override public boolean equals( final Object other )

  • Parameters:
    • other -
  • Returns: true iff the other object is a Pair and its values equal this Pair's values
⚠️ **GitHub.com Fallback** ⚠️