Package org.plumelib.util
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 pairT2
- the type of the second element of the pair
@Deprecated
public class Pair<T1 extends @Nullable Object,T2 extends @Nullable Object>
extends Object
Deprecated.
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 Details
-
a
Deprecated.The first element of the pair. -
b
Deprecated.The second element of the pair.
-
-
Constructor Details
-
Pair
Deprecated.Make a new pair.- Parameters:
a
- the first element of the pairb
- the second element of the pair
-
-
Method Details
-
of
Deprecated.Factory method with short name and no need to name type parameters.- Type Parameters:
A
- type of first argumentB
- type of second argument- Parameters:
a
- first argumentb
- 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. -
equals
@Pure public boolean equals(@GuardSatisfied Pair<T1 extends @Nullable Object, T2 extends @Nullable Object> this, @GuardSatisfied @Nullable Object obj) Deprecated. -
hashCode
@Pure public int hashCode(@GuardSatisfied Pair<T1 extends @Nullable Object, T2 extends @Nullable Object> this) Deprecated.
-
MPair
instead, orIPair
for an immutable pair