Package no.digipost.tuple
Interface Hextuple<T1,T2,T3,T4,T5,T6>
- Type Parameters:
T1- The type of the first valueT2- The type of the second valueT3- The type of the third valueT4- The type of the fourth valueT5- The type of the fifth valueT6- The type of the sixth value
- All Superinterfaces:
ViewableAsHextuple<T1,T2, T3, T4, T5, T6>
A hextuple is a simple composition of six arbitrary values (objects). A hextuple
captures no semantics of the six values, and they are only referred to as
"the first", "the second", "the third", "the fourth", "the fifth", and "the sixth" value.
-
Method Summary
Modifier and TypeMethodDescriptionfifth()first()static <T1,T2, T3, T4, T5, T6>
Hextuple<T1,T2, T3, T4, T5, T6> fourth()<S1,S2, S3, S4, S5, S6>
Hextuple<S1,S2, S3, S4, S5, S6> map(Function<? super T1, ? extends S1> firstMapper, Function<? super T2, ? extends S2> secondMapper, Function<? super T3, ? extends S3> thirdMapper, Function<? super T4, ? extends S4> fourthMapper, Function<? super T5, ? extends S5> fifthMapper, Function<? super T6, ? extends S6> sixthMapper) Create a new hextuple by applying a function to each element, and putting the results into a new hextuple.Create a new hextuple by applying a function to the fifth element, and putting the result as the fifth element of the new hextuple.Create a new hextuple by applying a function to the first element, and putting the result as the first element of the new hextuple.Create a new hextuple by applying a function to the fourth element, and putting the result as the fourth element of the new hextuple.Create a new hextuple by applying a function to the second element, and putting the result as the second element of the new hextuple.Create a new hextuple by applying a function to the sixth element, and putting the result as the sixth element of the new hextuple.Create a new hextuple by applying a function to the third element, and putting the result as the third element of the new hextuple.static <T1,T2, T3, T4, T5, T6>
Hextuple<T1,T2, T3, T4, T5, T6> of(T1 first, T2 second, T3 third, T4 fourth, T5 fifth, T6 sixth) second()sixth()third()<R> RConvert this hextuple to an instance of an arbitrary type.
-
Method Details
-
of
static <T1,T2, Hextuple<T1,T3, T4, T5, T6> T2, ofT3, T4, T5, T6> (T1 first, T2 second, T3 third, T4 fourth, T5 fifth, T6 sixth) -
flatten
-
first
T1 first()- Returns:
- the first value
-
second
T2 second()- Returns:
- the second value
-
third
T3 third()- Returns:
- the third value
-
fourth
T4 fourth()- Returns:
- the fourth value
-
fifth
T5 fifth()- Returns:
- the fifth value
-
sixth
T6 sixth()- Returns:
- the sixth value
-
mapFirst
Create a new hextuple by applying a function to the first element, and putting the result as the first element of the new hextuple.- Parameters:
mapper- the function to apply to the first element- Returns:
- the new hextuple
-
mapSecond
Create a new hextuple by applying a function to the second element, and putting the result as the second element of the new hextuple.- Parameters:
mapper- the function to apply to the second element- Returns:
- the new hextuple
-
mapThird
Create a new hextuple by applying a function to the third element, and putting the result as the third element of the new hextuple.- Parameters:
mapper- the function to apply to the third element- Returns:
- the new hextuple
-
mapFourth
Create a new hextuple by applying a function to the fourth element, and putting the result as the fourth element of the new hextuple.- Parameters:
mapper- the function to apply to the fourth element- Returns:
- the new hextuple
-
mapFifth
Create a new hextuple by applying a function to the fifth element, and putting the result as the fifth element of the new hextuple.- Parameters:
mapper- the function to apply to the fifth element- Returns:
- the new hextuple
-
mapSixth
Create a new hextuple by applying a function to the sixth element, and putting the result as the sixth element of the new hextuple.- Parameters:
mapper- the function to apply to the sixth element- Returns:
- the new hextuple
-
map
<S1,S2, Hextuple<S1,S3, S4, S5, S6> S2, mapS3, S4, S5, S6> (Function<? super T1, ? extends S1> firstMapper, Function<? super T2, ? extends S2> secondMapper, Function<? super T3, ? extends S3> thirdMapper, Function<? super T4, ? extends S4> fourthMapper, Function<? super T5, ? extends S5> fifthMapper, Function<? super T6, ? extends S6> sixthMapper) Create a new hextuple by applying a function to each element, and putting the results into a new hextuple.- Parameters:
firstMapper- the function to apply to the first elementsecondMapper- the function to apply to the second elementthirdMapper- the function to apply to the third elementfourthMapper- the function to apply to the fourth elementfifthMapper- the function to apply to the fifth elementsixthMapper- the function to apply to the sixth element- Returns:
- the new hextuple
-
asHextuple
- Specified by:
asHextuplein interfaceViewableAsHextuple<T1,T2, T3, T4, T5, T6> - Returns:
- this hextuple instance
-
to
<R> R to(HexaFunction<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, R> convertor) Convert this hextuple to an instance of an arbitrary type.- Type Parameters:
R- The type of the resulting instance- Parameters:
convertor- the function used to convert the contained values to a resulting compound instance.- Returns:
- the result from the given function
-