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

## Class BavetAbstractBiConstraintStream<Solution_,​A,​B>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream<Solution_>
  - - org.optaplanner.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream<Solution_>
    - - org.optaplanner.core.impl.score.stream.bavet.bi.BavetAbstractBiConstraintStream<Solution_,​A,​B>

- All Implemented Interfaces:
    `BiConstraintStream<A,​B>`, `ConstraintStream`, `InnerBiConstraintStream<A,​B>`
  Direct Known Subclasses:
    `BavetFilterBiConstraintStream`, `BavetGroupBiConstraintStream`, `BavetGroupBridgeBiConstraintStream`, `BavetJoinBiConstraintStream`, `BavetJoinBridgeBiConstraintStream`, `BavetScoringBiConstraintStream`

      public abstract class BavetAbstractBiConstraintStream<Solution_,​A,​B>
      extends BavetAbstractConstraintStream<Solution_>
      implements InnerBiConstraintStream<A,​B>

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected List<BavetAbstractBiConstraintStream<Solution_,​A,​B>>` | `childStreamList` |

    - ### Fields inherited from class org.optaplanner.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream

      `constraintFactory`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BavetAbstractBiConstraintStream​(BavetConstraintFactory<Solution_> constraintFactory)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `addChildStream​(BavetAbstractBiConstraintStream<Solution_,​A,​B> childStream)` |
    `protected void` | `createChildNodeChains​(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, BavetAbstractBiNode<A,​B> node)` |
    `protected abstract BavetAbstractBiNode<A,​B>` | `createNode​(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, BavetAbstractBiNode<A,​B> parentNode)` |
    `BavetAbstractBiNode<A,​B>` | `createNodeChain​(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, BavetAbstractBiNode<A,​B> parentNode)` |
    `BavetAbstractBiConstraintStream<Solution_,​A,​B>` | `filter​(BiPredicate<A,​B> predicate)` | Exhaustively test each tuple of facts against the `BiPredicate` and match if `BiPredicate.test(Object, Object)` returns true.
    `<ResultB_> BiConstraintStream<A,​ResultB_>` | `flattenLast​(Function<B,​Iterable<ResultB_>> mapping)` | Takes each tuple and applies a mapping on the last fact, which turns it into `Iterable`.
    `<GroupKey_> UniConstraintStream<GroupKey_>` | `groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping)` | Convert the `BiConstraintStream` to a `UniConstraintStream`, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream.
    `<GroupKey_,​ResultContainer_,​Result_> BiConstraintStream<GroupKey_,​Result_>` | `groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping, BiConstraintCollector<A,​B,​ResultContainer_,​Result_> collector)` | Convert the `BiConstraintStream` to a different `BiConstraintStream`, consisting of unique tuples.
    `<GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<GroupKey_,​ResultB_,​ResultC_>` | `groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping, BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB, BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC)` | Convert the `BiConstraintStream` to a `TriConstraintStream`, consisting of unique tuples with three facts.
    `<GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKey_,​ResultB_,​ResultC_,​ResultD_>` | `groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping, BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB, BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC, BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)` | Convert the `BiConstraintStream` to a `QuadConstraintStream`, consisting of unique tuples with four facts.
    `<GroupKeyA_,​GroupKeyB_> BiConstraintStream<GroupKeyA_,​GroupKeyB_>` | `groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping, BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping)` | Convert the `BiConstraintStream` to a different `BiConstraintStream`, consisting of unique tuples.
    `<GroupKeyA_,​GroupKeyB_,​GroupKeyC_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_>` | `groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping, BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping, BiFunction<A,​B,​GroupKeyC_> groupKeyCMapping)` | Convert the `BiConstraintStream` to a `TriConstraintStream`, consisting of unique tuples with three facts.
    `<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​GroupKeyD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​GroupKeyD_>` | `groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping, BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping, BiFunction<A,​B,​GroupKeyC_> groupKeyCMapping, BiFunction<A,​B,​GroupKeyD_> groupKeyDMapping)` | Convert the `BiConstraintStream` to a `QuadConstraintStream`, consisting of unique tuples with four facts.
    `<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​ResultD_>` | `groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping, BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping, BiFunction<A,​B,​GroupKeyC_> groupKeyCMapping, BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)` | Combines the semantics of `BiConstraintStream.groupBy(BiFunction, BiFunction)` and `BiConstraintStream.groupBy(BiConstraintCollector)`.
    `<GroupKeyA_,​GroupKeyB_,​ResultContainer_,​Result_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​Result_>` | `groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping, BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,​B,​ResultContainer_,​Result_> collector)` | Combines the semantics of `BiConstraintStream.groupBy(BiFunction, BiFunction)` and `BiConstraintStream.groupBy(BiConstraintCollector)`.
    `<GroupKeyA_,​GroupKeyB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​ResultC_,​ResultD_>` | `groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping, BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC, BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)` | Combines the semantics of `BiConstraintStream.groupBy(BiFunction, BiFunction)` and `BiConstraintStream.groupBy(BiConstraintCollector)`.
    `<ResultContainer_,​Result_> UniConstraintStream<Result_>` | `groupBy​(BiConstraintCollector<A,​B,​ResultContainer_,​Result_> collector)` | Runs all tuples of the stream through a given @`BiConstraintCollector` and converts them into a new `UniConstraintStream` which only has a single tuple, the result of applying `BiConstraintCollector`.
    `<ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_> BiConstraintStream<ResultA_,​ResultB_>` | `groupBy​(BiConstraintCollector<A,​B,​ResultContainerA_,​ResultA_> collectorA, BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB)` | Convert the `BiConstraintStream` to a `BiConstraintStream`, containing only a single tuple, the result of applying two `BiConstraintCollector`s.
    `<ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<ResultA_,​ResultB_,​ResultC_>` | `groupBy​(BiConstraintCollector<A,​B,​ResultContainerA_,​ResultA_> collectorA, BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB, BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC)` | Convert the `BiConstraintStream` to a `TriConstraintStream`, containing only a single tuple, the result of applying three `BiConstraintCollector`s.
    `<ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<ResultA_,​ResultB_,​ResultC_,​ResultD_>` | `groupBy​(BiConstraintCollector<A,​B,​ResultContainerA_,​ResultA_> collectorA, BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB, BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC, BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)` | Convert the `BiConstraintStream` to a `QuadConstraintStream`, containing only a single tuple, the result of applying four `BiConstraintCollector`s.
    `<C> BiConstraintStream<A,​B>` | `ifExists​(Class<C> otherClass, TriJoiner<A,​B,​C>... joiners)` | As defined by `BiConstraintStream.ifExists(Class, TriJoiner)`.
    `<C> BiConstraintStream<A,​B>` | `ifNotExists​(Class<C> otherClass, TriJoiner<A,​B,​C>... joiners)` | As defined by `BiConstraintStream.ifNotExists(Class, TriJoiner)`.
    `Constraint` | `impactScore​(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,​B> matchWeigher, ScoreImpactType impactType)` |
    `Constraint` | `impactScore​(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType)` |
    `Constraint` | `impactScoreBigDecimal​(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,​B,​BigDecimal> matchWeigher, ScoreImpactType impactType)` |
    `Constraint` | `impactScoreConfigurable​(String constraintPackage, String constraintName, ToIntBiFunction<A,​B> matchWeigher, ScoreImpactType impactType)` |
    `Constraint` | `impactScoreConfigurable​(String constraintPackage, String constraintName, ScoreImpactType impactType)` |
    `Constraint` | `impactScoreConfigurableBigDecimal​(String constraintPackage, String constraintName, BiFunction<A,​B,​BigDecimal> matchWeigher, ScoreImpactType impactType)` |
    `Constraint` | `impactScoreConfigurableLong​(String constraintPackage, String constraintName, ToLongBiFunction<A,​B> matchWeigher, ScoreImpactType impactType)` |
    `Constraint` | `impactScoreLong​(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,​B> matchWeigher, ScoreImpactType impactType)` |
    `<C> TriConstraintStream<A,​B,​C>` | `join​(UniConstraintStream<C> otherStream, TriJoiner<A,​B,​C> joiner)` | Create a new `TriConstraintStream` for every combination of [A, B] and C for which the `TriJoiner` is true (for the properties it extracts from both facts).
    `<ResultA_> UniConstraintStream<ResultA_>` | `map​(BiFunction<A,​B,​ResultA_> mapping)` | As defined by `UniConstraintStream.map(Function)`.
    `protected BavetAbstractBiNode<A,​B>` | `processNode​(BavetNodeBuildPolicy<Solution_> buildPolicy, BavetAbstractBiNode<A,​B> parentNode, BavetAbstractBiNode<A,​B> node)` |

    - ### Methods inherited from class org.optaplanner.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream

      `buildConstraint, buildConstraintConfigurable, getConstraintFactory, getFromStreamList`

    - ### Methods inherited from class org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream

      `buildConstraintWeightExtractor, buildConstraintWeightExtractor, impact, penalize, penalizeConfigurable, reward, rewardConfigurable`

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

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

    - ### Methods inherited from interface org.optaplanner.core.api.score.stream.bi.BiConstraintStream

      `ifExists, ifExists, ifExists, ifExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, join, join, join, join, join, join, join, join, join, join, join, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong`

    - ### Methods inherited from interface org.optaplanner.core.api.score.stream.ConstraintStream

      `getConstraintFactory, impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable`

    - ### Methods inherited from interface org.optaplanner.core.impl.score.stream.bi.InnerBiConstraintStream

      `distinct, guaranteesDistinct, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong`

- - ### Field Detail

    - #### childStreamList

          protected final List<BavetAbstractBiConstraintStream<Solution_,​A,​B>> childStreamList

  - ### Constructor Detail

    - #### BavetAbstractBiConstraintStream

          public BavetAbstractBiConstraintStream​(BavetConstraintFactory<Solution_> constraintFactory)

  - ### Method Detail

    - #### addChildStream

          protected void addChildStream​(BavetAbstractBiConstraintStream<Solution_,​A,​B> childStream)

    - #### filter

          public BavetAbstractBiConstraintStream<Solution_,​A,​B> filter​(BiPredicate<A,​B> predicate)

      Description copied from interface: `BiConstraintStream`
      Exhaustively test each tuple of facts against the `BiPredicate` and match if `BiPredicate.test(Object, Object)` returns true.

      Important: This is slower and less scalable than `UniConstraintStream.join(UniConstraintStream, BiJoiner)` with a proper `BiJoiner` predicate (such as `Joiners.equal(Function, Function)`, because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.

      Specified by:
        `filter` in interface `BiConstraintStream<Solution_,​A>`
      Parameters:
        `predicate` - never null
      Returns:
        never null

    - #### join

          public <C> TriConstraintStream<A,​B,​C> join​(UniConstraintStream<C> otherStream,
                                                                 TriJoiner<A,​B,​C> joiner)

      Description copied from interface: `BiConstraintStream`
      Create a new `TriConstraintStream` for every combination of [A, B] and C for which the `TriJoiner` is true (for the properties it extracts from both facts).

      Important: This is faster and more scalable than a `join` followed by a `filter`, because it applies hashing and/or indexing on the properties, so it doesn't create nor checks every combination of [A, B] and C.

      Specified by:
        `join` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `C` - the type of the third matched fact
      Parameters:
        `otherStream` - never null
        `joiner` - never null
      Returns:
        never null, a stream that matches every combination of [A, B] and C for which the `TriFunction` is true

    - #### ifExists

          @SafeVarargs
          public final <C> BiConstraintStream<A,​B> ifExists​(Class<C> otherClass,
                                                                  TriJoiner<A,​B,​C>... joiners)

      Description copied from interface: `BiConstraintStream`
      As defined by `BiConstraintStream.ifExists(Class, TriJoiner)`. For performance reasons, indexing joiners must be placed before filtering joiners.

      This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a `SafeVarargs` annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 `TriJoiner` parameters.

      Specified by:
        `ifExists` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `C` - the type of the third matched fact
      Parameters:
        `otherClass` - never null
        `joiners` - never null
      Returns:
        never null, a stream that matches every pair of A and B where C exists for which the `TriJoiner`s are true

    - #### ifNotExists

          @SafeVarargs
          public final <C> BiConstraintStream<A,​B> ifNotExists​(Class<C> otherClass,
                                                                     TriJoiner<A,​B,​C>... joiners)

      Description copied from interface: `BiConstraintStream`
      As defined by `BiConstraintStream.ifNotExists(Class, TriJoiner)`. For performance reasons, indexing joiners must be placed before filtering joiners.

      This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a `SafeVarargs` annotation because it's an interface method. Therefore, there are overloaded methods with up to 4 `TriJoiner` parameters.

      Specified by:
        `ifNotExists` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `C` - the type of the third matched fact
      Parameters:
        `otherClass` - never null
        `joiners` - never null
      Returns:
        never null, a stream that matches every pair of A and B where C does not exist for which the `TriJoiner`s are true

    - #### groupBy

          public <ResultContainer_,​Result_> UniConstraintStream<Result_> groupBy​(BiConstraintCollector<A,​B,​ResultContainer_,​Result_> collector)

      Description copied from interface: `BiConstraintStream`
      Runs all tuples of the stream through a given @`BiConstraintCollector` and converts them into a new `UniConstraintStream` which only has a single tuple, the result of applying `BiConstraintCollector`.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `ResultContainer_` - the mutable accumulation type (often hidden as an implementation detail)
        `Result_` - the type of a fact in the destination `UniConstraintStream`'s tuple
      Parameters:
        `collector` - never null, the collector to perform the grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_> BiConstraintStream<ResultA_,​ResultB_> groupBy​(BiConstraintCollector<A,​B,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                               BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `BiConstraintStream`, containing only a single tuple, the result of applying two `BiConstraintCollector`s.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `ResultContainerA_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultA_` - the type of the first fact in the destination `BiConstraintStream`'s tuple
        `ResultContainerB_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultB_` - the type of the second fact in the destination `BiConstraintStream`'s tuple
      Parameters:
        `collectorA` - never null, the collector to perform the first grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorB` - never null, the collector to perform the second grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<ResultA_,​ResultB_,​ResultC_> groupBy​(BiConstraintCollector<A,​B,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                                                                                      BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                      BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `TriConstraintStream`, containing only a single tuple, the result of applying three `BiConstraintCollector`s.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `ResultContainerA_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultA_` - the type of the first fact in the destination `TriConstraintStream`'s tuple
        `ResultContainerB_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultB_` - the type of the second fact in the destination `TriConstraintStream`'s tuple
        `ResultContainerC_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultC_` - the type of the third fact in the destination `TriConstraintStream`'s tuple
      Parameters:
        `collectorA` - never null, the collector to perform the first grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorB` - never null, the collector to perform the second grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorC` - never null, the collector to perform the third grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <ResultContainerA_,​ResultA_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<ResultA_,​ResultB_,​ResultC_,​ResultD_> groupBy​(BiConstraintCollector<A,​B,​ResultContainerA_,​ResultA_> collectorA,
                                                                                                                                                                                                                                                             BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                                                                             BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                                                             BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `QuadConstraintStream`, containing only a single tuple, the result of applying four `BiConstraintCollector`s.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `ResultContainerA_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultA_` - the type of the first fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerB_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultB_` - the type of the second fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerC_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultC_` - the type of the third fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerD_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultD_` - the type of the fourth fact in the destination `QuadConstraintStream`'s tuple
      Parameters:
        `collectorA` - never null, the collector to perform the first grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorB` - never null, the collector to perform the second grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorC` - never null, the collector to perform the third grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorD` - never null, the collector to perform the fourth grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKey_> UniConstraintStream<GroupKey_> groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `UniConstraintStream`, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream. Neither tuple of the new stream `Objects.equals(Object, Object)` any other.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKey_` - the type of a fact in the destination `UniConstraintStream`'s tuple
      Parameters:
        `groupKeyMapping` - never null, mapping function to convert each element in the stream to a different element
      Returns:
        never null

    - #### groupBy

          public <GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_> TriConstraintStream<GroupKey_,​ResultB_,​ResultC_> groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping,
                                                                                                                                                                                BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `TriConstraintStream`, consisting of unique tuples with three facts.

      The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective `BiConstraintCollector` applied on all incoming tuples with the same first fact.

      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKey_` - the type of the first fact in the destination `TriConstraintStream`'s tuple
        `ResultContainerB_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultB_` - the type of the second fact in the destination `TriConstraintStream`'s tuple
        `ResultContainerC_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultC_` - the type of the third fact in the destination `TriConstraintStream`'s tuple
      Parameters:
        `groupKeyMapping` - never null, function to convert the fact in the original tuple to a different fact
        `collectorB` - never null, the collector to perform the first grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorC` - never null, the collector to perform the second grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKey_,​ResultContainerB_,​ResultB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKey_,​ResultB_,​ResultC_,​ResultD_> groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping,
                                                                                                                                                                                                                                       BiConstraintCollector<A,​B,​ResultContainerB_,​ResultB_> collectorB,
                                                                                                                                                                                                                                       BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                                       BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `QuadConstraintStream`, consisting of unique tuples with four facts.

      The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective `BiConstraintCollector` applied on all incoming tuples with the same first fact.

      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKey_` - the type of the first fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerB_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultB_` - the type of the second fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerC_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultC_` - the type of the third fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerD_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultD_` - the type of the fourth fact in the destination `QuadConstraintStream`'s tuple
      Parameters:
        `groupKeyMapping` - never null, function to convert the fact in the original tuple to a different fact
        `collectorB` - never null, the collector to perform the first grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorC` - never null, the collector to perform the second grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorD` - never null, the collector to perform the third grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKey_,​ResultContainer_,​Result_> BiConstraintStream<GroupKey_,​Result_> groupBy​(BiFunction<A,​B,​GroupKey_> groupKeyMapping,
                                                                                                                      BiConstraintCollector<A,​B,​ResultContainer_,​Result_> collector)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a different `BiConstraintStream`, consisting of unique tuples.

      The first fact is the return value of the group key mapping function, applied on the incoming tuple. The second fact is the return value of a given `BiConstraintCollector` applied on all incoming tuples with the same first fact.

      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKey_` - the type of the first fact in the destination `BiConstraintStream`'s tuple
        `ResultContainer_` - the mutable accumulation type (often hidden as an implementation detail)
        `Result_` - the type of the second fact in the destination `BiConstraintStream`'s tuple
      Parameters:
        `groupKeyMapping` - never null, function to convert the fact in the original tuple to a different fact
        `collector` - never null, the collector to perform the grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKeyA_,​GroupKeyB_> BiConstraintStream<GroupKeyA_,​GroupKeyB_> groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping,
                                                                                                       BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a different `BiConstraintStream`, consisting of unique tuples.

      The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact.

      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKeyA_` - the type of the first fact in the destination `BiConstraintStream`'s tuple
        `GroupKeyB_` - the type of the second fact in the destination `BiConstraintStream`'s tuple
      Parameters:
        `groupKeyAMapping` - never null, function to convert the facts in the original tuple to a new fact
        `groupKeyBMapping` - never null, function to convert the facts in the original tuple to another new fact
      Returns:
        never null

    - #### groupBy

          public <GroupKeyA_,​GroupKeyB_,​ResultContainer_,​Result_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​Result_> groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                           BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                           BiConstraintCollector<A,​B,​ResultContainer_,​Result_> collector)

      Description copied from interface: `BiConstraintStream`
      Combines the semantics of `BiConstraintStream.groupBy(BiFunction, BiFunction)` and `BiConstraintStream.groupBy(BiConstraintCollector)`. That is, the first and second facts in the tuple follow the `BiConstraintStream.groupBy(BiFunction, BiFunction)` semantics, and the third fact is the result of applying `BiConstraintCollector.finisher()` on all the tuples of the original `UniConstraintStream` that belong to the group.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKeyA_` - the type of the first fact in the destination `TriConstraintStream`'s tuple
        `GroupKeyB_` - the type of the second fact in the destination `TriConstraintStream`'s tuple
        `ResultContainer_` - the mutable accumulation type (often hidden as an implementation detail)
        `Result_` - the type of the third fact in the destination `TriConstraintStream`'s tuple
      Parameters:
        `groupKeyAMapping` - never null, function to convert the original tuple into a first fact
        `groupKeyBMapping` - never null, function to convert the original tuple into a second fact
        `collector` - never null, the collector to perform the grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKeyA_,​GroupKeyB_,​ResultContainerC_,​ResultC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​ResultC_,​ResultD_> groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                                                                     BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                                                                     BiConstraintCollector<A,​B,​ResultContainerC_,​ResultC_> collectorC,
                                                                                                                                                                                                                     BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)

      Description copied from interface: `BiConstraintStream`
      Combines the semantics of `BiConstraintStream.groupBy(BiFunction, BiFunction)` and `BiConstraintStream.groupBy(BiConstraintCollector)`. That is, the first and second facts in the tuple follow the `BiConstraintStream.groupBy(BiFunction, BiFunction)` semantics. The third fact is the result of applying the first `BiConstraintCollector.finisher()` on all the tuples of the original `BiConstraintStream` that belong to the group. The fourth fact is the result of applying the second `BiConstraintCollector.finisher()` on all the tuples of the original `BiConstraintStream` that belong to the group
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKeyA_` - the type of the first fact in the destination `QuadConstraintStream`'s tuple
        `GroupKeyB_` - the type of the second fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerC_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultC_` - the type of the third fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerD_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultD_` - the type of the fourth fact in the destination `QuadConstraintStream`'s tuple
      Parameters:
        `groupKeyAMapping` - never null, function to convert the original tuple into a first fact
        `groupKeyBMapping` - never null, function to convert the original tuple into a second fact
        `collectorC` - never null, the collector to perform the first grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
        `collectorD` - never null, the collector to perform the second grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKeyA_,​GroupKeyB_,​GroupKeyC_> TriConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_> groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                          BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                          BiFunction<A,​B,​GroupKeyC_> groupKeyCMapping)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `TriConstraintStream`, consisting of unique tuples with three facts.

      The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact.

      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKeyA_` - the type of the first fact in the destination `TriConstraintStream`'s tuple
        `GroupKeyB_` - the type of the second fact in the destination `TriConstraintStream`'s tuple
        `GroupKeyC_` - the type of the third fact in the destination `TriConstraintStream`'s tuple
      Parameters:
        `groupKeyAMapping` - never null, function to convert the original tuple into a first fact
        `groupKeyBMapping` - never null, function to convert the original tuple into a second fact
        `groupKeyCMapping` - never null, function to convert the original tuple into a third fact
      Returns:
        never null

    - #### groupBy

          public <GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​ResultContainerD_,​ResultD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​ResultD_> groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                                                 BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                                                 BiFunction<A,​B,​GroupKeyC_> groupKeyCMapping,
                                                                                                                                                                                                 BiConstraintCollector<A,​B,​ResultContainerD_,​ResultD_> collectorD)

      Description copied from interface: `BiConstraintStream`
      Combines the semantics of `BiConstraintStream.groupBy(BiFunction, BiFunction)` and `BiConstraintStream.groupBy(BiConstraintCollector)`. That is, the first three facts in the tuple follow the `BiConstraintStream.groupBy(BiFunction, BiFunction)` semantics. The final fact is the result of applying the first `BiConstraintCollector.finisher()` on all the tuples of the original `BiConstraintStream` that belong to the group.
      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKeyA_` - the type of the first fact in the destination `QuadConstraintStream`'s tuple
        `GroupKeyB_` - the type of the second fact in the destination `QuadConstraintStream`'s tuple
        `GroupKeyC_` - the type of the third fact in the destination `QuadConstraintStream`'s tuple
        `ResultContainerD_` - the mutable accumulation type (often hidden as an implementation detail)
        `ResultD_` - the type of the fourth fact in the destination `QuadConstraintStream`'s tuple
      Parameters:
        `groupKeyAMapping` - never null, function to convert the original tuple into a first fact
        `groupKeyBMapping` - never null, function to convert the original tuple into a second fact
        `groupKeyCMapping` - never null, function to convert the original tuple into a third fact
        `collectorD` - never null, the collector to perform the grouping operation with See `ConstraintCollectors` for common operations, such as `count()`, `sum()` and others.
      Returns:
        never null

    - #### groupBy

          public <GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​GroupKeyD_> QuadConstraintStream<GroupKeyA_,​GroupKeyB_,​GroupKeyC_,​GroupKeyD_> groupBy​(BiFunction<A,​B,​GroupKeyA_> groupKeyAMapping,
                                                                                                                                                                             BiFunction<A,​B,​GroupKeyB_> groupKeyBMapping,
                                                                                                                                                                             BiFunction<A,​B,​GroupKeyC_> groupKeyCMapping,
                                                                                                                                                                             BiFunction<A,​B,​GroupKeyD_> groupKeyDMapping)

      Description copied from interface: `BiConstraintStream`
      Convert the `BiConstraintStream` to a `QuadConstraintStream`, consisting of unique tuples with four facts.

      The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact. The fourth fact is the return value of the fourth group key mapping function, applied on all incoming tuples with the same first fact.

      Specified by:
        `groupBy` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `GroupKeyA_` - the type of the first fact in the destination `QuadConstraintStream`'s tuple
        `GroupKeyB_` - the type of the second fact in the destination `QuadConstraintStream`'s tuple
        `GroupKeyC_` - the type of the third fact in the destination `QuadConstraintStream`'s tuple
        `GroupKeyD_` - the type of the fourth fact in the destination `QuadConstraintStream`'s tuple
      Parameters:
        `groupKeyAMapping` - never null, function to convert the original tuple into a first fact
        `groupKeyBMapping` - never null, function to convert the original tuple into a second fact
        `groupKeyCMapping` - never null, function to convert the original tuple into a third fact
        `groupKeyDMapping` - never null, function to convert the original tuple into a fourth fact
      Returns:
        never null

    - #### map

          public <ResultA_> UniConstraintStream<ResultA_> map​(BiFunction<A,​B,​ResultA_> mapping)

      Description copied from interface: `BiConstraintStream`
      As defined by `UniConstraintStream.map(Function)`.
      Specified by:
        `map` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `ResultA_` - the type of the only fact in the resulting `UniConstraintStream`'s tuple
      Parameters:
        `mapping` - never null, function to convert the original tuple into the new tuple
      Returns:
        never null

    - #### flattenLast

          public <ResultB_> BiConstraintStream<A,​ResultB_> flattenLast​(Function<B,​Iterable<ResultB_>> mapping)

      Description copied from interface: `BiConstraintStream`
      Takes each tuple and applies a mapping on the last fact, which turns it into `Iterable`. Returns a constraint stream consisting of tuples of the first fact and the contents of the `Iterable` one after another. In other words, it will replace the current tuple with new tuples, a cartesian product of A and the individual items from the `Iterable`.

      This may produce a stream with duplicate tuples. See `BiConstraintStream.distinct()` for details.

      In cases where the last fact is already `Iterable`, use `Function.identity()` as the argument.

      Simple example: assuming a constraint stream of `(PersonName, Person)` `[(Ann, (name = Ann, roles = [USER, ADMIN])), (Beth, (name = Beth, roles = [USER])), (Cathy, (name = Cathy, roles = [ADMIN, AUDITOR]))]`, calling `flattenLast(Person::getRoles)` on such stream will produce a stream of `[(Ann, USER), (Ann, ADMIN), (Beth, USER), (Cathy, ADMIN), (Cathy, AUDITOR)]`.

      Specified by:
        `flattenLast` in interface `BiConstraintStream<Solution_,​A>`
      Type Parameters:
        `ResultB_` - the type of the last fact in the resulting tuples
      Parameters:
        `mapping` - never null, function to convert the last fact in the original tuple into `Iterable`
      Returns:
        never null

    - #### impactScore

          public final Constraint impactScore​(String constraintPackage,
                                              String constraintName,
                                              Score<?> constraintWeight,
                                              ScoreImpactType impactType)

      Specified by:
        `impactScore` in class `AbstractConstraintStream<Solution_>`

    - #### impactScore

          public final Constraint impactScore​(String constraintPackage,
                                              String constraintName,
                                              Score<?> constraintWeight,
                                              ToIntBiFunction<A,​B> matchWeigher,
                                              ScoreImpactType impactType)

      Specified by:
        `impactScore` in interface `InnerBiConstraintStream<Solution_,​A>`

    - #### impactScoreLong

          public final Constraint impactScoreLong​(String constraintPackage,
                                                  String constraintName,
                                                  Score<?> constraintWeight,
                                                  ToLongBiFunction<A,​B> matchWeigher,
                                                  ScoreImpactType impactType)

      Specified by:
        `impactScoreLong` in interface `InnerBiConstraintStream<Solution_,​A>`

    - #### impactScoreBigDecimal

          public final Constraint impactScoreBigDecimal​(String constraintPackage,
                                                        String constraintName,
                                                        Score<?> constraintWeight,
                                                        BiFunction<A,​B,​BigDecimal> matchWeigher,
                                                        ScoreImpactType impactType)

      Specified by:
        `impactScoreBigDecimal` in interface `InnerBiConstraintStream<Solution_,​A>`

    - #### impactScoreConfigurable

          public final Constraint impactScoreConfigurable​(String constraintPackage,
                                                          String constraintName,
                                                          ScoreImpactType impactType)

      Specified by:
        `impactScoreConfigurable` in class `AbstractConstraintStream<Solution_>`

    - #### impactScoreConfigurable

          public final Constraint impactScoreConfigurable​(String constraintPackage,
                                                          String constraintName,
                                                          ToIntBiFunction<A,​B> matchWeigher,
                                                          ScoreImpactType impactType)

      Specified by:
        `impactScoreConfigurable` in interface `InnerBiConstraintStream<Solution_,​A>`

    - #### impactScoreConfigurableLong

          public final Constraint impactScoreConfigurableLong​(String constraintPackage,
                                                              String constraintName,
                                                              ToLongBiFunction<A,​B> matchWeigher,
                                                              ScoreImpactType impactType)

      Specified by:
        `impactScoreConfigurableLong` in interface `InnerBiConstraintStream<Solution_,​A>`

    - #### impactScoreConfigurableBigDecimal

          public final Constraint impactScoreConfigurableBigDecimal​(String constraintPackage,
                                                                    String constraintName,
                                                                    BiFunction<A,​B,​BigDecimal> matchWeigher,
                                                                    ScoreImpactType impactType)

      Specified by:
        `impactScoreConfigurableBigDecimal` in interface `InnerBiConstraintStream<Solution_,​A>`

    - #### createNodeChain

          public BavetAbstractBiNode<A,​B> createNodeChain​(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                                                Score<?> constraintWeight,
                                                                BavetAbstractBiNode<A,​B> parentNode)

    - #### processNode

          protected BavetAbstractBiNode<A,​B> processNode​(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                                               BavetAbstractBiNode<A,​B> parentNode,
                                                               BavetAbstractBiNode<A,​B> node)

    - #### createChildNodeChains

          protected void createChildNodeChains​(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                               Score<?> constraintWeight,
                                               BavetAbstractBiNode<A,​B> node)

    - #### createNode

          protected abstract BavetAbstractBiNode<A,​B> createNode​(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                                                       Score<?> constraintWeight,
                                                                       BavetAbstractBiNode<A,​B> parentNode)