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

Support for equals and hash #66

Open
ChrisTrenkamp opened this issue Jul 17, 2018 · 1 comment
Open

Support for equals and hash #66

ChrisTrenkamp opened this issue Jul 17, 2018 · 1 comment

Comments

@ChrisTrenkamp
Copy link

ChrisTrenkamp commented Jul 17, 2018

Does capnproto-java have support for checking equality and generating hash's on StructReader's? My application is currently using Protobuf, and I am currently investigating capnproto as a replacement. Protobuf generates equals and hash methods on its generated objects, and my application relies on those methods.

Is it possible for the compiler to generate equals and hash methods for its objects, as well as handling schema changes like how Protobuf handles it? Requiring the programmer to write the methods and remembering to update the equals and hash methods when the schema changes is bound to create problems.

Thanks.

@chillinski
Copy link

I am working on a converter which needs to convert protocol buffer messages into cap'n'proto messages in both directions. In order to write integration tests I would like to have a convenient way of checking the converted messages after doing a back and forth conversion. As of now this is not possible as of the missing equals and hash methods.
Implementing them or doing a manual in depth comparison would be very time consuming and unmaintainable over time.
For testing purposes I would also go with an approach which does a textual comparison (JSON or capnp text format).

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