Package org.optaplanner.core.impl.score.stream.drools.common

## Class BiLeftHandSide<A,​B>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.drools.common.BiLeftHandSide<A,​B>

- Type Parameters:
    `A` - generic type of the first resulting variable
    `B` - generic type of the second resulting variable
  All Implemented Interfaces:
    `Supplier<List<org.drools.model.view.ViewItem<?>>>`

      public final class BiLeftHandSide<A,​B>
      extends Object

  Represents the left hand side of a Drools rule, the result of which are two variables. The simplest variant of such rule, with no filters or groupBys applied, would look like this in equivalent DRL:

        rule "Simplest bivariate rule"
        when
            $a: Something()
            $b: SomethingElse()
        then
            // Do something with the $a and $b variables.
        end

  Usually though, there would be a joiner between the two, limiting the cartesian product:

        rule "Bivariate join rule"
        when
            $a: Something($leftJoin: someValue)
            $b: SomethingElse(someOtherValue == $leftJoin)
        then
            // Do something with the $a and $b variables.
        end

  For more, see `UniLeftHandSide`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected DroolsVariableFactory` | `variableFactory` |

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `BiLeftHandSide​(BiLeftHandSide<A,​B> leftHandSide, org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> left, org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> right)` |
    `protected` | `BiLeftHandSide​(BiLeftHandSide<A,​B> leftHandSide, org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> patternVariable)` |
    `protected` | `BiLeftHandSide​(org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> left, org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> right, DroolsVariableFactory variableFactory)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `<C> BiLeftHandSide<A,​B>` | `andExists​(Class<C> cClass, TriJoiner<A,​B,​C>[] joiners)` |
    `BiLeftHandSide<A,​B>` | `andFilter​(BiPredicate<A,​B> predicate)` |
    `<NewA> UniLeftHandSide<NewA>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMapping)` |
    `<NewA,​NewB> BiLeftHandSide<NewA,​NewB>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA, BiFunction<A,​B,​NewB> keyMappingB)` |
    `<NewA,​NewB,​NewC> TriLeftHandSide<NewA,​NewB,​NewC>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA, BiFunction<A,​B,​NewB> keyMappingB, BiConstraintCollector<A,​B,​?,​NewC> collectorC)` |
    `<NewA,​NewB,​NewC,​NewD> QuadLeftHandSide<NewA,​NewB,​NewC,​NewD>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA, BiFunction<A,​B,​NewB> keyMappingB, BiConstraintCollector<A,​B,​?,​NewC> collectorC, BiConstraintCollector<A,​B,​?,​NewD> collectorD)` |
    `<NewA,​NewB> BiLeftHandSide<NewA,​NewB>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA, BiConstraintCollector<A,​B,​?,​NewB> collectorB)` |
    `<NewA,​NewB,​NewC> TriLeftHandSide<NewA,​NewB,​NewC>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA, BiConstraintCollector<A,​B,​?,​NewB> collectorB, BiConstraintCollector<A,​B,​?,​NewC> collectorC)` |
    `<NewA,​NewB,​NewC,​NewD> QuadLeftHandSide<NewA,​NewB,​NewC,​NewD>` | `andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA, BiConstraintCollector<A,​B,​?,​NewB> collectorB, BiConstraintCollector<A,​B,​?,​NewC> collectorC, BiConstraintCollector<A,​B,​?,​NewD> collectorD)` |
    `<NewA> UniLeftHandSide<NewA>` | `andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collector)` |
    `<NewA,​NewB> BiLeftHandSide<NewA,​NewB>` | `andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collectorA, BiConstraintCollector<A,​B,​?,​NewB> collectorB)` |
    `<NewA,​NewB,​NewC> TriLeftHandSide<NewA,​NewB,​NewC>` | `andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collectorA, BiConstraintCollector<A,​B,​?,​NewB> collectorB, BiConstraintCollector<A,​B,​?,​NewC> collectorC)` |
    `<NewA,​NewB,​NewC,​NewD> QuadLeftHandSide<NewA,​NewB,​NewC,​NewD>` | `andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collectorA, BiConstraintCollector<A,​B,​?,​NewB> collectorB, BiConstraintCollector<A,​B,​?,​NewC> collectorC, BiConstraintCollector<A,​B,​?,​NewD> collectorD)` |
    `<C> TriLeftHandSide<A,​B,​C>` | `andJoin​(UniLeftHandSide<C> right, TriJoiner<A,​B,​C> joiner)` |
    `<C> BiLeftHandSide<A,​B>` | `andNotExists​(Class<C> cClass, TriJoiner<A,​B,​C>[] joiners)` |
    `org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B>` | `andTerminate()` |
    `org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B>` | `andTerminate​(BiFunction<A,​B,​BigDecimal> matchWeighter)` |
    `org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B>` | `andTerminate​(ToIntBiFunction<A,​B> matchWeighter)` |
    `org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B>` | `andTerminate​(ToLongBiFunction<A,​B> matchWeighter)` |
    `List<org.drools.model.view.ViewItem<?>>` | `get()` |
    `protected static org.drools.model.Index.ConstraintType` | `getConstraintType​(JoinerType type)` |
    `protected org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A>` | `getPatternVariableA()` |
    `protected org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B>` | `getPatternVariableB()` |
    `org.drools.model.Variable[]` | `getVariables()` |
    `protected static org.drools.model.view.ViewItem<?>` | `joinViewItemsWithLogicalAnd​(org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<?>... patternVariables)` |

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

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

