Interface LhsBuilder<C extends RuntimeContext<C>>

Type Parameters:
C - the type of the RuntimeContext of the builder
All Superinterfaces:
NamedType.Resolver

public interface LhsBuilder<C extends RuntimeContext<C>> extends NamedType.Resolver
The LhsBuilder interface is used to build the left-hand side (LHS) of a rule.
  • Method Details

    • execute

      RuleSetBuilder<C> execute(String literalRhs)

      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

      RuleSetBuilder<C> execute(Consumer<RhsContext> consumer)

      Terminates current rule builder with the provided RHS action

      Parameters:
      consumer - RHS
      Returns:
      returns the current ruleset builder
    • where

      default LhsBuilder<C> where(String... expressions)
    • where

      LhsBuilder<C> where(EvaluatorHandle... expressions)
      Adds one or more condition expressions to the current LhsBuilder.
      Parameters:
      expressions - the condition expressions to add
      Returns:
      the current LhsBuilder
    • where

      LhsBuilder<C> where(String expression, double complexity)
      Adds a condition expression to the current LhsBuilder.
      Parameters:
      expression - the condition expression to add
      complexity - the complexity of the condition expression
      Returns:
      the current LhsBuilder
    • where

      LhsBuilder<C> where(Predicate<Object[]> predicate, double complexity, String... references)
      Adds a condition to the current LhsBuilder with the provided predicate, complexity, and references.
      Parameters:
      predicate - the predicate to add as a condition
      complexity - the complexity of the condition
      references - the references used in the condition
      Returns:
      the current LhsBuilder
    • where

      default LhsBuilder<C> where(Predicate<Object[]> predicate, String... references)
      Adds a condition to the current LhsBuilder with the provided predicate, default complexity, and references.
      Parameters:
      predicate - the predicate to add as a condition
      references - the references used in the condition
      Returns:
      the current LhsBuilder
    • where

      LhsBuilder<C> where(ValuesPredicate predicate, double complexity, String... references)
      Adds a condition to the current LhsBuilder with the provided predicate, complexity, and references.
      Parameters:
      predicate - the predicate to add as a condition
      complexity - the complexity of the condition
      references - the references used in the condition
      Returns:
      the current LhsBuilder
    • where

      default LhsBuilder<C> where(ValuesPredicate predicate, String... references)
    • where

      LhsBuilder<C> where(Predicate<Object[]> predicate, double complexity, FieldReference... references)
    • where

      default LhsBuilder<C> where(Predicate<Object[]> predicate, FieldReference... references)
    • where

      LhsBuilder<C> where(ValuesPredicate predicate, double complexity, FieldReference... references)
    • where

      default LhsBuilder<C> where(ValuesPredicate predicate, FieldReference... references)
    • addFactDeclaration

      NamedType addFactDeclaration(String name, Type<?> type)
    • addFactDeclaration

      NamedType addFactDeclaration(String name, String type)
    • addFactDeclaration

      NamedType addFactDeclaration(String name, Class<?> type)