Skip to content

Commit 628fe35

Browse files
committed
feat: define room builder
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent 28cc9df commit 628fe35

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package org.soujava.demos.mongodb.document;
2+
3+
public class RoomBuilder {
4+
private String id;
5+
private int roomNumber;
6+
private RoomType type;
7+
private RoomStatus status;
8+
private CleanStatus cleanStatus;
9+
private boolean smokingAllowed;
10+
private boolean underMaintenance;
11+
12+
public RoomBuilder id(String id) {
13+
this.id = id;
14+
return this;
15+
}
16+
17+
public RoomBuilder roomNumber(int roomNumber) {
18+
this.roomNumber = roomNumber;
19+
return this;
20+
}
21+
22+
public RoomBuilder type(RoomType type) {
23+
this.type = type;
24+
return this;
25+
}
26+
27+
public RoomBuilder status(RoomStatus status) {
28+
this.status = status;
29+
return this;
30+
}
31+
32+
public RoomBuilder cleanStatus(CleanStatus cleanStatus) {
33+
this.cleanStatus = cleanStatus;
34+
return this;
35+
}
36+
37+
public RoomBuilder smokingAllowed(boolean smokingAllowed) {
38+
this.smokingAllowed = smokingAllowed;
39+
return this;
40+
}
41+
42+
public RoomBuilder underMaintenance(boolean underMaintenance) {
43+
this.underMaintenance = underMaintenance;
44+
return this;
45+
}
46+
47+
public Room createRoom() {
48+
return new Room(id, roomNumber, type, status, cleanStatus, smokingAllowed, underMaintenance);
49+
}
50+
}

0 commit comments

Comments
 (0)