Package de.xima.fc.stage
Class LocalVariables
- java.lang.Object
-
- de.xima.fc.stage.LocalVariables
-
public final class LocalVariables extends Object
A set of named variables that can grow over time. Alternatively, this class could also be called a staged builder for an n-tuple.This is intended to be used with
CompletionStageto avoid heavy nesting of transformers when values of previous stages are required for dependent stages. For example:See the JavaDocs for
StageChainfor an example how this can simplify code with stages a lot.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLocalVariables.L1<X1>A set of one local variables.static classLocalVariables.L2<X1,X2>A set of two local variables.static classLocalVariables.L3<X1,X2,X3>A set of three local variables.static classLocalVariables.L4<X1,X2,X3,X4>A set of four local variables.static classLocalVariables.L5<X1,X2,X3,X4,X5>A set of five local variables.static classLocalVariables.L6<X1,X2,X3,X4,X5,X6>A set of six local variables.static classLocalVariables.L7<X1,X2,X3,X4,X5,X6,X7>A set of seven local variables.static classLocalVariables.L8<X1,X2,X3,X4,X5,X6,X7,X8>A set of eight local variables.static classLocalVariables.L9<X1,X2,X3,X4,X5,X6,X7,X8,X9>A set of nine local variables.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalVariablesempty()static CompletableFuture<LocalVariables>emptyStage()<X1> LocalVariables.L1<X1>next(X1 x1)<X1,R>
StageChain<LocalVariables.L1<X1>,R>nextChain(StageChain<X1,R> x1)<X1> CompletionStage<LocalVariables.L1<X1>>nextStage(CompletionStage<X1> x1)
-
-
-
Method Detail
-
next
public <X1> LocalVariables.L1<X1> next(X1 x1)
- Type Parameters:
X1- Type of the next local variable to add.- Parameters:
x1- The next local variable to add.- Returns:
- A set of local variables which includes the new one.
-
nextChain
public <X1,R> StageChain<LocalVariables.L1<X1>,R> nextChain(StageChain<X1,R> x1)
- Type Parameters:
X1- Type of the next local variable to add.- Parameters:
x1- A completion stage that resolves to the next local variable to add.- Returns:
- A completion stage that resolves to a set of local variables which includes the new one.
-
nextStage
public <X1> CompletionStage<LocalVariables.L1<X1>> nextStage(CompletionStage<X1> x1)
- Type Parameters:
X1- Type of the next local variable to add.- Parameters:
x1- A completion stage that resolves to the next local variable to add.- Returns:
- A completion stage that resolves to a set of local variables which includes the new one.
-
empty
public static LocalVariables empty()
- Returns:
- A new set without any variables.
-
emptyStage
public static CompletableFuture<LocalVariables> emptyStage()
- Returns:
- A completion stage for a new set without any variables.
-
-