/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @return processing result. */ public static <DATA> DATA process(DATA data, Stage<DATA> rootStage) { Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, rootStage); Stage<DATA> currentStage; while ((currentStage = continuation.next()) != null) { continuation = currentStage.apply(continuation.result()); } return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }