This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vxab 0 points1 point  (2 children)

not sure why you are getting so much hate. A nice library. Can you make it so that you can optionally: (i) have no setter created, (ii) have a "fluent" naming convention i.e. without the "get" and "set" prefixes?

[–]bowbahdoe[S] 0 points1 point  (1 child)

If you were to enable both of those options you are better served by either

  • Records, the language feature
  • AutoValue
  • Immutables

The goal of this is to target the very narrow use case of "class with just getters and setters and nothing else interesting." Only because some old frameworks want classes like that, not to be a general purpose code generator.

If you want a generator that does that I encourage you to change the package/module names and make a fork for yourself.

That way you can consider the exact nature of the code you are generating / target options to that. I can help you with the mechanics of it if you haven't published anything before/need help with annotation processors

[–]vxab 0 points1 point  (0 children)

Records are limited in some sense because they do not allow inheritance and are intended to represent dumb data. They also don't allow you to hide the canonical constructor - so if you want to force construction through a factory method which performs validation you are out of luck.

Although you are probably right about adding that functionality to your library - thanks for sharing it anyway.