Module org.evrete.core
Package org.evrete.api.builders
Interface RuleBuilder<C extends RuntimeContext<C>>
- Type Parameters:
C- the type of theRuntimeContextof the builder
- All Superinterfaces:
Environment,FluentEnvironment<RuleBuilder<C>>,LhsFactSelector<LhsBuilder<C>>,Named,NamedType.Resolver,Rule
public interface RuleBuilder<C extends RuntimeContext<C>>
extends Rule, LhsFactSelector<LhsBuilder<C>>, FluentEnvironment<RuleBuilder<C>>
The RuleBuilder interface represents a builder for creating rules.
-
Method Summary
Modifier and TypeMethodDescriptionexecute()Terminates current rule builder as a rule without action.Terminates current rule builder with the provided RHS actionexecute(Consumer<RhsContext> consumer) Terminates current rule builder with the provided RHS actionReturns a non-fluent API for adding conditions and obtain theirEvaluatorHandlehandles.getLhs()Returns the LhsBuilder instance.Returns the runtime context of this rule builder.salience(int salience) Sets the salience of the rule.Methods inherited from interface org.evrete.api.Environment
get, get, getPropertyNamesMethods inherited from interface org.evrete.api.FluentEnvironment
setMethods inherited from interface org.evrete.api.LhsFactSelector
forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEachMethods inherited from interface org.evrete.api.NamedType.Resolver
getDeclaredFactTypes, resolveMethods inherited from interface org.evrete.api.Rule
chainRhs, getRhs, getSalience, setName, setRhs, setRhs, setSalience
-
Method Details
-
getLhs
LhsBuilder<C> getLhs()Returns the LhsBuilder instance.- Returns:
- the LhsBuilder instance
-
salience
Sets the salience of the rule.- Parameters:
salience- the salience value of the rule- Returns:
- a RuleBuilder instance
-
getRuntime
C getRuntime()Returns the runtime context of this rule builder.- Returns:
- the runtime object
-
execute
RuleSetBuilder<C> execute()Terminates current rule builder as a rule without action.
- Returns:
- returns the current ruleset builder
-
execute
Terminates current rule builder with the provided RHS action
- Parameters:
consumer- RHS- Returns:
- returns the current ruleset builder
-
execute
Terminates current rule builder with the provided RHS action
- Parameters:
literalRhs- RHS action as Java code- Returns:
- returns the current ruleset builder
-
getConditionManager
ConditionManager getConditionManager()Returns a non-fluent API for adding conditions and obtain theirEvaluatorHandlehandles.- See Also:
-