|
|
|
|
|
by smoyer
3524 days ago
|
|
That was my reaction the first time I was introduced to it. I looked at it again two years later and it just clicked. What's really cool is that the developer who has to go maintain it has 20% as much code to maintain. Say you want a POJO with accessors, mutators along with equals and hashcode. Let it generate the methods by defining a class like: @Data
public class something {
String name;
int age;
}
Lombok generates: public String getName() { ... }
public void setName(String name) { ... }
public int getAge() { ... }
public void setAge(int age) { ... }
public boolean equals(Something other) { ... }
public int hashcode() { ... }
public String toString() { ... }
|
|