Class FastRule

    • Field Detail

      • name

        protected String name
        Rule name.
      • description

        protected String description
        Rule description.
      • priority

        protected int priority
        Rule priority.
    • Constructor Detail

      • FastRule

        protected FastRule​(String name,
                           String description,
                           int priority)
      • FastRule

        protected FastRule​(String name)
    • Method Detail

      • when

        protected abstract boolean when​(Facts facts)
      • then

        protected abstract void then​(Facts facts)
      • evaluate

        public final boolean evaluate​(Facts facts)
        Description copied from interface: Rule
        This method implements the rule's condition(s). Implementations should handle any runtime exception and return true/false accordingly
        Specified by:
        evaluate in interface Rule
        Returns:
        true if the rule should be applied given the provided facts, false otherwise
      • execute

        public final void execute​(Facts facts)
                           throws Exception
        Description copied from interface: Rule
        This method implements the rule's action(s).
        Specified by:
        execute in interface Rule
        Throws:
        Exception - thrown if an exception occurs when performing action(s)
      • getName

        public String getName()
        Description copied from interface: Rule
        Getter for rule name.
        Specified by:
        getName in interface Rule
        Returns:
        the rule name
      • getDescription

        public String getDescription()
        Description copied from interface: Rule
        Getter for rule description.
        Specified by:
        getDescription in interface Rule
        Returns:
        rule description
      • getPriority

        public int getPriority()
        Description copied from interface: Rule
        Getter for rule priority.
        Specified by:
        getPriority in interface Rule
        Returns:
        rule priority