Я пытаюсь поместить данные JSON в HashMap, который может содержать много дубликатов ключей.
Например:
{
"member Detial": {
"firstname": "jhon",
"lastName": "wick",
"Address": "New York",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"Password": "newyorkcitizen",
"confirm password": "newyorkcitizen",
"NationalProviderIdentifier": "Apollo",
"PartyID": "1"
},
"Physician": {
"firstname": "jhon",
"lastName": "wick",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"NationalProviderIdentifier": "Apollo",
"PartyID": "1"
},
"PhysicianGroup": {
"Address": "New York",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"NationalProviderIdentifier": "Apollo",
"Hospital name": "Apollo",
"Tax ID": "12345",
"PartyID": "1"
},
"Physician": {
"Address": "New York",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"NationalProviderIdentifier": "Apollo",
"Hospital name": "Apollo",
"Tax ID": "12345",
"PartyID": "1"
},
}
в приведенном выше файле json "детали элемента" рассматривается как ключ, а данные в скобках - как значение. но проблема здесь в том, что в приведенном выше примере json могут быть дубликаты ключей типа «Врач».
Я хочу добавить значение второго «врача» к первому «Врачу» без переопределения его значения и удалить дубликат ключа.
например: `
{
"member Detial": {
"firstname": "jhon",
"lastName": "wick",
"Address": "New York",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"Password": "newyorkcitizen",
"confirm password": "newyorkcitizen",
"NationalProviderIdentifier": "Apollo",
"PartyID": "1"
},
"Physician": [{
"firstname": "jhon",
"lastName": "wick",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"NationalProviderIdentifier": "Apollo",
"PartyID": "1"
},
{
"Address": "New York",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"NationalProviderIdentifier": "Apollo",
"Hospital name": "Apollo",
"Tax ID": "12345",
"PartyID": "1"
}
],
"PhycianGroup": {
"Address": "New York",
"Email": "jhonwick@boogiman.com",
"Fax Number": "09876543",
"Contact Number": "9876543210",
"NationalProviderIdentifier": "Apollo",
"Hospital name": "Apollo",
"Tax ID": "12345",
"PartyID": "1"
}
}
`