Generate tuple constructor with all args and annotations#311
Generate tuple constructor with all args and annotations#311alien11689 wants to merge 1 commit intoapache:masterfrom
Conversation
|
I like the idea but I think we can make it more generic. Perhaps something like what I show here is a desirable prerequisite tweak to Groovy: We could then apply the same idea to your PR to not just supply annotation class names but definitions including any needed annotation attributes? |
|
Hi Christoffer, perhaps you can explain what you are trying to do and we can show you how to do it in Groovy. The Java approach to properties is to write the getters, setters and backing field yourself. Groovy properties are a short-hand for the 99% common case of public getters/setters and private backing field but you can always write yourself as per Java for special cases or write your own meta-programming to give you other combinations. When writing yourself fields and methods can be private, protected, package-private or public. Annotations aren't required but many developers like the magnitude productivity increase that compile-time meta-programming offers. |
|
I know it doesn't cover all use cases, but for records in Groovy 4, annotations on the record are carried over to the constructor if placed on the record. It would cover the original use case: |
|
The idea is good but I don't think we'd implement it this way especially given the amount of time that has passed. I'll close this for now. If you still feel strongly about the desired goal, please create an issue and we can discuss an alternative implementation. |
No description provided.