I am working on a project where I get a JSON
response from my API using entities and DTO
Folowing is the response:
return XXXResponseDTO
.builder()
.codeTypeList(commonCodeDetailList)
.build();
commonCodeDetailList
list contains the data from the database. Final output will be
{
"code_type_list": [
{
"code_type": "RECEIVING_LIST",
"code_list": [
{
"code": "1",
"code_name": "NAME"
},
{
"code": "2",
"code_name": "NAME1"
}
],
"display_pattern_list": [
{
"display_pattern_name": "0",
"display_code_list": [
"1",
"2"
]
}
]
},
{
"code_type": "RECEIVING_LIST1",
"code_list": [
{
"code": "1",
"code_name": "NAME"
}
],
"display_pattern_list": [
{
"display_pattern_name": "0",
"display_code_list": [
"1"
]
}
]
}
]
}
I need to convert this to Map with key-value pairs. How could I achieve this?