Class Pair<T1 extends @Nullable Object,T2 extends @Nullable Object>

java.lang.Object
org.plumelib.util.Pair<T1,T2>
Type Parameters:
T1 - the type of the first element of the pair
T2 - the type of the second element of the pair

@Deprecated public class Pair<T1 extends @Nullable Object,T2 extends @Nullable Object> extends Object
Deprecated.
use MPair instead, or IPair for an immutable pair
Mutable pair class: type-safely holds two objects of possibly-different types. Defines toString(), equals(), and hashCode() routines. If you don't need these features, you are better off defining your own tiny class with meaningful field names.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Deprecated.
    The first element of the pair.
    Deprecated.
    The second element of the pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(T1 a, T2 b)
    Deprecated.
    Make a new pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(@GuardSatisfied @Nullable Object obj)
    Deprecated.
     
    int
    Deprecated.
     
    static <A extends @Nullable Object, B extends @Nullable Object>
    Pair<A,B>
    of(A a, B b)
    Deprecated.
    Factory method with short name and no need to name type parameters.
    Deprecated.
     

    Methods inherited from class java.lang.Object

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

    • a

      public T1 extends @Nullable Object a
      Deprecated.
      The first element of the pair.
    • b

      public T2 extends @Nullable Object b
      Deprecated.
      The second element of the pair.
  • Constructor Details

    • Pair

      public Pair(T1 a, T2 b)
      Deprecated.
      Make a new pair.
      Parameters:
      a - the first element of the pair
      b - the second element of the pair
  • Method Details

    • of

      public static <A extends @Nullable Object, B extends @Nullable Object> Pair<A,B> of(A a, B b)
      Deprecated.
      Factory method with short name and no need to name type parameters.
      Type Parameters:
      A - type of first argument
      B - type of second argument
      Parameters:
      a - first argument
      b - second argument
      Returns:
      a pair of the values (a, b)
    • toString

      @SideEffectFree public String toString(@GuardSatisfied Pair<T1 extends @Nullable Object,T2 extends @Nullable Object> this)
      Deprecated.
      Overrides:
      toString in class Object
    • equals

      @Pure public boolean equals(@GuardSatisfied Pair<T1 extends @Nullable Object,T2 extends @Nullable Object> this, @GuardSatisfied @Nullable Object obj)
      Deprecated.
      Overrides:
      equals in class Object
    • hashCode

      @Pure public int hashCode(@GuardSatisfied Pair<T1 extends @Nullable Object,T2 extends @Nullable Object> this)
      Deprecated.
      Overrides:
      hashCode in class Object