blob: 897d84a118d66f4160c0bf0fe910d17974b055fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package com.stileeducation.markr.util;
import com.stileeducation.markr.entity.Student;
public class StudentBuilder {
private Long id;
private String firstName;
private String lastName;
private String studentNumber;
public StudentBuilder withId(Long id) {
this.id = id;
return this;
}
public StudentBuilder withFirstName(String firstName) {
this.firstName = firstName;
return this;
}
public StudentBuilder withLastName(String lastName) {
this.lastName = lastName;
return this;
}
public StudentBuilder withStudentNumber(String studentNumber) {
this.studentNumber = studentNumber;
return this;
}
public Student build() {
Student student = new Student();
student.setId(id);
student.setFirstName(firstName);
student.setLastName(lastName);
student.setStudentNumber(studentNumber);
return student;
}
}
|