Serialization of set
问题 I am trying to write my own Set serializer, HashSet specifically. This because the default output of such a set holding enum elements looks like this: modifier: { amount: 1 criteriaSet: { class: java.util.HashSet //<--- bothers me items: [ NONE ADD MULTIPLY ] } } So I thought I write my own serializer. this is what the write method looks like. @Override public void write(Json json, HashSet object, Class knownType) { json.writeObjectStart(); for (Object o : object) { if (o instanceof Modifier