Last active
March 3, 2020 14:42
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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