Как я могу сгруппировать по json по двум элементам?
Образец json должен быть сгруппирован по uniqueAccountID и uniqueAccountID
Ввод Json:
[
{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "123",
"authorizedUserCustomerID": "ab",
"referenceStartDate": "20200224"
},
{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "123",
"authorizedUserCustomerID": "ab",
"referenceStartDate": "20200224"
},{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "123",
"authorizedUserCustomerID": "cc",
"referenceStartDate": "20200224"
},{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "999",
"authorizedUserCustomerID": "cc",
"referenceStartDate": "20200224"
}
]
Ожидаемый результат:
{
"1" : [
{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "123",
"authorizedUserCustomerID": "ab",
"referenceStartDate": "20200224"
},
{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "123",
"authorizedUserCustomerID": "ab",
"referenceStartDate": "20200224"
}
],
"2" : [
{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "123",
"authorizedUserCustomerID": "cc",
"referenceStartDate": "20200224"
}
],
"3" : [
{
"recordType": "XAC",
"filler": "0",
"uniqueAccountID": "999",
"authorizedUserCustomerID": "cc",
"referenceStartDate": "20200224"
}
]
}
На самом деле я вызываю Java stati c внутри другого приложения, поэтому ввод должен быть json или HashMap
Формат вывода может быть json или список или Hashmap