I would like to serialize a HashMap as a string through the Jackson JSON processor. For example:
String strMap = getMapper().writeValueAsString(myHashMap); r
Using Jackson 2.1.2 I have found that I can annotate the class with @JsonInclude(Include.NON_NULL) so that nulls are not serialized at all.
@JsonInclude(Include.NON_NULL)