I have a product object that has a number of properties like this
public class Product {
private int deal_id;
private String deal_key;
private String deal_title;
private String url_title;
private int deal_value;
.........//setters and getters
}
Every product has a number of sizes that can also be 0. I want to assign sizes to my product from values in the json data I receive(below). I am extending this class and now I need to add another property of size which is an array of arrays. I need to set it from json on the api that like this.
"size" : [ { "product_size_id": "695", "deal_id": "179", "size_name": "None", "quantity": "1", "size_id": "1" },
{ "product_size_id": "695", "deal_id": "179", "size_name": "None", "quantity": "1", "size_id": "1" } ]
How can I set this on my product object in JAVA. I have tried looking up Hashmaps and Arraylist but havent found a way to do it correctly.