{
"LocalLocationId [id=1]":{
"type":"folderlocation",
"id":{
"type":"locallocationid",
"id":1
},
"parentId":{
"type":"locallocationid",
"id":0
},
"name":"Test",
"accessibleToUser":true,
"defaultLocation":false,
"timezoneId":"Asia/Calcutta",
"children":[]
},
"LocalLocationId [id=0]":{
"type":"folderlocation",
"id":{
"type":"locallocationid",
"id":0
},
"parentId":null,
"name":"Locations",
"accessibleToUser":false,
"defaultLocation":false,
"timezoneId":"Asia/Calcutta",
"children":[{
"type":"locallocationid",
"id":1
}]
},
"allAllowedChildren":[{
"type":"locallocationid",
"id":1
}]
}
How to deserialize above string into java object.
Class im using is
public class Tree {
@SerializedName("allAllowedChildren")
private List<Id> allAllowedChildren;
@SerializedName("LocalLocationId")
private Map<String, LocalLocationId> localLocationId;
public class LocalLocationId {
@SerializedName("type")
private String type;
@SerializedName("name")
private String name;
@SerializedName("accessibleToUser")
private boolean accessibleToUser;
@SerializedName("defaultLocation")
private boolean defaultLocation;
@SerializedName("timezoneId")
private String timezoneId;
@SerializedName("id")
private Id id;
@SerializedName("parentId")
private Id parentId;
@SerializedName("children")
private List<Id> children;
public String getType() {
return type;
}
public String getName() {
return name;
}
public boolean isAccessibleToUser() {
return accessibleToUser;
}
public boolean isDefaultLocation() {
return defaultLocation;
}
public String getTimezoneId() {
return timezoneId;
}
public Id getId() {
return id;
}
public Id getParentId() {
return parentId;
}
public List<Id> getChildren() {
return children;
}
}
public class Id {
private String type;
private Integer id;
public String getType() {
return type;
}
public Integer getId() {
return id;
}
}
public List<Id> getAllAllowedChildren() {
return allAllowedChildren;
}
public Map<String, LocalLocationId> getLocalLocationId() {
return localLocationId;
}
}