I have the following class:
public class Message { private String text; public String getText() { return text; } public void setText(St
Provided you don't mind the json having a capital m in message, then the simplest way to do this is to annotate your class with @JsonTypeInfo.
m
message
You would add:
@JsonTypeInfo(include=As.WRAPPER_OBJECT, use=Id.NAME) public class Message { // ... }
to get {"Message":{"text":"Text"}}
{"Message":{"text":"Text"}}