Groovy Programming Fundamentals for Java Developers

Video description

There are not many technologies that can brag about staying relevant for more than 30 years. Java is one of those technologies that is not only staying relevant but also evolving with time. However, in Java, due to verbose and complexities in coding, developers started using different platforms and languages to counterfeit this downside.

Apache Groovy is the number one go-to language when it comes to knocking up quick scripts to automate drudge work and even for writing full-scale applications (using other frameworks such as Grails and Griffon). Groovy is predominantly seen today in Jenkins pipelines scripts and in Gradle build scripts, but this really underplays its power and versatility, as we’ll see in this course. You will learn many exciting features of Groovy and see how it reduces execution time with its lightweight syntaxes.

This course will teach you how to set up Groovy, install it, and create Groovy projects in the IDE. Then you’ll be exploring the Groovy toolset and using the Groovy console to execute Groovy code. Moving ahead, you’ll learn common Groovy operators that form the cornerstone of its powerful syntax. You will then learn how to use regular expressions and capture groups to parse and extract strings. You’ll also look at Groovy collections and the enhancements delivered by GDK (Groovy Development kit). Finally, you’ll be filtering and transforming collections in Groovy with Groovy’s powerful closure mechanism and much more.

By the end of this course, you will learn Groovy’s features and start using them in your day-to-day activities with ease.

What You Will Learn

  • Install Groovy and create Groovy projects in the IDE
  • Explore the Groovy toolset and use the Groovy console to execute Groovy code
  • Learn common Groovy operators that form the cornerstone of its powerful syntax
  • Use regular expressions and capture groups to parse and extract strings
  • Look at Groovy collections and the enhancements delivered by the GDK
  • Learn how to iterate and search through collections in Groovy


This course is best suited for the beginner- to intermediate-level Java developers who want to accelerate their existing Java coding tasks using Groovy.

Interested developers in other programming languages who want to write programs that can execute on the Java Virtual Machine, without having to use Java will also find this course useful.

Working knowledge of the Java programming language is assumed as a prerequisite, although the course can be used without this knowledge (but it will make more sense and be easier for a Java developer to understand).

About The Author

Matthew Speake: Matthew Speake is a Java technologist and trainer. He has over 20 years of experience working everywhere from small start-ups to large global corporations and is the principal trainer at Zention in the UK.

He started JavaEasily in 2018 to produce courses focused on teaching Java technology to students all around the world. Since then, JavaEasily has been busy creating and publishing courses and articles on different aspects of Java to help beginners and intermediate Java developers enhance their skills. JavaEasily helps you become a better Java developer by teaching you the core skills you need in order to succeed in your Java career.

Table of contents

  1. Chapter 1 : Getting Set Up
    1. Section Introduction
    2. Creating and Debugging a Grooving Project in IDEA
    3. Installing Groovy on a Mac or Linux System from the Website
    4. Exploring the Groovy Tool Set
    5. Using the Groovy Console to Execute and Examine Groovy Code
  2. Chapter 2 : Groovy Operators
    1. Section Introduction
    2. Null-Safe Dereference Operator
    3. Elvis Operator
    4. Spaceship Operator
    5. Spread Operator
    6. Range Operator
  3. Chapter 3 : Groovy Strings
    1. Section Introduction
    2. String Interpolation
    3. Heredocs
    4. Pattern Operator in Regular Expressions
    5. Slashy Regular Expressions
    6. Find Operator in Regular Expressions
    7. Match Operator in Regular Expressions
    8. Capture Groups in Regular Expressions
  4. Chapter 4 : Collections in Groovy
    1. Section Introduction
    2. Creating Lists and Sets
    3. Creating Maps
    4. Composing Collections of Different Types
    5. Accessing Elements of a List
    6. Using Groovy Truthiness with Collections
    7. Creating and Accessing Composite Collections
    8. Processing Lists and Sets
    9. Processing Lists and Sets by Index
    10. Processing Maps by Key and Value
    11. Filtering Collections
    12. Finding the Matching Element in a Collection
    13. Testing Elements in Collections
    14. Collecting Elements to a List
    15. Collecting Entries to a Map
    16. Creating Aggregate Functions with Inject
  5. Chapter 5 : Groovy Language Features
    1. Section Introduction
    2. Default Imports and Classes
    3. Main Methods in Groovy Applications
    4. Creating Classes and Instances in Groovy
    5. Adding methods and state to Groovy Classes
    6. Using Inheritance in Groovy
    7. Overriding Methods in Groovy
    8. POGOs and Groovy Property Generation
    9. Operator Overloading
    10. String Equality in Groovy
    11. Returning Multiple Values from a Method
    12. Autogenerating Equals and HashCode with Groovy AST Transformations
    13. Named Constructors
  6. Chapter 6 : Wrapping Up
    1. Thanks and Well Done!

Product information

  • Title: Groovy Programming Fundamentals for Java Developers
  • Author(s): Matthew Speake
  • Release date: April 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781801074063