@Deprecated
public abstract class RuleBook<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Fact<T>> |
_facts
Deprecated.
|
protected java.util.Optional<Rule<T>> |
_headRule
Deprecated.
|
protected Rule<T> |
_tailRule
Deprecated.
|
Constructor and Description |
---|
RuleBook()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addRule(Rule<T> rule)
Deprecated.
The addRule() method adds a rule to the end of the Rules chain.
|
protected abstract void |
defineRules()
Deprecated.
this is where the rules can be specified in the subclass; it will be executed by run().
|
RuleBook<T> |
given(Fact<T>... facts)
Deprecated.
The given() method accepts the Facts for this RuleBook.
|
RuleBook<T> |
given(java.lang.String name,
T value)
Deprecated.
The given() method accepts a key/value pair as a Fact for this RuleBook.
|
void |
run()
Deprecated.
The run() method adds the rules [via defineRules()] and runs the rules as long as at least one rule was
added.
|
public final void run()
@SafeVarargs public final RuleBook<T> given(Fact<T>... facts)
facts
- Facts to be added to the RuleBook and applied to all the Rules in the RuleBookpublic RuleBook<T> given(java.lang.String name, T value)
name
- the name of the Factvalue
- the value of the Factpublic void addRule(Rule<T> rule)
rule
- the Rule to be addedprotected abstract void defineRules()