I have a following list of objects :-
[
{
"tenantId": "ramyam101",
"tenantName": "Level1-Tenant-OOUF",
"parentName": "None",
"tenantAccountType": "Organization-Only User Function",
"index": 0,
"tenantLogoBase64": ""
},
{
"tenantId": "ramyam102",
"tenantName": "Level2-Tenant-OOUF",
"parentName": "Level1-Tenant-OOUF",
"tenantAccountType": "Organization-Only User Function",
"index": 1,
"tenantLogoBase64": ""
},
{
"tenantId": "ramyam103",
"tenantName": "Level3-Tenant-OF",
"parentName": "Level2-Tenant-OOUF",
"tenantAccountType": "Organization Functional",
"index": 2,
"tenantLogoBase64": ""
},
{
"tenantId": "ramyam104",
"tenantName": "Level3-Tenant-OOUF",
"parentName": "Level2-Tenant-OOUF",
"tenantAccountType": "Organization-Only User Function",
"index": 2,
"tenantLogoBase64": ""
}
]
This represents a hierarchy tree where each entry in the list has a 'tenantName' & 'parentName' and the level of the tenant in the hierarchy which is represented by 'index'.
For Example :-
Level1-Tenant-OOUF
|
Level2-Tenant-OOUF
| |
Level3-Tenant-OF Level3-Tenant-OOUF
So I want to create a nested structure which has child node objects inside the parent object. How can I do this ? Please help me out...!