Module org.evrete.core
Package org.evrete.api.builders
Interface LhsBuilder<C extends RuntimeContext<C>>
- Type Parameters:
C- the type of theRuntimeContextof the builder
- All Superinterfaces:
NamedType.Resolver
The LhsBuilder interface is used to build the left-hand side (LHS) of a rule.
-
Method Summary
Modifier and TypeMethodDescriptionaddFactDeclaration(String name, Class<?> type) addFactDeclaration(String name, String type) addFactDeclaration(String name, Type<?> type) execute()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 actiondefault LhsBuilder<C>Adds a condition expression to the current LhsBuilder.Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and references.where(Predicate<Object[]> predicate, double complexity, FieldReference... references) default LhsBuilder<C>Adds a condition to the currentLhsBuilderwith the provided predicate, default complexity, and references.default LhsBuilder<C>where(Predicate<Object[]> predicate, FieldReference... references) where(EvaluatorHandle... expressions) Adds one or more condition expressions to the currentLhsBuilder.where(ValuesPredicate predicate, double complexity, String... references) Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and references.where(ValuesPredicate predicate, double complexity, FieldReference... references) default LhsBuilder<C>where(ValuesPredicate predicate, String... references) default LhsBuilder<C>where(ValuesPredicate predicate, FieldReference... references) Methods inherited from interface org.evrete.api.NamedType.Resolver
getDeclaredFactTypes, resolve
-
Method Details
-
execute
Terminates current rule builder with the provided RHS action
- Parameters:
literalRhs- RHS action as Java code- Returns:
- returns the current ruleset builder
-
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
-
where
-
where
Adds one or more condition expressions to the currentLhsBuilder.- Parameters:
expressions- the condition expressions to add- Returns:
- the current
LhsBuilder
-
where
Adds a condition expression to the current LhsBuilder.- Parameters:
expression- the condition expression to addcomplexity- the complexity of the condition expression- Returns:
- the current
LhsBuilder
-
where
Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and references.- Parameters:
predicate- the predicate to add as a conditioncomplexity- the complexity of the conditionreferences- the references used in the condition- Returns:
- the current
LhsBuilder
-
where
Adds a condition to the currentLhsBuilderwith the provided predicate, default complexity, and references.- Parameters:
predicate- the predicate to add as a conditionreferences- the references used in the condition- Returns:
- the current
LhsBuilder
-
where
Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and references.- Parameters:
predicate- the predicate to add as a conditioncomplexity- the complexity of the conditionreferences- the references used in the condition- Returns:
- the current
LhsBuilder
-
where
-
where
-
where
-
where
-
where
-
addFactDeclaration
-
addFactDeclaration
-
addFactDeclaration
-