-
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.
1.
|
Add DataObject.bindingHashCode() | Resolved | Ilya Igushev | |
2.
|
Use DataObject.bindingHashCode() in CodecDataObject | Resolved | Ilya Igushev | |
3.
|
Add DataObject.bindingEquals(Object) | Resolved | Ilya Igushev | |
4.
|
Use DataObject.bindingEquals(Object) in CodecDataObject | Resolved | Ilya Igushev | |
5.
|
Add DataObject.bindingToString() | Resolved | Ilya Igushev | |
6.
|
Use DataObject.bindingToString() in CodecDataObject | Resolved | Ilya Igushev | |
7.
|
Binding DTOs: improve equals() implementation | Resolved | Unassigned |