T1
- type of the triple's first component.T2
- type of the triple's second component.T3
- type of the triple's third component.public final class Triple<T1,T2,T3> extends AbstractPrintable implements Serializable
Note: this class should only be used for internal representations of tuples with value type semantics (e.g. equality, only if all components are equal).
Whenever a public interface returns an aggregation of individual objects, a separate class should be created/used that has meaningful identifiers for the individual components.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(@Nullable Object o) |
T1 |
getFirst() |
T2 |
getSecond() |
T3 |
getThird() |
int |
hashCode() |
static <T1,T2,T3> Triple<T1,T2,T3> |
of(T1 first,
T2 second,
T3 third)
Convenience function for creating a triple, allowing the user to omit the type parameters.
|
void |
print(Appendable a)
Outputs the current object.
|
toString
public static <T1,T2,T3> Triple<T1,T2,T3> of(T1 first, T2 second, T3 third)
public T1 getFirst()
public T2 getSecond()
public T3 getThird()
public void print(Appendable a) throws IOException
Printable
print
in interface Printable
a
- the appendable.IOException
- if an error occurs during appending.Copyright © 2020. All rights reserved.