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

feat: Add toString, equals and hashCode to public domain objects #508

Merged
merged 12 commits into from
Jan 15, 2024

Conversation

SMadani
Copy link
Contributor

@SMadani SMadani commented Jan 12, 2024

Along with addressing #134, this PR aims to add convenience when debugging API responses and using the deserialised objects in collections, by implementing the equals and hashCode methods. The toString is implemented based on the class name and serialised JSON value. A reflective approach is taken to all these methods, using a common base object for JSON payloads in the form of com.vonage.client.JsonableBaseObject, which is implemented throughout the entire classs hierarchy / object graph for all JSON responses, and even some requests.

@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2024

Codecov Report

Merging #508 (a79373c) into main (a50c7bb) will increase coverage by 0.93%.
The diff coverage is 100.00%.

❗ Current head a79373c differs from pull request most recent head 18cdbbc. Consider uploading reports for the commit 18cdbbc to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #508      +/-   ##
============================================
+ Coverage     94.26%   95.19%   +0.93%     
+ Complexity     2892     2874      -18     
============================================
  Files           426      426              
  Lines          6919     6824      -95     
  Branches        449      392      -57     
============================================
- Hits           6522     6496      -26     
+ Misses          204      200       -4     
+ Partials        193      128      -65     
Files Coverage Δ
src/main/java/com/vonage/client/HttpWrapper.java 100.00% <ø> (ø)
...ain/java/com/vonage/client/JsonableBaseObject.java 100.00% <100.00%> (ø)
...ava/com/vonage/client/account/BalanceResponse.java 100.00% <ø> (ø)
...c/main/java/com/vonage/client/account/Country.java 100.00% <100.00%> (ø)
...com/vonage/client/account/CreateSecretRequest.java 100.00% <ø> (ø)
...com/vonage/client/account/FullPricingResponse.java 100.00% <100.00%> (ø)
...com/vonage/client/account/ListSecretsResponse.java 75.00% <100.00%> (ø)
...c/main/java/com/vonage/client/account/Network.java 100.00% <100.00%> (ø)
...m/vonage/client/account/PrefixPricingResponse.java 100.00% <100.00%> (ø)
...ava/com/vonage/client/account/PricingResponse.java 100.00% <100.00%> (ø)
... and 171 more

@SMadani SMadani marked this pull request as ready for review January 15, 2024 11:41
@SMadani SMadani merged commit 1b1caa5 into main Jan 15, 2024
10 checks passed
@SMadani SMadani deleted the pojo-boilerplate branch January 15, 2024 17:36
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