Class NestedCopyWithSupport
java.lang.Object
org.apache.groovy.transform.copywith.NestedCopyWithSupport
Runtime support for nested-path
copyWith. Resolves dotted keys such
as 'address.city' into a flat map of top-level property to its
replacement value, by recursively applying copyWith to the affected
nested nodes. Plain (non-dotted) keys pass through unchanged.
A nested node whose type does not provide copyWith(Map) fails with
a clear, specific error rather than silent or partial behaviour. Identity
is preserved transitively: an unchanged nested node yields its original
reference, so an unchanged graph yields the original root.
- Since:
- 6.0.0
-
Method Summary
-
Method Details
-
applyBlock
Transactional-block form. Runsblockagainst a recording delegate that captures plain assignments, nested-path navigation, andprop.modify { old -> ... }updates, then delegates to the (nested-aware)copyWith(Map). The block is thus pure sugar over the map form, inheriting its closed-type-domain and identity guarantees. -
flatten
-