@Test public void shouldSerializeCorrectly() throws Exception { final CompactMealy<String, String> mealy = createMealy(); final CompactMealyMachineProxy mealyProxy = CompactMealyMachineProxy.createFrom(mealy, alphabet); final ObjectMapper om = new ObjectMapper(); final String mealyString = om.writeValueAsString(mealyProxy); final String expectedMealyString = "{\"nodes\":[0,1]" + ",\"initNode\":0" + ",\"edges\":[" + " {\"from\":0,\"input\":\"a\",\"to\":0,\"output\":\"1\"}" + ",{\"from\":0,\"input\":\"b\",\"to\":1,\"output\":\"2\"}" + ",{\"from\":1,\"input\":\"a\",\"to\":1,\"output\":\"1\"}" + ",{\"from\":1,\"input\":\"b\",\"to\":0,\"output\":\"2\"}]}"; JSONAssert.assertEquals(expectedMealyString, mealyString, true); }
public static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine, Alphabet<String> alphabet) { return createProxy(machine, alphabet); }
CompactMealyMachineProxy implements Serializable { public static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine, Alphabet<String> alphabet) { return createProxy(machine, alphabet); } }
CompactMealyMachineProxy implements Serializable { public static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine, Alphabet<String> alphabet) { return createProxy(machine, alphabet); }  }
CompactMealyMachineProxy implements Serializable { public static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine, Alphabet<String> alphabet) { return createProxy(machine, alphabet); }  static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine,
                                                      Alphabet<String> alphabet); @Transient List<Integer> getNodes(); void setNodes(List<Integer> nodes); @Column(name = "nodes") @JsonIgnore String getNodesDB(); @JsonIgnore void setNodesDB(String nodesAsString); Integer getInitNode(); void setInitNode(Integer initNode); @Transient List<CompactMealyTransitionProxy> getEdges(); void setEdges(List<CompactMealyTransitionProxy> edges); @Column(name = "edges", columnDefinition = "MEDIUMTEXT") @JsonIgnore String getEdgesDB(); @JsonIgnore void setEdgesDB(String edgesAsString); @Transient @JsonIgnore Alphabet<String> createAlphabet(); CompactMealy<String, String> createMealyMachine(Alphabet<String> sigma); }
CompactMealyMachineProxy implements Serializable { public static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine, Alphabet<String> alphabet) { return createProxy(machine, alphabet); }  static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine,
                                                      Alphabet<String> alphabet); @Transient List<Integer> getNodes(); void setNodes(List<Integer> nodes); @Column(name = "nodes") @JsonIgnore String getNodesDB(); @JsonIgnore void setNodesDB(String nodesAsString); Integer getInitNode(); void setInitNode(Integer initNode); @Transient List<CompactMealyTransitionProxy> getEdges(); void setEdges(List<CompactMealyTransitionProxy> edges); @Column(name = "edges", columnDefinition = "MEDIUMTEXT") @JsonIgnore String getEdgesDB(); @JsonIgnore void setEdgesDB(String edgesAsString); @Transient @JsonIgnore Alphabet<String> createAlphabet(); CompactMealy<String, String> createMealyMachine(Alphabet<String> sigma);  }