- - ### Field Detail

    - #### variableFactory

          protected final DroolsVariableFactory variableFactory

  - ### Constructor Detail

    - #### BiLeftHandSide

          protected BiLeftHandSide​(org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> left,
                                   org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> right,
                                   DroolsVariableFactory variableFactory)

    - #### BiLeftHandSide

          protected BiLeftHandSide​(BiLeftHandSide<A,​B> leftHandSide,
                                   org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> patternVariable)

    - #### BiLeftHandSide

          protected BiLeftHandSide​(BiLeftHandSide<A,​B> leftHandSide,
                                   org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> left,
                                   org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> right)

  - ### Method Detail

    - #### getPatternVariableA

          protected org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> getPatternVariableA()

    - #### getPatternVariableB

          protected org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> getPatternVariableB()

    - #### andFilter

          public BiLeftHandSide<A,​B> andFilter​(BiPredicate<A,​B> predicate)

    - #### andExists

          public <C> BiLeftHandSide<A,​B> andExists​(Class<C> cClass,
                                                         TriJoiner<A,​B,​C>[] joiners)

    - #### andNotExists

          public <C> BiLeftHandSide<A,​B> andNotExists​(Class<C> cClass,
                                                            TriJoiner<A,​B,​C>[] joiners)

    - #### andJoin

          public <C> TriLeftHandSide<A,​B,​C> andJoin​(UniLeftHandSide<C> right,
                                                                TriJoiner<A,​B,​C> joiner)

    - #### andGroupBy

          public <NewA> UniLeftHandSide<NewA> andGroupBy​(BiFunction<A,​B,​NewA> keyMapping)

    - #### andGroupBy

          public <NewA> UniLeftHandSide<NewA> andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collector)

    - #### andGroupBy

          public <NewA,​NewB> BiLeftHandSide<NewA,​NewB> andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collectorA,
                                                                              BiConstraintCollector<A,​B,​?,​NewB> collectorB)

    - #### andGroupBy

          public <NewA,​NewB,​NewC> TriLeftHandSide<NewA,​NewB,​NewC> andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collectorA,
                                                                                                     BiConstraintCollector<A,​B,​?,​NewB> collectorB,
                                                                                                     BiConstraintCollector<A,​B,​?,​NewC> collectorC)

    - #### andGroupBy

          public <NewA,​NewB,​NewC,​NewD> QuadLeftHandSide<NewA,​NewB,​NewC,​NewD> andGroupBy​(BiConstraintCollector<A,​B,​?,​NewA> collectorA,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewB> collectorB,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewC> collectorC,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewD> collectorD)

    - #### andGroupBy

          public <NewA,​NewB> BiLeftHandSide<NewA,​NewB> andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA,
                                                                              BiFunction<A,​B,​NewB> keyMappingB)

    - #### andGroupBy

          public <NewA,​NewB> BiLeftHandSide<NewA,​NewB> andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA,
                                                                              BiConstraintCollector<A,​B,​?,​NewB> collectorB)

    - #### andGroupBy

          public <NewA,​NewB,​NewC> TriLeftHandSide<NewA,​NewB,​NewC> andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA,
                                                                                                     BiConstraintCollector<A,​B,​?,​NewB> collectorB,
                                                                                                     BiConstraintCollector<A,​B,​?,​NewC> collectorC)

    - #### andGroupBy

          public <NewA,​NewB,​NewC,​NewD> QuadLeftHandSide<NewA,​NewB,​NewC,​NewD> andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewB> collectorB,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewC> collectorC,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewD> collectorD)

    - #### andGroupBy

          public <NewA,​NewB,​NewC> TriLeftHandSide<NewA,​NewB,​NewC> andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA,
                                                                                                     BiFunction<A,​B,​NewB> keyMappingB,
                                                                                                     BiConstraintCollector<A,​B,​?,​NewC> collectorC)

    - #### andGroupBy

          public <NewA,​NewB,​NewC,​NewD> QuadLeftHandSide<NewA,​NewB,​NewC,​NewD> andGroupBy​(BiFunction<A,​B,​NewA> keyMappingA,
                                                                                                                            BiFunction<A,​B,​NewB> keyMappingB,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewC> collectorC,
                                                                                                                            BiConstraintCollector<A,​B,​?,​NewD> collectorD)

    - #### andTerminate

          public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate()

    - #### andTerminate

          public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate​(ToIntBiFunction<A,​B> matchWeighter)

    - #### andTerminate

          public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate​(ToLongBiFunction<A,​B> matchWeighter)

    - #### andTerminate

          public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate​(BiFunction<A,​B,​BigDecimal> matchWeighter)

    - #### get

          public List<org.drools.model.view.ViewItem<?>> get()

    - #### getVariables

          public org.drools.model.Variable[] getVariables()

    - #### getConstraintType

          protected static org.drools.model.Index.ConstraintType getConstraintType​(JoinerType type)

    - #### joinViewItemsWithLogicalAnd

          protected static org.drools.model.view.ViewItem<?> joinViewItemsWithLogicalAnd​(org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<?>... patternVariables)