Live template for map iteration
Answered
I write something like this all the time, and I don't think I'm the only one:
Map<Foo, Bar> map=getMap();
for(Foo key:map.keySet())
{
Bar value=map.get(key);
...
Is there a live template for this pattern?
Please sign in to leave a comment.
Use for or iter postfix completion on map.keySet() expression:
No, that one doesn't pull the corresponding values out of the map for each key. It gets half of the job done, though.
Have you tried creating your custom live template for this? For examples check existing templates e.g. under iterations node