boolean (MatchNode matchNode, MatchEngine engine) { if (matchNode.getType() != MatchNode.MATCHNODE_STATEMENT) { return false; } for (Entry<MatchProperties, RuleValue> rule : matchNode.getRules().entrySet()) { switch (rule.getKey()) { case STATEMENT_TYPE -> { if (this.type != rule.getValue().value) { return false; } } case STATEMENT_STATSIZE -> { if (this.stats.size() != (Integer)rule.getValue().value) { return false; } } case STATEMENT_EXPRSIZE -> { int exprsize = (Integer)rule.getValue().value; if (exprsize == -1) { if (this.exprents != null) { return false; } } else { if (this.exprents == null || this.exprents.size() != exprsize) { return false; } } } case STATEMENT_RET -> { if (!engine.checkAndSetVariableValue((String)rule.getValue().value, this)) { return false; } } } } return true; }