Skip to content

[OTHER] Refactor project to use Lombok annotations for boilerplate reduction #1027

@kuntal1461

Description

@kuntal1461

📝 Description

Many classes in the project currently contain manually written boilerplate code such as:

  • Getters and setters
  • equals(), hashCode(), and toString() methods
  • Constructors for simple field initialization

This can be simplified and standardized using Lombok annotations, improving maintainability, readability, and consistency across the codebase.


🎯 Goal

Refactor all eligible POJOs, DTOs, entities, and configuration classes to use appropriate Lombok annotations such as:

  • @Data — for full getter/setter + equals/hashCode/toString
  • @Getter / @Setter — for selective accessors
  • @NoArgsConstructor, @AllArgsConstructor, @Builder — for simplified instantiation
  • @Value — for immutable objects

💡 Proposed Approach

  1. Identify target classes:
    Locate classes with repetitive accessor/mutator methods.

  2. Refactor incrementally:

    • Replace manual boilerplate with Lombok annotations.
    • Retain custom logic or overridden methods (e.g., validation in setters).
  3. Ensure consistency:

    • Use project-wide coding conventions for annotation placement and imports.
    • Verify no conflict with existing serialization/deserialization frameworks (e.g., Jackson).
  4. Update documentation:

    • Add Lombok dependency and usage notes in README.md or CONTRIBUTING.md.

Benefits

  • Significant reduction in code verbosity.
  • Improved readability and maintainability.
  • Easier onboarding for new contributors.
  • Reduced risk of human error in repetitive methods.

🧪 Acceptance Criteria

  • All relevant classes refactored to use Lombok.
  • Build and test suites pass without regressions.
  • Lombok dependency verified in pom.xml / build.gradle.
  • Documentation updated to reflect Lombok usage.

🧑‍💻 Assignee

I want to work on this .


🏷️ Labels

refactor, enhancement, code-quality, tech-debt


Additional information

No response

Do you want to work on this issue?

Yes

Metadata

Metadata

Assignees

Labels

App 💻Issues/Pull Requests which update Drifty Application CodehacktoberfestIssues/Pull Requests for HacktoberfestmaintenanceThis issue/PR is concerned about maintenance updates

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions