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

Add encode and decode to Input and Output #2502

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

zachgk
Copy link
Contributor

@zachgk zachgk commented Apr 3, 2023

This adds a full serialization rather than just part of content or properties to the Input and Output. It also requires adding equals and hash to them as well.

This adds a full serialization rather than just part of content or properties to
the Input and Output. It also requires adding equals and hash to them as well.
@zachgk zachgk requested review from frankfliu and a team as code owners April 3, 2023 23:04

/** {@inheritDoc} * */
@Override
public boolean equals(Object o) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too heavy, we either use a id or just use Identity

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to a separate deepEquals() method. So, we can keep the functionality but mostly use the lighter Object equals

return false;
}
Output output = (Output) o;
return code == output.code && Objects.equals(message, output.message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot just based on message and code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has a check based on super.equals() a few lines above. This is the IntelliJ equals template

@zachgk zachgk merged commit 66e60f7 into deepjavalibrary:master Apr 6, 2023
@zachgk zachgk deleted the serializeIO branch April 6, 2023 16:22
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

Successfully merging this pull request may close these issues.

2 participants