I am trying to create a function call using hashmap.
For example,
Hashmap-- "a" -> "b" "c" -> "d"
Now I should parse this Hashmap and create a function like this-
someFun("{a:#,c:#}",new SomeClass(b),new SomeClass(d));
As you can see, a
and c
are keys of hashmap(first argument) ;
b
and d
are used to create objects (second argument and so on..)
someFun
parameters depend on HashMap size..
I am confused!
Because I can loop through the map to get Keys and easily create the first argument.
For the second argument, I can use the value to create Objects.
But now how do I add these together to make the function call as specified?
Any help would be very much appreciated :)
P.S: My question is not about getting values/keys from hashmap,but using them to create a function call something as specified.I am not allowed to change
someFun
consider it as API call.