All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codepoetics.fluvius.flows.TargetCapture Maven / Gradle / Ivy

There is a newer version: 1.10
Show newest version
package com.codepoetics.fluvius.flows;

import com.codepoetics.fluvius.api.scratchpad.Key;

/**
 * The stage in the fluent API where we have captured the output Key to which a Flow will write its result.
 *
 * @param  The type of the output key.
 */
public final class TargetCapture {
  private final Key target;

  TargetCapture(Key target) {
    this.target = target;
  }

  /**
   * Capture the single sourceA Key from which the Flow will take its input.
   *
   * @param sourceA The sourceA Key from which the Flow will take its input.
   * @param      The type of the sourceA Key.
   * @return The next stage in the Fluent API.
   */
  public  SourceTargetCapture1 from(Key sourceA) {
    return new SourceTargetCapture1<>(sourceA, target);
  }

  /**
   * Capture the two sourceA Keys from which the Flow will take its input.
   *
   * @param sourceA The first sourceA Key from which the Flow will take its input.
   * @param sourceB The second sourceA Key from which the Flow will take its input.
   * @param      The type of the first sourceA Key.
   * @param      The type of the second sourceA Key.
   * @return The next stage in the Fluent API.
   */
  public  SourceTargetCapture2 from(Key sourceA, Key sourceB) {
    return new SourceTargetCapture2<>(sourceA, sourceB, target);
  }

  /**
   * Capture the three sourceA Keys from which the Flow will take its input.
   *
   * @param source1 The first sourceA Key from which the flow will take its input.
   * @param source2 The second sourceA Key from which the flow will take its input.
   * @param source3 The third sourceA Key from which the flow will take its input.
   * @param      The type of the first sourceA Key.
   * @param      The type of the second sourceA Key.
   * @param      The type of the third sourceA Key.
   * @return The next stage in the Fluent API.
   */
  public  SourceTargetCapture3 from(Key source1, Key source2, Key source3) {
    return new SourceTargetCapture3<>(source1, source2, source3, target);
  }
}