public final class CopyWithUtils
extends Object
Shared AST-generation glue for nested-path copyWith, used by both
the @Immutable and @RecordType transforms so the generated
code (and its evolution) stays identical across the two.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static void |
addCopyWithBlockMethod(ClassNode cNode)The transactional block overload: copyWith { name = 'x'; address.city = 'y' }. |
|
public static void |
addCopyWithIdentityMethod(ClassNode cNode)Backward-compatibility shim: a no-arg copyWith() with its
historical semantics (no changes → the same instance). |
|
public static Statement |
nestedFlattenStmt(String mapParamName)The leading statement of a nested-aware copyWith(Map):
<mapParamName> = NestedCopyWithSupport.flatten(this, <mapParamName>).
|
The transactional block overload:
copyWith { name = 'x'; address.city = 'y' }.
Backward-compatibility shim: a no-arg copyWith() with its
historical semantics (no changes → the same instance). Needed once
a copyWith(Closure) overload exists, otherwise the historically
supported zero-arg call becomes ambiguous.