Class Pair<O1,O2>

java.lang.Object
com._1c.g5.v8.dt.common.Pair<O1,O2>

public class Pair<O1,O2> extends Object
A pair of values.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final O1
    The first element in the pair.
    final O2
    The second element in the pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(O1 first, O2 second)
    Construct a Pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Gets first element of this pair.
    Gets second element of this pair.
    int
     
    static <T1, T2> Pair<T1,T2>
    newPair(T1 o1, T2 o2)
    A factory method to create instance of Pair.
     

    Methods inherited from class java.lang.Object

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

    • first

      public final O1 first
      The first element in the pair.
    • second

      public final O2 second
      The second element in the pair.
  • Constructor Details

    • Pair

      public Pair(O1 first, O2 second)
      Construct a Pair.
      Parameters:
      a - The first element in the pair.
      b - The second element in the pair.
  • Method Details

    • newPair

      public static <T1, T2> Pair<T1,T2> newPair(T1 o1, T2 o2)
      A factory method to create instance of Pair.
      Parameters:
      o1 - - the first element in the pair
      o2 - - the second element in the pair
      Returns:
      a instance of this class
    • getFirst

      public O1 getFirst()
      Gets first element of this pair.
      Returns:
      First element of the pair.
    • getSecond

      public O2 getSecond()
      Gets second element of this pair.
      Returns:
      Second element of the pair.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object