Class Triple<T1,T2,T3>
java.lang.Object
com.saperion.common.lang.encapsulation.Triple<T1,T2,T3>
- Type Parameters:
T1- type of first objectT2- type of second objectT3- type of third object
- All Implemented Interfaces:
Serializable
A simple immutable encapsulation for 3 objects.
An instance of this Pair can be used in several threads concurrently.
- Author:
- agz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal T1getFirst()Returns the first object.final T2Returns the second object.final T3getThird()Returns the third object.inthashCode()static <T1,T2, T3> Triple<T1, T2, T3> newInstance(T1 first, T2 second, T3 third) Convenience factory method for letting the compiler do the type inference.toString()
-
Constructor Details
-
Triple
Creates a newTriplewith the specified objects. All objects may benull.- Parameters:
first- first objectsecond- second objectthird- third object
-
-
Method Details
-
getFirst
Returns the first object.- Returns:
- first object
-
getSecond
Returns the second object.- Returns:
- second object
-
getThird
Returns the third object.- Returns:
- third object
-
equals
-
hashCode
public int hashCode() -
toString
-
newInstance
Convenience factory method for letting the compiler do the type inference.- Parameters:
first- The first object in the triplesecond- The second object in the triplethird- The third object in the triple- Returns:
- A triple consisting of the given objects
-