public final class Stages extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Stages.LinkedStage<DATA>
Linked linear stage implementation.
|
| Modifier and Type | Method and Description |
|---|---|
static <DATA,RESULT> |
asStage(Inflector<DATA,RESULT> inflector)
Creates a terminal
Stage that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called. |
static <DATA> Stage.Builder<DATA> |
chain(ChainableStage<DATA> rootStage)
Start building a stage chain.
|
static <DATA> Stage.Builder<DATA> |
chain(Function<DATA,DATA> transformation)
Start building a stage chain.
|
static <DATA,RESULT,T extends Inflector<DATA,RESULT>> |
extractInflector(Object stage)
(Optionally) extracts an
inflector from a processing stage,
provided the stage implements Inflecting interface. |
static <DATA> ChainableStage<DATA> |
identity()
Get a chainable "identity" stage.
|
static <DATA> DATA |
process(DATA data,
Stage<DATA> rootStage)
Run the data through a chain of stages identified by the root stage.
|
static <DATA,RESULT,T extends Inflector<DATA,RESULT>> |
process(DATA data,
Stage<DATA> rootStage,
Ref<T> inflectorRef)
Run the data through a chain of stages identified by the root stage.
|
public static <DATA> ChainableStage<DATA> identity()
DATA - data type transformable by the stage.public static <DATA,RESULT> Stage<DATA> asStage(Inflector<DATA,RESULT> inflector)
Stage that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called.DATA - data type transformable by the stage and returned inflector.RESULT - type of result produced by a successful inflector data transformation.inflector - a request to response transformation to be wrapped in
a stage.Inflector.public static <DATA,RESULT,T extends Inflector<DATA,RESULT>> T extractInflector(Object stage)
inflector from a processing stage,
provided the stage implements Inflecting interface. Otherwise method
returns null.DATA - data type transformable by the stage and returned inflector.RESULT - type of result produced by a successful inflector data transformation.stage - a stage to extract the inflector from.null otherwise.public static <DATA> Stage.Builder<DATA> chain(Function<DATA,DATA> transformation)
transformation - root transformation function.public static <DATA> Stage.Builder<DATA> chain(ChainableStage<DATA> rootStage)
rootStage - root chainable linear stage.public static <DATA> DATA process(DATA data,
Stage<DATA> rootStage)
DATA - processed data type.data - data to be processed.rootStage - root stage of the stage chain.public static <DATA,RESULT,T extends Inflector<DATA,RESULT>> DATA process(DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef)
inflectorRef
parameter.DATA - processed data type.data - data to be processed.rootStage - root stage of the stage chain.inflectorRef - a mutable reference to an inflector.Copyright © 2007-2024,Oracleand/or its affiliates.All Rights Reserved. Use is subject to license terms.