Declaring a private variable and accessing it through the public getter/setter method (the encapsulation principle in Java) can be utilised to add custom validations in the setter method.
For Eg: If I put a negative number validation in my setBalance() setter method in Bank Class, I can restrict negative amount deposition in the Bank. That means accidental changes in the fields can be restricted. So if I am using lombok, obviously I don't need to define getter/setter method. What can I possibly do to incorporate the above mentioned validation.
Wouldn't it restrict leveraging the data encapsulation property of Java?