blob: 70fcecd53715218771ddd2a4799e0a32579dc556 (
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
|
package com.stileeducation.markr.util;
import com.stileeducation.markr.entity.Student;
import com.stileeducation.markr.entity.Test;
import com.stileeducation.markr.entity.TestResult;
public class TestResultBuilder {
private Long id;
private Student student;
private Test test;
private Integer marksObtained;
public TestResultBuilder withId(Long id) {
this.id = id;
return this;
}
public TestResultBuilder withStudent(Student student) {
this.student = student;
return this;
}
public TestResultBuilder withTest(Test test) {
this.test = test;
return this;
}
public TestResultBuilder withMarksObtained(Integer marksObtained) {
this.marksObtained = marksObtained;
return this;
}
public TestResult build() {
return new TestResult(id, student, test, marksObtained);
}
}
|