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

## Class DroolsCondition<PatternVar,T extends DroolsRuleStructure<PatternVar>>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.drools.common.DroolsCondition<PatternVar,T>

- Type Parameters:
    `T` - type of Drools rule that we operate on
  Direct Known Subclasses:
    DroolsBiCondition, DroolsQuadCondition, DroolsTriCondition, DroolsUniCondition

      public abstract class DroolsCondition<PatternVar,T extends DroolsRuleStructure<PatternVar>>
      extends Object

  Encapsulates the low-level rule creation and manipulation operations via the Drools executable model DSL (see `PatternDSL`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `DroolsCondition.ImmediatelyPreviousFilter<PredicateType>` When two filters follow one another immediately, we merge them into a new `Predicate`.
    `protected static interface` | `DroolsCondition.Mutator<InTuple,OutPatternVar,R extends DroolsRuleStructure<OutPatternVar>,C extends DroolsCondition<OutPatternVar,R>>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected T` | `ruleStructure`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DroolsCondition(T ruleStructure)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract <InTuple> org.drools.model.PatternDSL.PatternDef<PatternVar>` | `bindTupleVariableOnFirstGrouping(org.drools.model.PatternDSL.PatternDef<PatternVar> pattern, org.drools.model.Variable<InTuple> tupleVariable)`
    `protected <NewA,InTuple,OutTuple,__> DroolsUniCondition<NewA,NewA>` | `collect(DroolsAbstractAccumulateFunction<__,InTuple,OutTuple> accumulateFunctionBridge)`
    `Class[]` | `getExpectedJustificationTypes()`
    `protected org.drools.model.view.ViewItem<?>` | `getInnerAccumulatePattern(org.drools.model.PatternDSL.PatternDef<PatternVar> mainAccumulatePattern)`
    `T` | `getRuleStructure()`
    `protected <NewA,NewB,NewC,InTuple,OutPatternVar> DroolsTriCondition<NewA,NewB,NewC,OutPatternVar>` | `groupBiWithCollect(Supplier<? extends DroolsAbstractGroupByAccumulator<InTuple>> invokerSupplier)`
    `protected <NewA,NewB,NewC,NewD,InTuple,OutPatternVar> DroolsQuadCondition<NewA,NewB,NewC,NewD,OutPatternVar>` | `groupBiWithCollectBi(Supplier<? extends DroolsAbstractGroupByAccumulator<InTuple>> invokerSupplier)`
    `protected <NewA,NewB,InTuple,OutPatternVar> DroolsBiCondition<NewA,NewB,OutPatternVar>` | `groupWithCollect(Supplier<? extends DroolsAbstractGroupByAccumulator<InTuple>> invokerSupplier)`
    `protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void` | `impactScore(DroolsConstraint<?> constraint, org.drools.model.Drools drools, H scoreHolder, BigDecimal impact)`
    `protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void` | `impactScore(DroolsConstraint<?> constraint, org.drools.model.Drools drools, H scoreHolder, int impact)`
    `protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void` | `impactScore(DroolsConstraint<?> constraint, org.drools.model.Drools drools, H scoreHolder, long impact)`
    `protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void` | `impactScore(org.drools.model.Drools drools, H scoreHolder)`

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

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

- - ### Field Detail

    - #### ruleStructure

          protected final T extends DroolsRuleStructure<PatternVar> ruleStructure

  - ### Constructor Detail

    - #### DroolsCondition

          protected DroolsCondition(T ruleStructure)

  - ### Method Detail

    - #### bindTupleVariableOnFirstGrouping

          protected abstract <InTuple> org.drools.model.PatternDSL.PatternDef<PatternVar> bindTupleVariableOnFirstGrouping(org.drools.model.PatternDSL.PatternDef<PatternVar> pattern,
                                                                                                                           org.drools.model.Variable<InTuple> tupleVariable)

    - #### collect

          protected <NewA,InTuple,OutTuple,__> DroolsUniCondition<NewA,NewA> collect(DroolsAbstractAccumulateFunction<__,InTuple,OutTuple> accumulateFunctionBridge)

    - #### groupWithCollect

          protected <NewA,NewB,InTuple,OutPatternVar> DroolsBiCondition<NewA,NewB,OutPatternVar> groupWithCollect(Supplier<? extends DroolsAbstractGroupByAccumulator<InTuple>> invokerSupplier)

    - #### groupBiWithCollect

          protected <NewA,NewB,NewC,InTuple,OutPatternVar> DroolsTriCondition<NewA,NewB,NewC,OutPatternVar> groupBiWithCollect(Supplier<? extends DroolsAbstractGroupByAccumulator<InTuple>> invokerSupplier)

    - #### groupBiWithCollectBi

          protected <NewA,NewB,NewC,NewD,InTuple,OutPatternVar> DroolsQuadCondition<NewA,NewB,NewC,NewD,OutPatternVar> groupBiWithCollectBi(Supplier<? extends DroolsAbstractGroupByAccumulator<InTuple>> invokerSupplier)

    - #### impactScore

          protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void impactScore(org.drools.model.Drools drools,
                                                                                           H scoreHolder)

    - #### impactScore

          protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void impactScore(DroolsConstraint<?> constraint,
                                                                                           org.drools.model.Drools drools,
                                                                                           H scoreHolder,
                                                                                           int impact)

    - #### impactScore

          protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void impactScore(DroolsConstraint<?> constraint,
                                                                                           org.drools.model.Drools drools,
                                                                                           H scoreHolder,
                                                                                           long impact)

    - #### impactScore

          protected <S extends Score<S>,H extends AbstractScoreHolder<S>> void impactScore(DroolsConstraint<?> constraint,
                                                                                           org.drools.model.Drools drools,
                                                                                           H scoreHolder,
                                                                                           BigDecimal impact)

    - #### getInnerAccumulatePattern

          protected org.drools.model.view.ViewItem<?> getInnerAccumulatePattern(org.drools.model.PatternDSL.PatternDef<PatternVar> mainAccumulatePattern)

    - #### getRuleStructure

          public T getRuleStructure()

    - #### getExpectedJustificationTypes

          public Class[] getExpectedJustificationTypes()

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