Interface RuleSet<R extends Rule>

Type Parameters:
R - rule type parameter
All Superinterfaces:
Named
All Known Subinterfaces:
Knowledge, RuleSession<S>, RuleSetContext<C,R>, StatefulSession, StatelessSession
All Known Implementing Classes:
AbstractSessionWrapper, KnowledgeWrapper

public interface RuleSet<R extends Rule> extends Named

Interface describes a mutable collection of rules. Both Knowledge and RuleSession are extending this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves a rule based on its name.
    default R
    getRule(Named named)
    Retrieves a rule based on the name of the named object.
    Method returns a list of rules created so far.
    default boolean
    Checks if a rule with the specified name exists in the rule set.

    Methods inherited from interface org.evrete.api.Named

    getName
  • Method Details

    • getRules

      List<R> getRules()

      Method returns a list of rules created so far.

      Returns:
      list of currently known rules
    • ruleExists

      default boolean ruleExists(String name)
      Checks if a rule with the specified name exists in the rule set.
      Parameters:
      name - the name of the rule
      Returns:
      true if a rule with the specified name exists, false otherwise
    • getRule

      R getRule(String name)
      Retrieves a rule based on its name.
      Parameters:
      name - the name of the rule to retrieve
      Returns:
      the rule with the specified name, or null if no rule with that name exists
    • getRule

      default R getRule(Named named)
      Retrieves a rule based on the name of the named object.
      Parameters:
      named - the object with a name
      Returns:
      the rule with the specified name, or null if no rule with that name exists