Class ComparableTriple<T1 extends Comparable<? super T1>,T2 extends Comparable<? super T2>,T3 extends Comparable<? super T3>>
java.lang.Object
dk.cloudcreate.essentials.shared.functional.tuple.comparable.ComparableTriple<T1,T2,T3>
- Type Parameters:
T1- the first element typeT2- the second element typeT3- the third element type
- All Implemented Interfaces:
ComparableTuple<ComparableTriple<T1,,T2, T3>> Serializable,Comparable<ComparableTriple<T1,T2, T3>>
public class ComparableTriple<T1 extends Comparable<? super T1>,T2 extends Comparable<? super T2>,T3 extends Comparable<? super T3>>
extends Object
implements ComparableTuple<ComparableTriple<T1,T2,T3>>
Represents a
Note:
ComparableTuple with three elements.Note:
ComparableTriple supports equals(Object) comparison using subclasses, e.g.:
public class LeftMiddleAndRightSide extends ComparableTriple<String, String, String> {
public LeftMiddleAndRightSide(String leftSide, String middle, String rightSide) {
super(leftSide, middle, rightSide);
}
}
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComparableTriple(T1 t1, T2 t2, T3 t3) Construct a newComparableTuplewith 3 elements -
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 TupleintcompareTo(ComparableTriple<T1, T2, T3> o) booleaninthashCode()<R1 extends Comparable<? super R1>,R2 extends Comparable<? super R2>, R3 extends Comparable<? super R3>>
ComparableTriple<R1,R2, R3> map(TripleFunction<? super T1, ? super T2, ? super T3, ComparableTriple<R1, R2, R3>> mappingFunction) Maps the elements of thisComparableTripleusing the mapping function<R1 extends Comparable<? super R1>,R2 extends Comparable<? super R2>, R3 extends Comparable<? super R3>>
ComparableTriple<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 thisComparableTripleusing three distinct mapping functions<R1 extends Comparable<? super R1>>
ComparableTriple<R1,T2, T3> Map the first element of thisComparableTripleusing the mapping function<R2 extends Comparable<? super R2>>
ComparableTriple<T1,R2, T3> Map the second element of thisComparableTripleusing the mapping function<R3 extends Comparable<? super R3>>
ComparableTriple<T1,T2, R3> Map the third element of thisComparableTripleusing 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
-
ComparableTriple
Construct a newComparableTuplewith 3 elements- Parameters:
t1- the first elementt2- the second elementt3- the third element
-
-
Method Details
-
arity
public int arity()Description copied from interface:ComparableTupleNumber of arguments/elements in the Tuple- Specified by:
arityin interfaceComparableTuple<T1 extends Comparable<? super T1>>- Returns:
- Number of arguments/elements in the Tuple
-
toList
Description copied from interface:ComparableTupleConvert the Tuple to a list- Specified by:
toListin interfaceComparableTuple<T1 extends Comparable<? super T1>>- Returns:
- list of all Tuple elements
-
_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 extends Comparable<? super R1>,R2 extends Comparable<? super R2>, ComparableTriple<R1,R3 extends Comparable<? super 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 thisComparableTripleusing three distinct mapping functions- Type Parameters:
R1- result type for first element of theComparableTripleafter applying the mapping functionR2- result type for second element of theComparableTripleafter applying the mapping functionR3- result type for third element of theComparableTripleafter 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
ComparableTriplewith the result of applying the mapping function to thisComparableTriple
-
map1
public <R1 extends Comparable<? super R1>> ComparableTriple<R1,T2, map1T3> (Function<? super T1, ? super R1> mappingFunction1) Map the first element of thisComparableTripleusing the mapping function- Type Parameters:
R1- result type for first element of theComparableTripleafter applying the mapping function- Parameters:
mappingFunction1- the mapping function for element number 1- Returns:
- a new
ComparableTriplewith the result of applying the mapping function to the first element of thisComparableTriple
-
map2
public <R2 extends Comparable<? super R2>> ComparableTriple<T1,R2, map2T3> (Function<? super T2, ? super R2> mappingFunction2) Map the second element of thisComparableTripleusing the mapping function- Type Parameters:
R2- result type for second element of theComparableTripleafter applying the mapping function- Parameters:
mappingFunction2- the mapping function for element number 2- Returns:
- a new
ComparableTriplewith the result of applying the mapping function to the second element of thisComparableTriple
-
map3
public <R3 extends Comparable<? super R3>> ComparableTriple<T1,T2, map3R3> (Function<? super T3, ? super R3> mappingFunction3) Map the third element of thisComparableTripleusing the mapping function- Type Parameters:
R3- result type for third element of theComparableTripleafter applying the mapping function- Parameters:
mappingFunction3- the mapping function for element number 3- Returns:
- a new
ComparableTriplewith the result of applying the mapping function to the third element of thisComparableTriple
-
equals
-
hashCode
public int hashCode() -
toString
-