Since we have default methods available, we can make conversion of DataObject to a corresponding shallowly-copied builder a utility method, which will redirect to the appropriate Builder copy-constructor.
For an interface Foo, add the following method:
default @NonNull FooBuilder toBuilder() {
return new FooBuilder(this);
}
Since we have default methods available, we can make conversion of DataObject to a corresponding shallowly-copied builder a utility method, which will redirect to the appropriate Builder copy-constructor.
For an interface Foo, add the following method:
default @NonNull FooBuilder toBuilder() { return new FooBuilder(this); }