T1 - type of the pair's first component.T2 - type of the pair's second component.public class Pair<T1,T2> extends AbstractPrintable implements Serializable
| Constructor and Description |
|---|
Pair(T1 first,
T2 second)
Constructs a pair with the given members.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
T1 |
getFirst()
Getter for the first member.
|
T2 |
getSecond()
Getter for the second member.
|
int |
hashCode() |
static <T1,T2> Pair<T1,T2> |
make(T1 first,
T2 second)
Convenience function for creating a pair, allowing the user to omit the type parameters.
|
void |
print(Appendable a)
Outputs the current object.
|
void |
setFirst(T1 first)
Setter for the first member.
|
void |
setSecond(T2 second)
Setter for the second member.
|
toString, toStringpublic static <T1,T2> Pair<T1,T2> make(T1 first, T2 second)
Pair(Object, Object)public T1 getFirst()
public void setFirst(T1 first)
first - the new value for the first member.public T2 getSecond()
public void setSecond(T2 second)
second - the new value for the second member.public void print(Appendable a) throws IOException
Printableprint in interface Printablea - the appendable.IOException - if an error occurs during appending.Copyright © 2018. All rights reserved.