@Test public void testSerialize() throws Exception { VocabWord word = new VocabWord(1, "word"); AbstractElementFactory<VocabWord> factory = new AbstractElementFactory<>(VocabWord.class); System.out.println("VocabWord JSON: " + factory.serialize(word)); VocabWord word2 = factory.deserialize(factory.serialize(word)); assertEquals(word, word2); }
@Override public String serialize(VocabWord element) { return element.toJSON(); }
VocabWordFactory implements SequenceElementFactory<VocabWord> { @Override public String serialize(VocabWord element) { return element.toJSON(); } }
VocabWordFactory implements SequenceElementFactory<VocabWord> { @Override public String serialize(VocabWord element) { return element.toJSON(); }  }
VocabWordFactory implements SequenceElementFactory<VocabWord> { @Override public String serialize(VocabWord element) { return element.toJSON(); }  @Override VocabWord deserialize(String json); @Override String serialize(VocabWord element); }
VocabWordFactory implements SequenceElementFactory<VocabWord> { @Override public String serialize(VocabWord element) { return element.toJSON(); }  @Override VocabWord deserialize(String json); @Override String serialize(VocabWord element);  }