Class AggregateParserTripletBuilder<C,U,V,Z,O>
java.lang.Object
org.incendo.cloud.parser.aggregate.AggregateParserTripletBuilder<C,U,V,Z,O>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAggregateParserTripletBuilder(TypedCommandComponent<C, U> first, TypedCommandComponent<C, V> second, TypedCommandComponent<C, Z> third, AggregateParserTripletBuilder.Mapper<C, U, V, Z, O> mapper, TypeToken<O> outType) Creates a newAggregateParserTripletBuilderwith the given components and mapper. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds anAggregateParserfrom the current state of the builder.static <C,U, V, Z>
AggregateParserTripletBuilder.Mapper<C, U, V, Z, Triplet<U, V, Z>> Creates the default mapper that simply returns aTripletof the three input values.static <C,U, V, Z, O>
@NonNull AggregateParserTripletBuilder.Mapper<C, U, V, Z, O> directMapper(@NonNull AggregateParserTripletBuilder.Mapper.DirectSuccessMapper<C, U, V, Z, O> mapper) Helper function to create a direct success mapper.<O1> AggregateParserTripletBuilder<C, U, V, Z, O1> withDirectMapper(@NonNull TypeToken<O1> outType, @NonNull AggregateParserTripletBuilder.Mapper.DirectSuccessMapper<C, U, V, Z, O1> mapper) Creates a newAggregateParserTripletBuilderwith the given mapper.<O1> AggregateParserTripletBuilder<C, U, V, Z, O1> withMapper(@NonNull TypeToken<O1> outType, @NonNull AggregateParserTripletBuilder.Mapper<C, U, V, Z, O1> mapper) Creates a newAggregateParserTripletBuilderwith the given mapper.
-
Constructor Details
-
AggregateParserTripletBuilder
public AggregateParserTripletBuilder(TypedCommandComponent<C, U> first, TypedCommandComponent<C, V> second, TypedCommandComponent<C, Z> third, AggregateParserTripletBuilder.Mapper<C, U, V, Z, O> mapper, TypeToken<O> outType) Creates a newAggregateParserTripletBuilderwith the given components and mapper.- Parameters:
first- the first componentsecond- the second componentthird- the third componentmapper- the mapperoutType- the output type
-
-
Method Details
-
defaultMapper
public static <C,U, AggregateParserTripletBuilder.Mapper<C,V, Z> U, defaultMapper()V, Z, Triplet<U, V, Z>> Creates the default mapper that simply returns aTripletof the three input values.- Type Parameters:
C- the command sender typeU- the first typeV- the second typeZ- the third type- Returns:
- a default mapper that returns a
Tripletof the three input values
-
withMapper
public <O1> AggregateParserTripletBuilder<C,U, withMapperV, Z, O1> (@NonNull TypeToken<O1> outType, @NonNull AggregateParserTripletBuilder.Mapper<C, U, V, Z, O1> mapper) Creates a newAggregateParserTripletBuilderwith the given mapper.- Type Parameters:
O1- the new output type- Parameters:
outType- the new output typemapper- the mapper- Returns:
- a new
AggregateParserTripletBuilderwith the given mapper
-
withDirectMapper
public <O1> AggregateParserTripletBuilder<C,U, withDirectMapperV, Z, O1> (@NonNull TypeToken<O1> outType, @NonNull AggregateParserTripletBuilder.Mapper.DirectSuccessMapper<C, U, V, Z, O1> mapper) Creates a newAggregateParserTripletBuilderwith the given mapper.- Type Parameters:
O1- the new output type- Parameters:
outType- the new output typemapper- the mapper- Returns:
- a new
AggregateParserTripletBuilderwith the given mapper
-
build
Builds anAggregateParserfrom the current state of the builder.- Returns:
- the built
AggregateParser
-
directMapper
public static <C,U, @NonNull AggregateParserTripletBuilder.Mapper<C,V, Z, O> U, directMapperV, Z, O> (@NonNull AggregateParserTripletBuilder.Mapper.DirectSuccessMapper<C, U, V, Z, O> mapper) Helper function to create a direct success mapper.- Type Parameters:
C- command sender typeU- first component typeV- second component typeZ- third component typeO- output type- Parameters:
mapper- mapper- Returns:
- mapper
-