I am tring to add list of string to set of Id . i am trying to avoid one more for loop to again loop and convert using Id.valueOf()
. Help me to achieve it.
Map<String,Set<String>> delegationDataMap // Value retrieved from some other function call
Set<Id> permSetIds = new Set<Id>();
for (List<String> permSetSubSet : delegationDataMap.values()){
permSetIds.add((Set<Id>)permSetSubSet);// Struggling here
}
Thank you all .I found answer from this article
for(Set<String> permSetSubSet : delegationDataMap.values()){
permSetIds.addAll(new Set<Id>((List<Id>)new List<String>(permSetSubSet)));
}
Now what is the most efficient way of this conversion. will JSON step ahead of this ?