You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider two classes with @Builder, one is a field of another. If methods of outer builder could "delegate" to methods of inner builder, it would be possible to build the whole composition in a simpler way.
@BuilderpublicclassInner {
privateStringinnerField;
}
@BuilderpublicclassOuter {
// This tells Lombok to use InnerBuilder inside OuterBuilder@BuilderDelegateprivateInnerinner;
privateStringouterField;
}
The text was updated successfully, but these errors were encountered:
ilia1243
changed the title
[FEATURE]
[FEATURE] Delegate builders in composition of classes
Dec 5, 2024
ilia1243
changed the title
[FEATURE] Delegate builders in composition of classes
[FEATURE] Delegate builder methods in composition of classes
Dec 5, 2024
Describe the feature
Consider two classes with
@Builder
, one is a field of another. If methods of outer builder could "delegate" to methods of inner builder, it would be possible to build the whole composition in a simpler way.Example usage:
Existing way to do the same
This can already be achieved by customizing the OuterBuilder with some boiler-plate code:
Related question with the same goal but different implementation https://stackoverflow.com/questions/54309139/delegate-and-builder-combination-in-lombok
The text was updated successfully, but these errors were encountered: