Skip to content

Add equals/hashCode to MigrationResult#239

Merged
Splatcrafter merged 1 commit intoaether-framework:developfrom
evanofficial:fix/migration-result-equals-hashcode
Mar 28, 2026
Merged

Add equals/hashCode to MigrationResult#239
Splatcrafter merged 1 commit intoaether-framework:developfrom
evanofficial:fix/migration-result-equals-hashcode

Conversation

@evanofficial
Copy link
Copy Markdown

Summary

Implement value-based equals() and hashCode() for MigrationResult, based on success status, source/target versions, domain, and duration.

This replaces the identity-based comparison noted in the class Javadoc, making it safe to use MigrationResult in collections and assertions.

Changes

MigrationResult.java:

  • Added equals() using instanceof pattern matching (matching DataVersion style)
  • Added hashCode() using Objects.hash()
  • Updated class Javadoc to reflect value-based equality
  • Added java.util.Objects import

MigrationResultTest.java:

  • Added 5 tests in new EqualsAndHashCode nested class:
    • Equal values → equals() returns true
    • Different success status → returns false
    • Different versions → returns false
    • Equal objects → consistent hashCode()
    • Null → returns false

Fixes #222

Implement value-based equality for MigrationResult based on
success status, source/target versions, domain, and duration.

Fixes aether-framework#222

Signed-off-by: Evan Sarkar <evan.official666@gmail.com>
@evanofficial evanofficial requested a review from a team as a code owner March 28, 2026 00:31
@Splatcrafter
Copy link
Copy Markdown
Member

Thanks for your PR again! I will look over it tomorrow as soon as i'm working.

@Splatcrafter Splatcrafter changed the base branch from main to develop March 28, 2026 14:48
@Splatcrafter Splatcrafter self-assigned this Mar 28, 2026
@Splatcrafter Splatcrafter added the enhancement New feature or request label Mar 28, 2026
@Splatcrafter Splatcrafter added this to the v1.0.0 milestone Mar 28, 2026
@Splatcrafter Splatcrafter merged commit 948a6ed into aether-framework:develop Mar 28, 2026
11 of 12 checks passed
@evanofficial evanofficial deleted the fix/migration-result-equals-hashcode branch March 28, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: MigrationResult lacks equals/hashCode

2 participants