@Deprecated
public interface Rule<T>
Modifier and Type | Method and Description |
---|---|
FactMap |
getFactMap()
Deprecated.
The getFactMap() method gets the FactMap used for the current Rule.
|
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<FactMap<T>> |
getWhen()
Deprecated.
Method getWhen() gets the
Predicate that evaluates the condition of the Rule. |
Rule<T> |
given(Fact<T>... facts)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Rule<T> |
given(FactMap<T> facts)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Rule<T> |
given(java.util.List<Fact<T>> facts)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Rule<T> |
given(java.lang.String name,
T value)
Deprecated.
The given() method sets the Facts to be used by the Rule.
|
Rule<T> |
givenUnTyped(FactMap facts)
Deprecated.
The givenUnTyped method sets an untyped FactMap.
|
default void |
run()
Deprecated.
The run() method evaluates the Rule.
|
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<T> rule)
Deprecated.
The setNextRule method adds the next Rule to the chain.
|
Rule<T> |
stop()
Deprecated.
Stops the rule chain after the then() method executes.
Note: this will only happen if the when() condition evaluates to true. |
Rule<T> |
then(java.util.function.Consumer<FactMap<T>> 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. |
Rule<T> |
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.
|
Rule<T> |
when(java.util.function.Predicate<FactMap<T>> test)
Deprecated.
The when() method takes in a
Predicate that evaluates the facts against a condition. |
void run(java.lang.Object... otherArgs)
otherArgs
- additional arguments to be passed to the Rule action(s)default void run()
Rule<T> given(java.lang.String name, T value)
name
- name of the Factvalue
- object provided as the Fact with the given nameRule<T> given(Fact<T>... facts)
facts
- Facts to be used by the RuleRule<T> given(java.util.List<Fact<T>> facts)
facts
- a List of Facts to be used by the RuleRule<T> given(FactMap<T> facts)
facts
- a FactMap
Rule<T> givenUnTyped(FactMap facts)
facts
- a FactMap
FactMap getFactMap()
java.util.function.Predicate<FactMap<T>> getWhen()
Predicate
that evaluates the condition of the Rule.Rule<T> when(java.util.function.Predicate<FactMap<T>> test)
Predicate
that evaluates the facts against a condition.test
- the condition(s) to be evaluated against the FactsRule<T> then(java.util.function.Consumer<FactMap<T>> action)
action
- the action to be performedRule<T> stop()
Rule<T> using(java.lang.String... factName)
factName
- the name of the Fact value to be used by the then() method.java.util.List<java.lang.Object> getThen()