Posted on

POJO, equals, hashcode

How to simplify developing of pojo classes?

Problems:

  • pojo class is simple class with members, getters, setters. To keep test coverage more  80% we should develop tests for pojo classes. But it is a ridiculous.
  • do not forget to add new members to equals and hashcode methods.

Decisions:

  • Lombok. We have to type just members of class and use annotations. But there are problems:
    • final members without initialization
    • there are conflicts in annotationProcessor
  • AutoValue. by Google.
    • complicated to use
    • generate child class
  • Kotlin data classes.
    • by Google
    • no problems in annotationProcessor
    • we use Kotlin!!!
Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.