F - Class of first objectS - Class of second objectpublic class Pair<F,S> extends Object implements Serializable
| Constructor and Description |
|---|
Pair(F first,
S second)
Construct a
Pair with the given values. |
| Modifier and Type | Method and Description |
|---|---|
static <F,S> Pair<F,S> |
create(F first,
S second)
Create a new
Pair where the types of the two objects are inferred from the types
of the arguments. |
boolean |
equals(Object other)
Compare this object to another for equality.
|
F |
getFirst()
Get the first object.
|
S |
getSecond()
Get the second object.
|
int |
hashCode()
Return the hash code for the
Pair. |
String |
toString()
Return the
String representation of the Pair. |
public F getFirst()
public S getSecond()
public String toString()
String representation of the Pair. The default representation
consists of the representations of the two objects, enclosed in parentheses and separated
by a comma.toString in class ObjectObject.toString()public int hashCode()
Pair. The default hash code is the exclusive OR of
the hash codes of the two objects.hashCode in class ObjectObject.hashCode()public boolean equals(Object other)
equals in class Objectother - the other objecttrue if the other object is non-null, is a Pair of compatible
objects, and those objects are equalObject.equals(Object)public static <F,S> Pair<F,S> create(F first, S second)
Pair where the types of the two objects are inferred from the types
of the arguments.F - Class of first objectS - Class of second objectfirst - the value for the first objectsecond - the value for the second objectPairCopyright © 2020. All rights reserved.