Am struck in a problem please let me know if you have any idea how to proceed on this.
I have a method myMethod(Map<
String, Object> inputData) this Object can be a String/PrimitiveWrapper/Map/Collection i.e List/Vector. I need to get the values from this Object in the format given below.
If the Object is a Map. If it’s a simple Map its fine but this one is a complex Map. This Map can contain any type of data.
Suppose if it contains the data as shown below:
I need to iterate the
eight Map i.e in backward direction and values should be read as below. The big question is how do I know what is there in the Object. As this Object can contain any data structure.
Description of the above values:
Customers is the key of eight map that contains seven
Customer is the key of seven that contains a list six so it should be index form Customer[0], Customer[1]
fiveA is part of six at index 0,
Addresses is the key of fiveA, that contains Map four
Address is the key of four that contains a list three, so it should be index for Address[0], Address[1].
AddressLine1 is the key of one and has value House 1
so the final value from the top looks like this:
Now I need to get the values in the above way and put the same in another map.
There will be no XML data as input, only it will be of the form myMethod(Map<String, Object> inputData) and this Object can be a String/PrimitiveWrapper/Map/Collection i.e List/Vector. Now the inputData I have to process is:
myMethod(Map<String, Object> eight)
Thanks in Advance
Khan