Skip to content

feat(lib-cloudinfo): add value-based equals/hashCode to ProductsQuery#66

Merged
ramonamela merged 1 commit into
masterfrom
feature/NOTASK-products-query-equals-hashcode
May 7, 2026
Merged

feat(lib-cloudinfo): add value-based equals/hashCode to ProductsQuery#66
ramonamela merged 1 commit into
masterfrom
feature/NOTASK-products-query-equals-hashcode

Conversation

@ramonamela
Copy link
Copy Markdown
Collaborator

Summary

  • Adds equals, hashCode, and toString to ProductsQuery based on the existing sched / nvme flags so instances built from the same inputs compare equal and can be used safely as map keys.
  • Adds ProductsQueryTest with a reflection-based guard: any future instance field not wired into hashCode/equals fails the suite, preventing silent caching bugs in consumers.

Test plan

  • ./gradlew :lib-cloudinfo:test --tests "*ProductsQueryTest*" passes locally
  • CI green on this PR

🤖 Generated with Claude Code

ProductsQuery is a small filter parameter object passed to the Cloudinfo
products endpoint. Without value-based equality, instances built from the
same flags compared as unequal, which broke caching and made them unsafe
as map keys.

This adds equals, hashCode, and toString based on the existing sched and
nvme flags. A reflection-based Spock test guards future fields: any new
declared instance field that is not wired into hashCode (or equals) will
fail the suite, preventing silent caching bugs in consumers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ramonamela ramonamela merged commit 2307325 into master May 7, 2026
3 checks passed
@ramonamela ramonamela mentioned this pull request May 7, 2026
1 task
@ramonamela ramonamela deleted the feature/NOTASK-products-query-equals-hashcode branch May 7, 2026 16:42
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.

3 participants