Constructor and Description |
---|
StandardDecision(java.lang.Class<T> factClazz,
java.lang.Class<U> resultClazz)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static StandardDecision<java.lang.Object,java.lang.Object> |
create()
Deprecated.
This create() method is another convenience method to create a non-type specific StandardDecision.
|
static <T,U> StandardDecision<T,U> |
create(java.lang.Class<T> factType,
java.lang.Class<U> resultType)
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.
|
U |
getResult()
Deprecated.
The getResult() method gets the stored Result value from the execution of the StandardDecision.
|
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. |
Decision<T,U> |
given(Fact<T>... facts)
Deprecated.
The given() method accepts Facts for the StandardDecision.
|
Decision<T,U> |
given(FactMap<T> facts)
Deprecated.
The given() method accepts Facts for the StandardDecision.
|
Decision<T,U> |
given(java.util.List<Fact<T>> facts)
Deprecated.
The given() method accepts Facts for the StandardDecision.
|
Decision<T,U> |
given(java.lang.String name,
T value)
Deprecated.
The given() method accepts a name/value pair to be used as a Fact.
|
Decision<T,U> |
givenUnTyped(FactMap facts)
Deprecated.
The givenUnTyped method sets an untyped FactMap.
|
void |
run(java.lang.Object... args)
Deprecated.
The run() method runs the
Predicate supplied by the when() method.If it evaluates to true then the BiConsumer (s) and Consumer (s) supplied by the then() method(s)
are executed.If the stop() method was invoked then no further rules are evaluated. Otherwise, the next rule in the chain is evaluated. |
void |
setNextRule(Rule<T> rule)
Deprecated.
The setNextRule() method sets the next rule in the chain.
|
void |
setResult(Result<U> result)
Deprecated.
The setResult() method sets the stored Result.
|
Decision<T,U> |
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.
|
Decision<T,U> |
then(java.util.function.BiConsumer<FactMap<T>,Result<U>> action)
Deprecated.
|
Decision<T,U> |
then(java.util.function.Consumer<FactMap<T>> action)
Deprecated.
The then() method accepts a
Consumer that performs an action based on Facts. |
Decision<T,U> |
using(java.lang.String... factNames)
Deprecated.
The using() method reduces the facts to those specifically named here.
|
Decision<T,U> |
when(java.util.function.Predicate<FactMap<T>> test)
Deprecated.
The when() method accepts a
Predicate that returns true or false based on Facts. |
public static <T,U> StandardDecision<T,U> create(java.lang.Class<T> factType, java.lang.Class<U> resultType)
T
- the class type of the objects in the Facts usedU
- the class type of object stored in the ResultfactType
- the type of object stored in facts for this DecisionresultType
- the type of object stored in the Resultpublic static StandardDecision<java.lang.Object,java.lang.Object> create()
public void run(java.lang.Object... args)
Predicate
supplied by the when() method.BiConsumer
(s) and Consumer
(s) supplied by the then() method(s)
are executed.public Decision<T,U> given(java.lang.String name, T value)
public Decision<T,U> given(Fact<T>... facts)
public Decision<T,U> given(java.util.List<Fact<T>> facts)
public Decision<T,U> given(FactMap<T> facts)
public Decision<T,U> givenUnTyped(FactMap facts)
Rule
givenUnTyped
in interface Decision<T,U>
givenUnTyped
in interface Rule<T>
facts
- a FactMap
public FactMap getFactMap()
Rule
getFactMap
in interface Rule<T>
public Decision<T,U> when(java.util.function.Predicate<FactMap<T>> test)
Predicate
that returns true or false based on Facts.public Decision<T,U> then(java.util.function.BiConsumer<FactMap<T>,Result<U>> action)
public Decision<T,U> then(java.util.function.Consumer<FactMap<T>> action)
Consumer
that performs an action based on Facts.public Decision<T,U> stop()
public Decision<T,U> 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 U getResult()
public void setResult(Result<U> result)
public java.util.function.Predicate<FactMap<T>> getWhen()
Predicate
to be used for the condition of the Rule.