- Small example to show a solution for your use-case with mixins:
class Data {
int totalUsers;
int totalBooks;
}
class DataMixin {
@JsonProperty("Total Users")
int totalUsers;
@JsonProperty("Total Books")
int totalBooks;
}
// Jackson 2.5+
ObjectMapper mapper = new ObjectMapper();
if (pretty) {
mapper.addMixin(Data.class, DataMixin.class);
}
Class or .java:
pox.xml