Expand my Community achievements bar.

SOLVED

getting values from ValueMap

Avatar

Level 2

Hi,

I am wanted to know as how could i get values from valuemap at run time from the below code . If I had say properties that were of type

String
StringArry []
boolean
Date



List<Map> testMap = new ArrayList<Map>();
            testMap.add(resourceProp);
           

 

 
            for(Map<String,? extends Object> map:testMap){
                ......
            }

 

In the for loop I would need to keep  object typecasted manually to the actual type by checking Instance Of. Is there any better way to do it.

Thanks,
Srinivas

1 Accepted Solution

Avatar

Correct answer by
Level 10

As you said need to make use of instanceOf & no other way IMO.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

As you said need to make use of instanceOf & no other way IMO.