|
|
|
@ -21,23 +21,23 @@ public class Person {
|
|
|
|
|
|
|
|
|
|
public static class PersonBuilder {
|
|
|
|
|
Person person = new Person();
|
|
|
|
|
public PersonBuilder buildBasicInfo(int id, String name) {
|
|
|
|
|
public PersonBuilder basicInfo(int id, String name) {
|
|
|
|
|
person.id = id;
|
|
|
|
|
person.name = name;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PersonBuilder buildAge(int age) {
|
|
|
|
|
public PersonBuilder age(int age) {
|
|
|
|
|
person.age = age;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PersonBuilder buildScore(int score) {
|
|
|
|
|
public PersonBuilder score(int score) {
|
|
|
|
|
person.score = score;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PersonBuilder buildLocation(String street, String roomNo) {
|
|
|
|
|
public PersonBuilder location(String street, String roomNo) {
|
|
|
|
|
person.location = new Location(street, roomNo);
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|