Class HopeLangEngine


  • public class HopeLangEngine
    extends Object
    Top level accessor for hope. Creation is expensive. Create and reuse.
    • Method Detail

      • evaluate

        public boolean evaluate​(String hopeLangExpression,
                                com.fasterxml.jackson.databind.JsonNode root)
        Evaluates a hope expression using the provided json to return true or false.
        Parameters:
        hopeLangExpression - A hope language expression
        root - The json node to be evaluated
        Returns:
        true in case of match
      • evaluate

        public boolean evaluate​(Evaluatable rule,
                                com.fasterxml.jackson.databind.JsonNode node)
        Evaluate a hope lang parsed expression
        Parameters:
        rule - Parsed rule
        node - JsonNode for which the match rule is to be evaluated
        Returns:
        true in case of match
      • builder

        public static HopeLangEngine.Builder builder()
        Create a builder for the parser.
        Returns:
        An initialized builder.