Skip to content

Instantly share code, notes, and snippets.

@TheAner
Last active March 3, 2020 14:42
Show Gist options
  • Save TheAner/295b6277116b3636473ea8e39dab246f to your computer and use it in GitHub Desktop.
Save TheAner/295b6277116b3636473ea8e39dab246f to your computer and use it in GitHub Desktop.
Lombok i jego wspaniałości - https://theaner.pl/lombok-i-jego-wspanialosci/
//Bez lomboka
public final class Pearson {
private final String firstName;
private final String secondName;
private final String species = "Human";
public Pearson(String firstName, String secondName) {
this.firstName = firstName;
this.secondName = secondName;
}
public String getFirstName() {return this.firstName;}
public String getSecondName() {return this.secondName;}
public String getSpecies() {return this.species;}
//equals, hashCode i toString
}
//Z lombokiem
@Value public class Pearson {
String firstName;
String secondName;
String species = "Human";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment