IntelliJ Live Templates with Google Guava

In this screencast, I will explain how to setup IntelliJ live templates with Google Guava, and how to add a bit a Functional Programming to your Java code when using Java 7 or below. The templates used in the video, including the configuration for them, can be found below.

The code to make the filter work, is the following. You’ll have to go to Preferences -> Editor -> Live templates and add a new template there. The following code need to be entered for the filter:

Filter

And the following variables have to be used:

Screen-Shot-2014-03-15-at-22.57.56-600x169

For the transformation, another template needs to be added, similar to the template above.

Transform

With these variables:

Screen-Shot-2014-03-15-at-22.58.18-600x228

If you’ve setup the above, functional programming will become a lot easier, even in Java versions older than Java 8!