Package it.tidalwave.util
Class Triple<A,B,C>
- java.lang.Object
-
- it.tidalwave.util.Triple<A,B,C>
-
@Immutable public class Triple<A,B,C> extends java.lang.Object
A value object that contains a triple of values.- Since:
- 3.2-ALPHA-12
- Author:
- Fabrizio Giudici
- Status: draft API
-
-
Constructor Summary
Constructors Constructor Description Triple()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,U,V>
Triple<T,U,V>of(Pair<T,U> pair, V value)
Creates aTriple
from aPair
and another value.static <T,U>
java.util.stream.Stream<Triple<T,U,java.lang.Integer>>tripleRange(Pair<T,U> pair, int from, int to)
Creates aStream
ofTriple
s composed of a given fixedPair
and an integer in the given range.static <T,U>
java.util.stream.Stream<Triple<T,U,java.lang.Integer>>tripleRangeClosed(Pair<T,U> pair, int from, int to)
Creates aStream
ofTriple
s composed of a given fixedPair
and an integer in the given range.static <T,U,V>
java.util.stream.Stream<Triple<T,U,V>>tripleStream(Pair<T,U> pair, java.util.stream.Stream<? extends V> stream)
Creates aStream
ofTriple
s composed of a givenPair
and another element taken fromStream
.
-
-
-
Method Detail
-
of
@Nonnull public static <T,U,V> Triple<T,U,V> of(@Nonnull Pair<T,U> pair, @Nonnull V value)
Creates aTriple
from aPair
and another value.- Type Parameters:
T
- the former type of thePair
U
- the latter type of thePair
V
- the type of the value- Parameters:
pair
- thePair
value
- the value- Returns:
- the
Stream
ofTriple
s
-
tripleStream
@Nonnull public static <T,U,V> java.util.stream.Stream<Triple<T,U,V>> tripleStream(@Nonnull Pair<T,U> pair, @Nonnull java.util.stream.Stream<? extends V> stream)
Creates aStream
ofTriple
s composed of a givenPair
and another element taken fromStream
.- Type Parameters:
T
- the former type of thePair
U
- the latter type of thePair
V
- the type of theStream
- Parameters:
pair
- thePair
stream
- theStream
- Returns:
- the
Stream
ofTriple
s
-
tripleRange
@Nonnull public static <T,U> java.util.stream.Stream<Triple<T,U,java.lang.Integer>> tripleRange(@Nonnull Pair<T,U> pair, @Nonnegative int from, @Nonnegative int to)
Creates aStream
ofTriple
s composed of a given fixedPair
and an integer in the given range.- Type Parameters:
T
- the former type of thePair
U
- the latter type of thePair
- Parameters:
pair
- thePair
from
- the first value of the integerStream
(included)to
- the last value of the integerStream
(excluded)- Returns:
- the
Stream
ofTriple
s
-
tripleRangeClosed
@Nonnull public static <T,U> java.util.stream.Stream<Triple<T,U,java.lang.Integer>> tripleRangeClosed(@Nonnull Pair<T,U> pair, @Nonnegative int from, @Nonnegative int to)
Creates aStream
ofTriple
s composed of a given fixedPair
and an integer in the given range.- Type Parameters:
T
- the former type of thePair
U
- the latter type of thePair
- Parameters:
pair
- thePair
from
- the first value of the integerStream
(included)to
- the last value of the integerStream
(included)- Returns:
- the
Stream
ofTriple
s
-
-