I need to parse a JSON file that contains long list of customers. In the JSON file each customer may have one id as a string:
{
\"cust_id\": \"87655\",
...
}
Try method overriding
:
public class Customer {
@SerializedName("cust_id")
@Expose
private String custId;
public void setCustId(String custId) {
this.custId = {custId};
}
public String[] getCustId() {
return custId;
}
@override
public void setCustId(String[] custId) {
this.custId = custId;
}
}
Now In the code all values of CUSTID
will be arrays instead of strings