Upgrade to Java 21 and modernize domain models with records #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR upgrades the project from Java 11 to Java 21 and modernizes the codebase by replacing Lombok
@Valueannotations with Java records for all domain models. It also updates dependencies and tooling to leverage modern Java features.Key Changes
Java Version & Tooling
maven.compiler.releaseproperty (Java 9+ best practice)Domain Model Modernization
MigrationRecord- now a record with compact constructor for null validationMigrationLock- now a record with compact constructor for null validationMigrationFileand nested types (MigrationFileMetadata,MigrationFileContents,MigrationFileRequestDefinition) - all converted to records@Valueand@NonNullwithObjects.requireNonNull()in compact constructors@ConstructorPropertiesannotations (no longer needed with records)getMetadata()→metadata())Dependency Updates
Code Quality Improvements
Collectors.toUnmodifiableList()withStream.toList()(Java 16+)Documentation Updates
Implementation Details
@ValueObjects.requireNonNull()@ConstructorPropertieshttps://claude.ai/code/session_015ESZFHmSSx9fBhLHb5EYoD