0

I have query I have a Map which consist of key and valuses will be of type list

Map<String, List<String>> ppvValidatedinfo = new Map<String, List<String>>

Now I am adding some data into the map initially

 1234 , 456987

but next time when data added to map it becomes like this

1234 , [456987,125789]

As shown above that 1234 is key and 456987,125789 are the values internally maintened in list and are the values of the map

Now my query is that I have to go in flow where list size increases more than 1 please advise how can i track the size of the list , I want to track the size of the list which is a value of map

1 Answers1

0

Whenever you are doing insert, add a check after inserting to see if list size becomes greater than one. e.g.

public void add(String key,String value){
ppvValidatedinfo.get(key).add(value);
if(ppvValidatedinfo.get(key).size()>1){
//size is greater than 1 
doProcessing();
}
}
MoveFast
  • 3,011
  • 2
  • 27
  • 53