@Test public void Deserialization_MockNode_ShouldDeserialize() throws JsonMappingException, JsonProcessingException { final String str = "{\n" + " \"function\": \"AND\",\n" + " \"rules\": [\n" + " \"[0] EQUALS L1\",\n" + " \"[1] EQUALS Ascar\",\n" + " \"[3] EQUALS Bscar\"\n" + " ]\n" + "}"; ObjectMapper mapper = new ObjectMapper(); TerminalRuleTreeNode node = mapper.readValue(str, TerminalRuleTreeNode.class); assert (node.getFunction().equals(RuleTreeFunction.AND) && node.getRules().contains("[3] EQUALS Bscar")); }
public List<String> getRules() { return rules; }
TerminalRuleTreeNode extends RuleTreeNode { public List<String> getRules() { return rules; } }
TerminalRuleTreeNode extends RuleTreeNode { public List<String> getRules() { return rules; } TerminalRuleTreeNode();  TerminalRuleTreeNode(final TerminalRuleTreeNode other); }
TerminalRuleTreeNode extends RuleTreeNode { public List<String> getRules() { return rules; } TerminalRuleTreeNode();  TerminalRuleTreeNode(final TerminalRuleTreeNode other); List<String> getRules(); @JsonSetter("rules") void setRules(List<String> rules); }
TerminalRuleTreeNode extends RuleTreeNode { public List<String> getRules() { return rules; } TerminalRuleTreeNode();  TerminalRuleTreeNode(final TerminalRuleTreeNode other); List<String> getRules(); @JsonSetter("rules") void setRules(List<String> rules);  }