What I see in code in 99% of cases, private fields and lombok getters/setters, and I don't see any benefits of 'encapsulation' here, literally no encapsulation.
But serialization frameworks requires that convention. Hibernate/Jacson and other are looking for methods that starts with get/is/set to read or set the value.
Private fields with getters and setters that do nothing other than get and set are totally pointless, you're right. It's the ability to interrupt the user's command and do something else before getting or before or after setting that makes them useful.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What I see in code in 99% of cases, private fields and lombok getters/setters, and I don't see any benefits of 'encapsulation' here, literally no encapsulation.
But serialization frameworks requires that convention. Hibernate/Jacson and other are looking for methods that starts with
get
/is
/set
to read or set the value.As I know Hibernate does not always need getters.
But it is good point.
Private fields with getters and setters that do nothing other than get and set are totally pointless, you're right. It's the ability to interrupt the user's command and do something else before getting or before or after setting that makes them useful.