org.optaplanner.core.impl.score.stream.bi

## Class DefaultBiConstraintCollector<A,B,ResultContainer_,Result_>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.bi.DefaultBiConstraintCollector<A,B,ResultContainer_,Result_>

- All Implemented Interfaces:
    BiConstraintCollector<A,B,ResultContainer_,Result_>

      public final class DefaultBiConstraintCollector<A,B,ResultContainer_,Result_>
      extends Object
      implements BiConstraintCollector<A,B,ResultContainer_,Result_>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBiConstraintCollector(Supplier<ResultContainer_> supplier, TriFunction<ResultContainer_,A,B,Runnable> accumulator, Function<ResultContainer_,Result_> finisher)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TriFunction<ResultContainer_,A,B,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.
    `Supplier<ResultContainer_>` | `supplier()` A lambda that creates the result container, one for each group key combination.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultBiConstraintCollector

          public DefaultBiConstraintCollector(Supplier<ResultContainer_> supplier,
                                              TriFunction<ResultContainer_,A,B,Runnable> accumulator,
                                              Function<ResultContainer_,Result_> finisher)

  - ### Method Detail

    - #### supplier

          public Supplier<ResultContainer_> supplier()

      Description copied from interface: `BiConstraintCollector`
      A lambda that creates the result container, one for each group key combination.
      Specified by:
        `supplier` in interface `BiConstraintCollector<A,B,ResultContainer_,Result_>`
      Returns:
        never null

    - #### accumulator

          public TriFunction<ResultContainer_,A,B,Runnable> accumulator()

      Description copied from interface: `BiConstraintCollector`
      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 interface `BiConstraintCollector<A,B,ResultContainer_,Result_>`
      Returns:
        never null, the undo operation. This lamdba is called when the facts no longer matches.

    - #### finisher

          public Function<ResultContainer_,Result_> finisher()

      Description copied from interface: `BiConstraintCollector`
      A lambda that converts the result container into the result.
      Specified by:
        `finisher` in interface `BiConstraintCollector<A,B,ResultContainer_,Result_>`
      Returns:
        never null

Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.