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
-
Method Summary
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>
-
Constructor Details
-
Tuple
public Tuple(V1 v1,
V2 v2)
-
Method Details
-
tuple
public static <V1,
V2> Tuple<V1,V2> tuple(V1 v1,
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
Returns a string representation of a Tuple
- Overrides:
toString in class Object
- Returns:
"Tuple [v1=value1, v2=value2]"