I want to convert java object to JSON with different object name. For Example :
public class MetaProfileResponse {
private Boolean tour ;
private Integer maxFreeUser;
private Boolean paid;
private Integer status;
}
other Class is :
public class ProfileResponse {
private String domainName;
private String companyName;
private String country;
private String postCode;
}
A class have object of both class :
public class GetProfileResponse {
private MetaProfileResponse metaProfileResponse;
private ProfileResponse profileResponse;
}
when we get response as JSON We got :
{"metaProfileResponse":{"tour":null,"maxFreeUser":25,"paid":false,"status":0},"profileResponse":{"domainName":null,"companyName":null,"country":null,"postCode":null}}
But We want result as : {"meta":{"tour":null,"maxFreeUser":25,"paid":false,"status":0},"profile":{"domainName":null,"companyName":null,"country":null,"postCode":null}}
without changing class name