Modifier | Constructor and Description |
---|---|
protected |
StandardRule()
Deprecated.
|
|
StandardRule(java.lang.Class<T> clazz)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static StandardRule<java.lang.Object> |
create()
Deprecated.
This create() method is a convenience method to create a non-type specific StandardRule.
|
static <T> StandardRule<T> |
create(java.lang.Class<T> factType)
Deprecated.
This create() method is a convenience method to avoid using new and generic syntax.
|
FactMap |
getFactMap()
Deprecated.
The getFactMap() method gets the FactMap used for the current Rule.
|
java.util.List<java.lang.Object> |
getThen()
Deprecated.
The getThen() method returns a
List of Consumer objects that combined
together in sequence represent the then() action(s). |
java.util.function.Predicate<FactMap<T>> |
getWhen()
Deprecated.
The getWhen() method returns the
Predicate to be used for the condition of the Rule. |
Rule<T> |
given(Fact<T>... facts)
Deprecated.
The given() method accepts Facts to be evaluated in the Rule.
|
Rule<T> |
given(FactMap<T> facts)
Deprecated.
The given() method accepts Facts to be evaluated in the Rule.
|
Rule<T> |
given(java.util.List<Fact<T>> facts)
Deprecated.
The given() method accepts Facts to be evaluated in the Rule.
|
Rule<T> |
given(java.lang.String name,
T value)
Deprecated.
The given() method accepts a name/value pair to be used as a Fact.
|
Rule<T> |
givenUnTyped(FactMap facts)
Deprecated.
The givenUnTyped method sets an untyped FactMap.
|
void |
run(java.lang.Object... otherArgs)
Deprecated.
The run(Object[]) method runs the
Predicate supplied by the when() method. |
void |
setNextRule(Rule<T> rule)
Deprecated.
The setNextRule() method sets the next Rule in the chain.
|
Rule<T> |
stop()
Deprecated.
The stop() method causes the rule chain to stop if the when() condition true and only
after the then() actions have been executed.
|
Rule<T> |
then(java.util.function.Consumer<FactMap<T>> action)
Deprecated.
The then() method accepts a
Consumer that performs an action based on Facts. |
StandardRule<T> |
using(java.lang.String... factNames)
Deprecated.
The using() method reduces the facts to those specifically named here.
|
Rule<T> |
when(java.util.function.Predicate<FactMap<T>> test)
Deprecated.
The when() method accepts a
Predicate that returns true or false based on Facts. |
protected StandardRule()
public StandardRule(java.lang.Class<T> clazz)
public static <T> StandardRule<T> create(java.lang.Class<T> factType)
T
- the type of FactfactType
- the type of object stored in facts for this Rulepublic static StandardRule<java.lang.Object> create()
public void run(java.lang.Object... otherArgs)
Predicate
supplied by the when() method. public Rule<T> given(java.lang.String name, T value)
public Rule<T> given(Fact<T>... facts)
public Rule<T> given(java.util.List<Fact<T>> facts)
public Rule<T> given(FactMap<T> facts)
public Rule<T> givenUnTyped(FactMap facts)
Rule
givenUnTyped
in interface Rule<T>
facts
- a FactMap
public FactMap getFactMap()
Rule
getFactMap
in interface Rule<T>
public Rule<T> when(java.util.function.Predicate<FactMap<T>> test)
Predicate
that returns true or false based on Facts.public Rule<T> then(java.util.function.Consumer<FactMap<T>> action)
Consumer
that performs an action based on Facts.public Rule<T> stop()
public StandardRule<T> using(java.lang.String... factNames)
public void setNextRule(Rule<T> rule)
setNextRule
in interface Rule<T>
rule
- the next Rule to add to the chainpublic java.util.function.Predicate<FactMap<T>> getWhen()
Predicate
to be used for the condition of the Rule.