I will get a JSON in the following format
"address":
{
"type": "Temporary"
}
Following is the Address class.
class Address
{
AddressType type;
public Address(AddressType type)
{
this.type = type;
}
}
class AddressType
{
private String type;
public AddressType(String type)
{
this.type = type;
}
}
If Address.java had type as String, it would have been easier to transform from JSON to Address object. But I am not sure how I can transform the JSON to Address object where "type" will get transformed to AddressType object. I will use Jackson library. Please help me.