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.ObjectA 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 aTriplefrom aPairand 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 aStreamofTriples composed of a given fixedPairand 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 aStreamofTriples composed of a given fixedPairand 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 aStreamofTriples composed of a givenPairand 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 aTriplefrom aPairand another value.- Type Parameters:
T- the former type of thePairU- the latter type of thePairV- the type of the value- Parameters:
pair- thePairvalue- the value- Returns:
- the
StreamofTriples
-
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 aStreamofTriples composed of a givenPairand another element taken fromStream.- Type Parameters:
T- the former type of thePairU- the latter type of thePairV- the type of theStream- Parameters:
pair- thePairstream- theStream- Returns:
- the
StreamofTriples
-
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 aStreamofTriples composed of a given fixedPairand an integer in the given range.- Type Parameters:
T- the former type of thePairU- the latter type of thePair- Parameters:
pair- thePairfrom- the first value of the integerStream(included)to- the last value of the integerStream(excluded)- Returns:
- the
StreamofTriples
-
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 aStreamofTriples composed of a given fixedPairand an integer in the given range.- Type Parameters:
T- the former type of thePairU- the latter type of thePair- Parameters:
pair- thePairfrom- the first value of the integerStream(included)to- the last value of the integerStream(included)- Returns:
- the
StreamofTriples
-
-