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) Adds a fact declaration to the current LhsBuilder.addFactDeclaration(String name, String type) Adds a fact declaration to the current LhsBuilder.addFactDeclaration(String name, Type<?> type) Adds a fact declaration to the current LhsBuilder.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 one or more condition expressions to the currentLhsBuilder.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) Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field 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) Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field 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 field references.where(ValuesPredicate predicate, double complexity, FieldReference... references) Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field references.default LhsBuilder<C>where(ValuesPredicate predicate, String... references) Adds a condition to the currentLhsBuilderwith the provided predicate and field references.default LhsBuilder<C>where(ValuesPredicate predicate, FieldReference... references) Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field 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
Adds one or more condition expressions to the currentLhsBuilder.- Parameters:
expressions- the condition expressions to add- Returns:
- the current
LhsBuilder
-
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 field 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 and field 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 field 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 - Throws:
NullPointerException- if the predicate is nullNullPointerException- if any of the references is null
-
where
Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field references.- Parameters:
predicate- the predicate to add as a conditionreferences- the references used in the condition- Returns:
- the current
LhsBuilder - Throws:
NullPointerException- if the predicate is nullNullPointerException- if any of the references is null
-
where
Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field 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 - Throws:
NullPointerException- if the predicate is nullNullPointerException- if any of the references is null
-
where
Adds a condition to the currentLhsBuilderwith the provided predicate, complexity, and field references.- Parameters:
predicate- the predicate to add as a conditionreferences- the references used in the condition- Returns:
- the current
LhsBuilder - Throws:
NullPointerException- if the predicate is nullNullPointerException- if any of the references is null
-
addFactDeclaration
Adds a fact declaration to the current LhsBuilder.- Parameters:
name- the name of the fact declarationtype- the type of the fact declaration- Returns:
- the NamedType representing the fact declaration
- Throws:
NullPointerException- if either the name or type parameter is null
-
addFactDeclaration
Adds a fact declaration to the current LhsBuilder.- Parameters:
name- the name of the fact declarationtype- the type of the fact declaration- Returns:
- the NamedType representing the fact declaration
- Throws:
NullPointerException- if either the name or type parameter is null
-
addFactDeclaration
Adds a fact declaration to the current LhsBuilder.- Parameters:
name- the name of the fact declarationtype- the type of the fact declaration- Returns:
- the NamedType representing the fact declaration
- Throws:
NullPointerException- if either the name or type parameter is null
-