Groovy Programming Fundamentals for Java Developers

Video description

Extend and enhance your Java applications with Groovy. Groovy programming is a great way to speed up and modernize your Java applications with better efficiency

About This Video

  • Explore Groovy’s lightweight and powerful syntax that slashes down the development time
  • Learn to write and adapt Groovy scripts to maximize your productivity
  • Filter and transform collections in Groovy with Groovy’s powerful closure mechanism

In Detail

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.

Publisher resources

Download Example Code

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 sdkman.io 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