public final class Product extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Product.HasFirst<T> |
static interface |
Product.HasSecond<U> |
static interface |
Product.HasThird<V> |
static interface |
Product.Product2<T,U> |
static interface |
Product.Product3<T,U,V> |
static interface |
Product.TriFunction<T,U,V,R> |
| Modifier and Type | Method and Description |
|---|---|
static <T,U> Stream<Product.Product2<T,U>> |
of(@NotNull Collection<T> ts,
@NotNull Collection<U> us)
Creates and returns the cartesian product of the given elements by applying a default
Product2 constructor to each tuple.
|
static <T,U,R> Stream<R> |
of(@NotNull Collection<T> ts,
@NotNull Collection<U> us,
@NotNull BiFunction<? super T,? super U,? extends R> constructor)
Creates and returns the cartesian product of the given elements by applying the provided
constructors to each tuple. |
static <T,U,V> Stream<Product.Product3<T,U,V>> |
of(@NotNull Collection<T> ts,
@NotNull Collection<U> us,
@NotNull Collection<V> vs)
Creates and returns the cartesian product of the given elements by applying a default
Product3 constructor to each tuple.
|
static <T,U,V,R> Stream<R> |
of(@NotNull Collection<T> ts,
@NotNull Collection<U> us,
@NotNull Collection<V> vs,
@NotNull Product.TriFunction<T,U,V,R> constructor)
Creates and returns the cartesian product of the given elements by applying the provided
constructors to each tuple. |
static <T,U> Stream<Product.Product2<T,U>> |
of(@NotNull Stream<T> ts,
@NotNull Stream<U> us)
Creates and returns the cartesian product of the given elements by applying the provided
constructors to each tuple. |
static <T,U,R> Stream<R> |
of(@NotNull Stream<T> ts,
@NotNull Stream<U> us,
@NotNull BiFunction<? super T,? super U,? extends R> constructor)
Creates and returns the cartesian product of the given elements by applying a default
Product2 constructor to each tuple.
|
static <T,U,V> Stream<Product.Product3<T,U,V>> |
of(@NotNull Stream<T> ts,
@NotNull Stream<U> us,
@NotNull Stream<V> vs)
Creates and returns the cartesian product of the given elements by applying a default
Product3 constructor to each tuple.
|
static <T,U,V,R> Stream<R> |
of(@NotNull Stream<T> ts,
@NotNull Stream<U> us,
@NotNull Stream<V> vs,
@NotNull Product.TriFunction<T,U,V,R> constructor)
Creates and returns the cartesian product of the given elements by the provided
constructors to each tuple. |
public static <T,U> Stream<Product.Product2<T,U>> of(@NotNull @NotNull Collection<T> ts, @NotNull @NotNull Collection<U> us)
The order of the product is by T (most significant factor) and then U.
T - element type for the first factor orderU - element type for the second factor orderts - the first factor order (non-null)us - the second factor order (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U,R> Stream<R> of(@NotNull @NotNull Collection<T> ts, @NotNull @NotNull Collection<U> us, @NotNull @NotNull BiFunction<? super T,? super U,? extends R> constructor)
constructors to each tuple.
The order of the product is by T (most significant factor) and then U.
T - element type for the first factor orderU - element type for the second factor orderts - the first factor order (non-null)us - the second factor order (non-null)constructor - to be applied to all tuples (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U> Stream<Product.Product2<T,U>> of(@NotNull @NotNull Stream<T> ts, @NotNull @NotNull Stream<U> us)
constructors to each tuple.
The order of the product is by T (most significant factor) and then U. The provided stream
ts is consumed lazily and the other provided streams are not.
T - element type for the first factor orderU - element type for the second factor orderts - the first factor order (non-null)us - the second factor order (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U,R> Stream<R> of(@NotNull @NotNull Stream<T> ts, @NotNull @NotNull Stream<U> us, @NotNull @NotNull BiFunction<? super T,? super U,? extends R> constructor)
The order of the product is by T (most significant factor) and then U. The provided stream
ts is consumed lazily and the other provided streams are not.
T - element type for the first factor orderU - element type for the second factor orderts - the first factor order (non-null)us - the second factor order (non-null)constructor - to be applied to all tuples (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U,V> Stream<Product.Product3<T,U,V>> of(@NotNull @NotNull Collection<T> ts, @NotNull @NotNull Collection<U> us, @NotNull @NotNull Collection<V> vs)
The order of the product is by T (most significant factor) and then U and then V.
T - element type for the first factor orderU - element type for the second factor orderV - element type for the third factor orderts - the first factor order (non-null)us - the second factor order (non-null)vs - the third factor order (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U,V,R> Stream<R> of(@NotNull @NotNull Collection<T> ts, @NotNull @NotNull Collection<U> us, @NotNull @NotNull Collection<V> vs, @NotNull @NotNull Product.TriFunction<T,U,V,R> constructor)
constructors to each tuple.
The order of the product is by T (most significant factor) and then U and then V.
T - element type for the first factor orderU - element type for the second factor orderV - element type for the third factor orderts - the first factor order (non-null)us - the second factor order (non-null)vs - the third factor order (non-null)constructor - to be applied to all tuples (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U,V> Stream<Product.Product3<T,U,V>> of(@NotNull @NotNull Stream<T> ts, @NotNull @NotNull Stream<U> us, @NotNull @NotNull Stream<V> vs)
The order of the product is by T (most significant factor) and then U and then V. The provided stream
ts is consumed lazily and the other provided streams are not.
T - element type for the first factor orderU - element type for the second factor orderV - element type for the third factor orderts - the first factor order (non-null)us - the second factor order (non-null)vs - the third factor order (non-null)NullPointerException - if any of the provided parameters are null.public static <T,U,V,R> Stream<R> of(@NotNull @NotNull Stream<T> ts, @NotNull @NotNull Stream<U> us, @NotNull @NotNull Stream<V> vs, @NotNull @NotNull Product.TriFunction<T,U,V,R> constructor)
constructors to each tuple.
The order of the product is by T (most significant factor) and then U and then V. The provided stream
ts is consumed lazily and the other provided streams are not.
T - element type for the first factor orderU - element type for the second factor orderV - element type for the third factor orderts - the first factor order (non-null)us - the second factor order (non-null)vs - the third factor order (non-null)constructor - to be applied to all tuples (non-null)NullPointerException - if any of the provided parameters are null.Copyright © 2023. All rights reserved.