Java 8 Eclipse Templates
Become more efficient with these new Java 8 Eclipse templates by Tasktop.
Join the DZone community and get the full member experience.Join For Free
it's been a while since java 8 was released . it brought us great additions like lambdas, streams, optionals, and many more. here at tasktop we do mostly java programming and are focused on increasing our productivity every day. since we are working with java 8, a bunch of eclipse templates were created that make developing with eclipse and java 8 more efficient. with this post i want to share some of them with you. we haved released them under the mit license and they can be found on github . see this eclipse guide on how to import the templates .
getting lambdas typed right is hard when doing it manually. therefore the java 8 templates contain some helpers to create most common lambdas automatically. it includes simple lambdas, predicates, functions, consumers and suppliers. simply type "lam" and hit ctrl-space afterwards to see and use the templates.
optionals are great to eliminate nulls. it always bugs me to use optional.of because i use the eclipse content assist a lot. therfore i only type "opt" and hit auto complete. eclipse automatically adds the code optional<t> because optional is typed. i always have to hit delete three times before i can use the "of" method. the java 8 templates contain two templates for optionals as well to work around this annoying problem. simply type "opt" and hit ctrl-space to use these templates. they contain optional.of as well as option.ofnullable.
Published at DZone with permission of David Shepherd, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.