Issue
I am trying to create a model class for something like this
{
"id": null,
"name": "TestCompany",
"domainName": "comany.domain",
"status": 0,
"brandAttributes": {
"contact_person_name": "HS",
"website_url": "[email protected]",
"address": "Bengaluru",
"contact_person_email": "[email protected]"
}
}
Solution
You can use nested class or 2 class to archive the Model
class ModelDTO{
private String id;
private String name;
private String domainName;
private long status;
private BrandAttributes brandAttributes;
class BrandAttributes{
private String contact_person_name;
private String website_url;
private String address;
private String contact_person_email;
}
}
or
class ModelDTO{
private String id;
private String name;
private String domainName;
private long status;
private BrandAttributes brandAttributes;
}
class BrandAttributes{
private String contact_person_name;
private String website_url;
private String address;
private String contact_person_email;
}
Answered By - Lokeshwar G
Answer Checked By - Clifford M. (JavaFixing Volunteer)