Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auxilliary values #109

Open
mads-b opened this issue May 6, 2022 · 2 comments
Open

Auxilliary values #109

mads-b opened this issue May 6, 2022 · 2 comments

Comments

@mads-b
Copy link
Contributor

mads-b commented May 6, 2022

Records by default utilize all values in computation of equals and hashcode

Sometimes that's not what you want.

It's trivial to add a custom implementation of equals and hashcode to the records, but we could also introduce an annotation that could be assigned to record fields to result in custom equals and hashcode appearing in the Bean interface

What do you think? It's not a must-have, but rather useful

@Randgalt
Copy link
Owner

Randgalt commented May 7, 2022

Can you give an short description of what that would look like? I don't see how an annotation could help with this.

@mads-b
Copy link
Contributor Author

mads-b commented May 9, 2022

Mostly just me trying to find drop-in replacements to immutables features: https://immutables.github.io/immutable.html#auxiliary-attributes

If this is to be done, it would mean starting to generate equals, toString and hashCode as default methods in the generated Bean interface. These methods would then omit @Auxilliary-annotated fields from equals and hashCode, and omit @redacted fields from toString.

This all might also be out of scope for this library, and in hindsight I might be better served making my own little interface-generator that created these three methods on demand..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants