Class Triple<T1,T2,T3>
java.lang.Object
dk.cloudcreate.essentials.shared.functional.tuple.Triple<T1,T2,T3>
- Type Parameters:
T1- the first element typeT2- the second element typeT3- the third element type
- All Implemented Interfaces:
Tuple<Triple<T1,,T2, T3>> Serializable
Represents a
Note:
Tuple with three elements.Note:
Triple supports equals(Object) comparison using subclasses, e.g.:
public class LeftMiddleAndRightSide extends Triple<String, String, String> {
public LeftMiddleAndRightSide(String leftSide, String middle, String rightSide) {
super(leftSide, middle, rightSide);
}
}
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_1()The first element in this tuple_2()The second element in this tuple_3()The third element in this tupleintarity()Number of arguments/elements in the TuplebooleaninthashCode()<R1,R2, R3> Triple<R1, R2, R3> Maps the elements of thisTripleusing the mapping function<R1,R2, R3> Triple<R1, R2, R3> map(Function<? super T1, ? super R1> mappingFunction1, Function<? super T2, ? super R2> mappingFunction2, Function<? super T3, ? super R3> mappingFunction3) Maps the elements of thisTripleusing three distinct mapping functionsMap the first element of thisTripleusing the mapping functionMap the second element of thisTripleusing the mapping functionMap the third element of thisTripleusing the mapping functionList<?>toList()Convert the Tuple to a listtoString()
-
Field Details
-
_1
The first element in this tuple -
_2
The second element in this tuple -
_3
The third element in this tuple
-
-
Constructor Details
-
Triple
Construct a newTuplewith 3 elements- Parameters:
t1- the first elementt2- the second elementt3- the third element
-
-
Method Details
-
arity
public int arity()Description copied from interface:TupleNumber of arguments/elements in the Tuple -
toList
Description copied from interface:TupleConvert the Tuple to a list -
_1
The first element in this tuple- Returns:
- The first element in this tuple
-
_2
The second element in this tuple- Returns:
- The second element in this tuple
-
_3
The third element in this tuple- Returns:
- The third element in this tuple
-
map
public <R1,R2, Triple<R1,R3> R2, mapR3> (Function<? super T1, ? super R1> mappingFunction1, Function<? super T2, ? super R2> mappingFunction2, Function<? super T3, ? super R3> mappingFunction3) Maps the elements of thisTripleusing three distinct mapping functions- Type Parameters:
R1- result type for first element of theTripleafter applying the mapping functionR2- result type for second element of theTripleafter applying the mapping functionR3- result type for third element of theTripleafter applying the mapping function- Parameters:
mappingFunction1- the mapping function for element number 1mappingFunction2- the mapping function for element number 2mappingFunction3- the mapping function for element number 3- Returns:
- a new
Triplewith the result of applying the mapping function to thisTriple
-
map1
Map the first element of thisTripleusing the mapping function -
map2
Map the second element of thisTripleusing the mapping function -
map3
Map the third element of thisTripleusing the mapping function -
equals
-
hashCode
public int hashCode() -
toString
-