-
Epic
-
Resolution: Done
-
Medium
-
None
Generated DTOs capture their Object-related mechanics in two places:
- compile-time Builder implementations
- runtime codec bridge implementations
Both of these should be indiscernible by the user, but there are subtle differences between them. It would be nice if we could eliminate those differences.
A way to do that is to generate defaultToString() methods, like this:
interface Foo extends DataObject { Bar getBar(); static String bindingToString(final Foo obj) { return "Foo [bar = " + obj.getBar() + "]"; } }
Generated builders, as well as generated bridges can then do a simple:
@Override public String toString() { return defaultToString(this); }
which will result in the implementation being shared. This applies to hashCode()/equals() as well.
There are no Sub-Tasks for this issue.