4 ms·
Java fields themselves, along with their setters and getters, are entry points in which to control via annotations whether properties are read-only, write-only,
by nwatson 5y ago
Java fields themselves, along with their setters and getters, are entry points in which to control via annotations whether properties are read-only, write-only, or read/write in multiple contexts (e.g. Spring Configuration, JSON de/serialization), how they're serialized in JSON (serialized type can be different, field name can be adjusted), field ordering, and human readability.
Just thinking setters and getters set and get the property is naive and retrograde.