Closed dflemstr closed 6 years ago
Thanks for the PR! I think there are a couple of different things here:
List
.It feels like a good idea could be to disallow varargs parameters, mandating the use of collection types instead, but I would like to know a little more before I make up my mind.
@pettermahlen
So, we've discussed this a bit, and what we want to do is:
It's great that you brought our attention to these problems!
Created #4 to remove varargs support.
It might be interesting to look at the @AutoValue
extension mechanisms (embracing NIH) but it is of course your prerogative to evaluate whether it suits your desired level of abstraction!
(see http://ryanharter.com/blog/2016/05/16/autovalue-extensions/ for example)
Yes, we have been looking at autovalue-extensions, and part of our future plan is to support something similar in dataenum. Currently, our gut feel is that we'll need to plug that in deeper inside DataEnum than they allow out of the box, and that such changes might be easier with code that we own fully, but we will definitely take a closer look at this PR when we get to looking into that.
This refactors the processor to delegate generation of POJO classes to the AutoValue library.
This is of course a trade-off; it is good because there is less code in this repo and less need to test corner cases, but it means that the classes of data enum variants need to have package-private constructors.
Since AutoValue has a built-in linter for checking the soundness of POJOs, as part of this PR I noticed two problems:
@Ignore
that test until further discussion.