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

## Class DroolsUniCondition<A>

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

-     public final class DroolsUniCondition<A>
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DroolsUniCondition(<any> aVariableDeclaration, Function<<any>,<any>> patternProvider)`
    `DroolsUniCondition(Class<A> aVariableType)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DroolsUniCondition<A>` | `andFilter(Predicate<A> predicate)`
    `<B> DroolsBiCondition<A,B>` | `andJoin(DroolsUniCondition<B> bCondition, AbstractBiJoiner<A,B> biJoiner)`
    `<GroupKey_> List<<any>>` | `completeWithLogicalInsert(Object ruleId, Function<A,GroupKey_> groupKeyMapping)`
    `<ResultContainer,NewA,NewB> List<<any>>` | `completeWithLogicalInsert(Object ruleId, Function<A,NewA> groupKeyMapping, UniConstraintCollector<A,ResultContainer,NewB> collector)` The goal of this method is to create the left-hand side of a rule to look like this: when accumulate(Person(), $set: collectSet(Person::getCity)) $newA : City() from $set // grouping accumulate(Person(getCity() == $newA), $newB: collect(ConstraintCollectors.count())) then insertLogical($newA, $newB); end Note: This is pseudo-code and the actual Drools code will look slightly different in terms of syntax.
    `<ResultContainer,NewA> List<<any>>` | `completeWithLogicalInsert(Object ruleId, UniConstraintCollector<A,ResultContainer,NewA> collector)`
    `List<<any>>` | `completeWithScoring(<any> scoreHolderGlobal)`
    `List<<any>>` | `completeWithScoring(<any> scoreHolderGlobal, Function<A,BigDecimal> matchWeighter)`
    `List<<any>>` | `completeWithScoring(<any> scoreHolderGlobal, ToIntFunction<A> matchWeighter)`
    `List<<any>>` | `completeWithScoring(<any> scoreHolderGlobal, ToLongFunction<A> matchWeighter)`
    `DroolsMetadata<Object,A>` | `getAMetadata()`
    `static Index.ConstraintType` | `getConstraintType(JoinerType type)`

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

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

- - ### Constructor Detail

    - #### DroolsUniCondition

          public DroolsUniCondition(Class<A> aVariableType)

    - #### DroolsUniCondition

          public DroolsUniCondition(<any> aVariableDeclaration,
                                    Function<<any>,<any>> patternProvider)

  - ### Method Detail

    - #### getAMetadata

          public DroolsMetadata<Object,A> getAMetadata()

    - #### andFilter

          public DroolsUniCondition<A> andFilter(Predicate<A> predicate)

    - #### andJoin

          public <B> DroolsBiCondition<A,B> andJoin(DroolsUniCondition<B> bCondition,
                                                    AbstractBiJoiner<A,B> biJoiner)

    - #### completeWithLogicalInsert

          public <ResultContainer,NewA,NewB> List<<any>> completeWithLogicalInsert(Object ruleId,
                                                                                   Function<A,NewA> groupKeyMapping,
                                                                                   UniConstraintCollector<A,ResultContainer,NewB> collector)

      The goal of this method is to create the left-hand side of a rule to look like this:

           when
               accumulate(Person(), $set: collectSet(Person::getCity))
               $newA : City() from $set // grouping
               accumulate(Person(getCity() == $newA), $newB: collect(ConstraintCollectors.count()))
           then
               insertLogical($newA, $newB);
           end

      Note: This is pseudo-code and the actual Drools code will look slightly different in terms of syntax.
      Type Parameters:
        `ResultContainer` - implementation detail, unimportant
        `NewA` - type of the first logical fact
        `NewB` - type of the second logical fact
      Parameters:
        `ruleId` - never null, id of the context in which the new facts will be inserted
        `groupKeyMapping` - never null, grouping to apply
        `collector` - never null, collector to apply
      Returns:

    - #### completeWithLogicalInsert

          public <ResultContainer,NewA> List<<any>> completeWithLogicalInsert(Object ruleId,
                                                                              UniConstraintCollector<A,ResultContainer,NewA> collector)

    - #### completeWithLogicalInsert

          public <GroupKey_> List<<any>> completeWithLogicalInsert(Object ruleId,
                                                                   Function<A,GroupKey_> groupKeyMapping)

    - #### completeWithScoring

          public List<<any>> completeWithScoring(<any> scoreHolderGlobal)

    - #### completeWithScoring

          public List<<any>> completeWithScoring(<any> scoreHolderGlobal,
                                                 ToIntFunction<A> matchWeighter)

    - #### completeWithScoring

          public List<<any>> completeWithScoring(<any> scoreHolderGlobal,
                                                 ToLongFunction<A> matchWeighter)

    - #### completeWithScoring

          public List<<any>> completeWithScoring(<any> scoreHolderGlobal,
                                                 Function<A,BigDecimal> matchWeighter)

    - #### getConstraintType

          public static Index.ConstraintType getConstraintType(JoinerType type)

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