Class Tuple<V1,V2>

java.lang.Object
org.opensearch.common.collect.Tuple<V1,V2>

public class Tuple<V1,V2> extends Object
Java 9 Tuple todo: deprecate and remove w/ min jdk upgrade to 11?
Opensearch.internal:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tuple(V1 v1, V2 v2)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the given object is also a tuple and the two tuples have equal v1() and v2() values.
    int
    Returns the hash code value for this Tuple.
    Returns a string representation of a Tuple
    static <V1, V2> Tuple<V1,V2>
    tuple(V1 v1, V2 v2)
     
    v1()
     
    v2()
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Tuple

      public Tuple(V1 v1, V2 v2)
  • Method Details

    • tuple

      public static <V1, V2> Tuple<V1,V2> tuple(V1 v1, V2 v2)
    • v1

      public V1 v1()
    • v2

      public V2 v2()
    • equals

      public boolean equals(Object o)
      Returns true if the given object is also a tuple and the two tuples have equal v1() and v2() values.

      Returns false otherwise, including for null values or objects of different types.

      Note: Tuple instances are equal if the underlying values are equal, even if the types are different.

      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare to
      Returns:
      true if the given object is also a tuple and the two tuples have equal v1() and v2() values.
    • hashCode

      public int hashCode()
      Returns the hash code value for this Tuple.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this Tuple.
    • toString

      public String toString()
      Returns a string representation of a Tuple
      Overrides:
      toString in class Object
      Returns:
      "Tuple [v1=value1, v2=value2]"