/** * Returns a copy of this join clause, but with the right-hand projection * function replaced with the supplied one. */ public <T1_NEW_OUT> JoinClause<K, T0, T1, T1_NEW_OUT> projecting( DistributedFunction<? super T1, ? extends T1_NEW_OUT> rightProjectFn ) { return new JoinClause<>(this.leftKeyFn, this.rightKeyFn, rightProjectFn); }
/** * A shorthand factory for the common case of hash-joining with a stream of * map entries. The right key extractor is {@code Map.Entry::getKey} and the * right-hand projection function is {@code Map.Entry::getValue}. * * @param leftKeyFn the function to extract the key from the primary stream * @param <K> the type of the key * @param <T0> the type of the primary stream * @param <T1_OUT> the type of the enriching stream's entry value */ public static <K, T0, T1_OUT> JoinClause<K, T0, Entry<K, T1_OUT>, T1_OUT> joinMapEntries( DistributedFunction<? super T0, ? extends K> leftKeyFn ) { return new JoinClause<>(leftKeyFn, Entry::getKey, Entry::getValue); }
/** * Constructs and returns a join clause with the supplied left-hand and * right-hand key extractor functions, and with an identity right-hand * projection function. */ public static <K, T0, T1> JoinClause<K, T0, T1, T1> onKeys( DistributedFunction<? super T0, ? extends K> leftKeyFn, DistributedFunction<? super T1, ? extends K> rightKeyFn ) { return new JoinClause<>(leftKeyFn, rightKeyFn, DistributedFunction.identity()); }