Java Stream Collectors Like A Pro
Although support for Streams was added to Java almost seven years ago, providing a breeze of fresh (and functional) air, few people have dived into the world of creating their own Collectors. This workshop will explore the possibilities of custom Collectors and show you how you can leverage them in your day-to-day coding.
- Apr 16Online3.5 hours11:00 - 14:30 UTC225 USD
- A brief reminder on Java Streams and the role of Collectors within them
- Different real-life scenarios where a custom Collector can improve the code by embedding common checks, filters, and transformations into the Collector itself
- How to create a Collector from scratch
- How to create a Collector by extending an existing one
- How to parameterise Collectors so they can adapt to different situations
- How to test and share Collectors
- How to deal with the additional challenges posed by parallel Stream processing
By learning how and when to create your own Stream Collectors, you will be able to create code that is more closely aligned to your needs, making it more readable, reusable, safer, and testable.
After this workshop, you will never look at Collectors the same way again.
Abraham Marin-Perez is a Java developer with more than ten years of experience in industries ranging from finance to publishing to the public sector. He also helps run the London Java Community, and provides career advice at the Meet a Mentor London group.
Abraham likes sharing his experiences with others, which has led him to become a Java News Editor at InfoQ, and to author "Real-World Maintainable Software" (O'Reilly), and co-author “Continuous Delivery in Java” (O’Reilly).
Currently based in London, Abraham likes going out on a hike whenever the English weather permits it, and cooking when it doesn't.