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

## Class DroolsUniRuleStructure<A>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.drools.common.DroolsRuleStructure
  - - org.optaplanner.core.impl.score.stream.drools.uni.DroolsUniRuleStructure<A>

-     public class DroolsUniRuleStructure<A>
      extends DroolsRuleStructure

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DroolsUniRuleStructure(Class<A> aClass, LongSupplier varialeIdSupplier)`
    `DroolsUniRuleStructure(org.drools.model.Variable<A> aVariable, DroolsPatternBuilder<?> aPattern, List<org.drools.model.RuleItemBuilder<?>> openRuleItems, List<org.drools.model.RuleItemBuilder<?>> closedRuleItems, LongSupplier variableIdSupplier)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DroolsUniRuleStructure<A>` | `amend(UnaryOperator<org.drools.model.PatternDSL.PatternDef<Object>> expander)` Add another condition on the primary pattern without changing anything else about the rule.
    `org.drools.model.Variable<A>` | `getA()`
    `List<org.drools.model.RuleItemBuilder<?>>` | `getClosedRuleItems()`
    `List<org.drools.model.RuleItemBuilder<?>>` | `getOpenRuleItems()` Every other pattern necessary for the `DroolsRuleStructure.getPrimaryPattern()` to function properly within the Drools rule's left-hand side.
    `DroolsPatternBuilder<Object>` | `getPrimaryPattern()` Returns the pattern that the subsequent streams may further expand.

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

      `createVariable, createVariable, createVariable, createVariable, finish, getVariableIdSupplier, recollect, regroup, regroupBi, regroupBiToQuad, regroupBiToTri`

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

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

- - ### Constructor Detail

    - #### DroolsUniRuleStructure

          public DroolsUniRuleStructure(org.drools.model.Variable<A> aVariable,
                                        DroolsPatternBuilder<?> aPattern,
                                        List<org.drools.model.RuleItemBuilder<?>> openRuleItems,
                                        List<org.drools.model.RuleItemBuilder<?>> closedRuleItems,
                                        LongSupplier variableIdSupplier)

    - #### DroolsUniRuleStructure

          public DroolsUniRuleStructure(Class<A> aClass,
                                        LongSupplier varialeIdSupplier)

  - ### Method Detail

    - #### getA

          public org.drools.model.Variable<A> getA()

    - #### getPrimaryPattern

          public DroolsPatternBuilder<Object> getPrimaryPattern()

      Description copied from class: `DroolsRuleStructure`
      Returns the pattern that the subsequent streams may further expand. Consider the following left-hand side of a Drools rule:

               $a1: A()
               $a2: A(this != $a1)

      The primary pattern would be the latter one ($a2), as that is the pattern you would use to further expand your output in both $a1 and $a2.
      Specified by:
        `getPrimaryPattern` in class `DroolsRuleStructure`
      Returns:
        the primary pattern as defined

    - #### getOpenRuleItems

          public List<org.drools.model.RuleItemBuilder<?>> getOpenRuleItems()

      Description copied from class: `DroolsRuleStructure`
      Every other pattern necessary for the `DroolsRuleStructure.getPrimaryPattern()` to function properly within the Drools rule's left-hand side. In the example rule (see `DroolsRuleStructure.getPrimaryPattern()`, this method would return one and only open `RuleItemBuilder`, the one representing $a1.
      Specified by:
        `getOpenRuleItems` in class `DroolsRuleStructure`
      Returns:
        all open rule items as defined, in the correct order

    - #### getClosedRuleItems

          public List<org.drools.model.RuleItemBuilder<?>> getClosedRuleItems()

      Specified by:
        `getClosedRuleItems` in class `DroolsRuleStructure`

    - #### amend

          public DroolsUniRuleStructure<A> amend(UnaryOperator<org.drools.model.PatternDSL.PatternDef<Object>> expander)

      Add another condition on the primary pattern without changing anything else about the rule.
      Parameters:
        `expander` -
      Returns:

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