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

## Class DroolsAbstractConstraintStream<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream<Solution_>
  - - org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream<Solution_>

- All Implemented Interfaces:
    ConstraintStream
  Direct Known Subclasses:
    DroolsAbstractBiConstraintStream, DroolsAbstractQuadConstraintStream, DroolsAbstractTriConstraintStream, DroolsAbstractUniConstraintStream

      public abstract class DroolsAbstractConstraintStream<Solution_>
      extends AbstractConstraintStream<Solution_>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DroolsConstraintFactory<Solution_>` | `constraintFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DroolsAbstractConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChildStream(DroolsAbstractConstraintStream<Solution_> childStream)`
    `protected DroolsConstraint<Solution_>` | `buildConstraint(String constraintPackage, String constraintName, Score<?> constraintWeight, boolean positive, DroolsAbstractConstraintStream<Solution_> scoringStream)`
    `protected DroolsConstraint<Solution_>` | `buildConstraintConfigurable(String constraintPackage, String constraintName, boolean positive, DroolsAbstractConstraintStream<Solution_> scoringStream)`
    `List<org.drools.model.RuleItemBuilder<?>>` | `createRuleItemBuilders(org.drools.model.Global<? extends AbstractScoreHolder<?>> scoreHolderGlobal)` Assemble elements of the rule that will process this stream and turn it into a constraint match.
    `Collection<DroolsAbstractConstraintStream<Solution_>>` | `getChildStreams()`
    `DroolsConstraintFactory<Solution_>` | `getConstraintFactory()` The `ConstraintFactory` that build this.
    `abstract List<DroolsFromUniConstraintStream<Solution_,Object>>` | `getFromStreamList()`
    `abstract boolean` | `isGroupByAllowed()`
    `protected void` | `throwWhenGroupByNotAllowed()`

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

      `buildConstraintWeightExtractor, buildConstraintWeightExtractor, impactScore, impactScoreConfigurable, penalize, penalizeConfigurable, reward, rewardConfigurable, validateConstraintId`

    - ### 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.ConstraintStream

      `penalize, penalizeConfigurable, reward, rewardConfigurable`

- - ### Field Detail

    - #### constraintFactory

          protected final DroolsConstraintFactory<Solution_> constraintFactory

  - ### Constructor Detail

    - #### DroolsAbstractConstraintStream

          public DroolsAbstractConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory)

  - ### Method Detail

    - #### buildConstraint

          protected DroolsConstraint<Solution_> buildConstraint(String constraintPackage,
                                                                String constraintName,
                                                                Score<?> constraintWeight,
                                                                boolean positive,
                                                                DroolsAbstractConstraintStream<Solution_> scoringStream)

    - #### buildConstraintConfigurable

          protected DroolsConstraint<Solution_> buildConstraintConfigurable(String constraintPackage,
                                                                            String constraintName,
                                                                            boolean positive,
                                                                            DroolsAbstractConstraintStream<Solution_> scoringStream)

    - #### getFromStreamList

          public abstract List<DroolsFromUniConstraintStream<Solution_,Object>> getFromStreamList()

    - #### addChildStream

          public void addChildStream(DroolsAbstractConstraintStream<Solution_> childStream)

    - #### getChildStreams

          public Collection<DroolsAbstractConstraintStream<Solution_>> getChildStreams()

    - #### createRuleItemBuilders

          public List<org.drools.model.RuleItemBuilder<?>> createRuleItemBuilders(org.drools.model.Global<? extends AbstractScoreHolder<?>> scoreHolderGlobal)

      Assemble elements of the rule that will process this stream and turn it into a constraint match. Will be ignored unless on a scoring stream such as `DroolsScoringUniConstraintStream`.
      Parameters:
        `scoreHolderGlobal` - contains the score to be affected
      Returns:
        rule representing this constraint stream

    - #### isGroupByAllowed

          public abstract boolean isGroupByAllowed()

      Returns:
        true when a groupBy() call is supported on this stream.

    - #### throwWhenGroupByNotAllowed

          protected void throwWhenGroupByNotAllowed()

    - #### getConstraintFactory

          public DroolsConstraintFactory<Solution_> getConstraintFactory()

      Description copied from interface: `ConstraintStream`
      The `ConstraintFactory` that build this.
      Specified by:
        `getConstraintFactory` in interface `ConstraintStream`
      Specified by:
        `getConstraintFactory` in class `AbstractConstraintStream<Solution_>`
      Returns:
        never null

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