| Constructor and Description |
|---|
RuleAdapter(java.lang.Object rulePojo)
Deprecated.
|
RuleAdapter(java.lang.Object rulePojo,
Rule rule)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
FactMap |
getFactMap()
Deprecated.
The getFactMap() method gets the FactMap used for the current Rule.
|
java.lang.Object |
getResult()
Deprecated.
The
getResult() method returns the stored result from the Decision
The value may be null. |
java.util.List<java.lang.Object> |
getThen()
Deprecated.
Method getThen() gets the instance(s) of the functional interface(s) responsible for the action to be performed by
the Rule.
|
java.util.function.Predicate |
getWhen()
Deprecated.
Method getWhen() gets the
Predicate that evaluates the condition of the Rule. |
Decision |
given(Fact... facts)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Decision |
given(FactMap facts)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Decision |
given(java.util.List list)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Decision |
given(java.lang.String name,
java.lang.Object value)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Decision |
givenUnTyped(FactMap facts)
Deprecated.
The givenUnTyped method sets an untyped FactMap.
|
void |
run(java.lang.Object... otherArgs)
Deprecated.
This run() method allows for arguments in addition to the FactMap to be passed to the action(s).
|
void |
setNextRule(Rule rule)
Deprecated.
The setNextRule method adds the next Rule to the chain.
|
void |
setResult(Result result)
Deprecated.
The
setResult() method initializes the stored result; useful for aggregation/chaining of a result. |
Decision |
stop()
Deprecated.
Stops the rule chain after the then() method executes.
Note: this will only happen if the when() condition evaluates to true. |
Decision |
then(java.util.function.BiConsumer action)
Deprecated.
The then method specifies the action taken if
when() evaluates to true. |
Decision |
then(java.util.function.Consumer action)
Deprecated.
The then() method performs some action based on facts.
This then() method does not imply a return value, only that the next chained then() is executed. |
Decision |
using(java.lang.String... factName)
Deprecated.
The using() method reduces the Facts used by the then() method to only the value of the Fact specified
by the factName.
|
Decision |
when(java.util.function.Predicate test)
Deprecated.
The when() method takes in a
Predicate that evaluates the facts against a condition. |
public RuleAdapter(java.lang.Object rulePojo,
Rule rule)
throws java.io.InvalidClassException
rulePojo - an annotated POJO to be adapted to a rulerule - the Rule object delegated to for the adaptationjava.io.InvalidClassException - if the POJO does not have the @Rule annotationpublic RuleAdapter(java.lang.Object rulePojo)
throws java.io.InvalidClassException
Rule annotated POJO
and adapts it to a Rule or Decision.
This convenience constructor supplies a generic StandardRule to RuleAdapter(Object, Rule).rulePojo - an annotated POJO to be adapted to a rulejava.io.InvalidClassException - if the POJO does not have the @Rule annotationpublic Decision given(Fact... facts)
Rulepublic Decision given(java.util.List list)
Rulepublic Decision given(FactMap facts)
Rulepublic Decision given(java.lang.String name, java.lang.Object value)
Rulepublic Decision givenUnTyped(FactMap facts)
RulegivenUnTyped in interface DecisiongivenUnTyped in interface Rulefacts - a FactMappublic java.util.function.Predicate getWhen()
RulePredicate that evaluates the condition of the Rule.public java.util.List<java.lang.Object> getThen()
Rulepublic void run(java.lang.Object... otherArgs)
Rulepublic Decision when(java.util.function.Predicate test)
RulePredicate that evaluates the facts against a condition.public Decision then(java.util.function.Consumer action)
Rulepublic Decision then(java.util.function.BiConsumer action)
Decisionwhen() evaluates to true.
The execution of this 'then' takes precedence over then(Function) if both exist.public Decision using(java.lang.String... factName)
Rulepublic Decision stop()
Rulepublic java.lang.Object getResult()
DecisiongetResult() method returns the stored result from the Decision
The value may be null.public void setResult(Result result)
DecisionsetResult() method initializes the stored result; useful for aggregation/chaining of a result.public FactMap getFactMap()
RulegetFactMap in interface Rulepublic void setNextRule(Rule rule)
RulesetNextRule in interface Rulerule - the next Rule to add to the chain