Created
July 30, 2020 11:50
-
-
Save eliasnogueira/fbf7a45d6c61e1464070308a545d3ea8 to your computer and use it in GitHub Desktop.
Blog post about Data Management - PersonBuilder code snippet
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
public class PersonBuilder { | |
private String name; | |
private int age; | |
public PersonBuilder setName(String name) { | |
this.name = name; | |
return this; | |
} | |
public PersonBuilder setAge(int age) { | |
this.age = age; | |
return this; | |
} | |
public Person build() { | |
return new Person(name, age); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment