java – I have a Json List and XML list, Have to remove the Fields in JSon which are null and not present in the xml list and store it in new list
parsedJsonChildData (original data): [{date=null, feeForPerformance=null, feeFrequency=5}, {date=12-25-2024, feeForPerformance=23, feeFrequency=1}, {date=12-03-2025, feeForPerformance=1, feeFrequency=5}]
parsedXmlChildData (original data): [{date=null, feeFrequency=5}, {date=12-25-2024, feeForPerformance=23, feeFrequency=1}, {date=12-03-2025, feeForPerformance=1, feeFrequency=5}]
In the first index of parsedJsonChildData feeForPerformance=null should be remove since it is not available in the parsedXmlChildData
I have tried to make a code but I am still getting the same output
public static List
ouptut :-
modifiedParsedJsonChildData (after cleaning): [{date=null, feeForPerformance=null, feeFrequency=5}, {date=12-25-2024, feeForPerformance=23, feeFrequency=1}, {date=12-03-2025, feeForPerformance=1, feeFrequency=5}]
it is still the same
Read more here: Source link
