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?

0
3 comments

Use for or iter postfix completion on map.keySet() expression:

0
Avatar
Permanently deleted user

No, that one doesn't pull the corresponding values out of the map for each key. It gets half of the job done, though.

0

Have you tried creating your custom live template for this? For examples check existing templates e.g. under iterations node

0

Please sign in to leave a comment.