Add DataObject default methods
(MDSAL-470)
|
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | Binding codegen |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0 |
| Type: | Sub-task | Priority: | Medium |
| Reporter: | Robert Varga | Assignee: | Ilya Igushev |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
In order to maintain proper equality contracts, we need to share as much code as possible between compile-time and runtime. Create a interface Foo extends DataObject { static boolean bindingEquals(final @NonNull Foo thisObj, final Object obj) { // ... } } method, which will define equality contract on the generated type. This code already exists in generated build implementations, which need to be updated to defer to these methods. The method needs to be static so in case of Augmentable objects it enforces that thisObj is AugmentationHolder<Foo>.
|