I have the following class:
public class Message { private String text; public String getText() { return text; } public void setText(St
A Simpler/Better way to do it:
@JsonRootName(value = "message") public class Message { ...}
then use new ObjectMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, true).writeValueAs...
new ObjectMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, true).writeValueAs...