Object orientation

Seven lessons on classes: the property Groovy writes for a field, the constructors a class gets, the AST transforms that remove the boilerplate of a data class, immutability and records, interfaces and traits, delegation and enums, and the two annotations that hand the checks back to the compiler.

032 Classes, properties and fields the property Groovy generates, the field behind it, and the accessors Open 033 Constructors and named parameters the map constructor, a declared constructor, and what @CompileStatic changes Open 034 The AST transforms of a data class @Canonical, @ToString, @EqualsAndHashCode and @TupleConstructor, with what each one writes Open 035 Immutable objects, records and builders @Immutable, a Java record, and @Builder for a long constructor Open 036 Interfaces, traits and inheritance an interface, a trait with state, an abstract class, and what each one may hold Open 037 @Delegate, enums and visibility delegation instead of inheritance, an enum with fields, and the visibility modifiers Open 038 @CompileStatic and @TypeChecked what the compiler catches, what it refuses, and the speed it buys Open

Lessons