Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
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.