Class DefaultTriConstraintCollector<A,B,C,ResultContainer_,Result_>
- java.lang.Object
-
- org.optaplanner.core.impl.score.stream.tri.DefaultTriConstraintCollector<A,B,C,ResultContainer_,Result_>
-
- All Implemented Interfaces:
TriConstraintCollector<A,B,C,ResultContainer_,Result_>
public final class DefaultTriConstraintCollector<A,B,C,ResultContainer_,Result_> extends Object implements TriConstraintCollector<A,B,C,ResultContainer_,Result_>
-
-
Constructor Summary
Constructors Constructor Description DefaultTriConstraintCollector(Supplier<ResultContainer_> supplier, QuadFunction<ResultContainer_,A,B,C,Runnable> accumulator, Function<ResultContainer_,Result_> finisher)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QuadFunction<ResultContainer_,A,B,C,Runnable>
accumulator()
A lambda that extracts data from the matched facts, accumulates it in the result container and returns an undo operation for that accumulation.Function<ResultContainer_,Result_>
finisher()
A lambda that converts the result container into the result.static <A,B,C,Result_>
TriConstraintCollector<A,B,C,?,Result_>noop()
Supplier<ResultContainer_>
supplier()
A lambda that creates the result container, one for each group key combination.
-
-
-
Constructor Detail
-
DefaultTriConstraintCollector
public DefaultTriConstraintCollector(Supplier<ResultContainer_> supplier, QuadFunction<ResultContainer_,A,B,C,Runnable> accumulator, Function<ResultContainer_,Result_> finisher)
-
-
Method Detail
-
noop
public static <A,B,C,Result_> TriConstraintCollector<A,B,C,?,Result_> noop()
-
supplier
public Supplier<ResultContainer_> supplier()
Description copied from interface:TriConstraintCollector
A lambda that creates the result container, one for each group key combination.- Specified by:
supplier
in interfaceTriConstraintCollector<A,B,C,ResultContainer_,Result_>
- Returns:
- never null
-
accumulator
public QuadFunction<ResultContainer_,A,B,C,Runnable> accumulator()
Description copied from interface:TriConstraintCollector
A lambda that extracts data from the matched facts, accumulates it in the result container and returns an undo operation for that accumulation.- Specified by:
accumulator
in interfaceTriConstraintCollector<A,B,C,ResultContainer_,Result_>
- Returns:
- never null, the undo operation. This lambda is called when the facts no longer matches.
-
finisher
public Function<ResultContainer_,Result_> finisher()
Description copied from interface:TriConstraintCollector
A lambda that converts the result container into the result.- Specified by:
finisher
in interfaceTriConstraintCollector<A,B,C,ResultContainer_,Result_>
- Returns:
- never null
-
-