Skip to content

Commit cacb076

Browse files
committed
feat: enhance room to include a builder
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent 628fe35 commit cacb076

File tree

1 file changed

+22
-0
lines changed
  • src/main/java/org/soujava/demos/mongodb/document

1 file changed

+22
-0
lines changed

src/main/java/org/soujava/demos/mongodb/document/Room.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ public class Room {
3030
@Column
3131
private boolean underMaintenance;
3232

33+
34+
public Room() {
35+
}
36+
37+
public Room(String id, int roomNumber,
38+
RoomType type, RoomStatus status,
39+
CleanStatus cleanStatus,
40+
boolean smokingAllowed, boolean underMaintenance) {
41+
this.id = id;
42+
this.roomNumber = roomNumber;
43+
this.type = type;
44+
this.status = status;
45+
this.cleanStatus = cleanStatus;
46+
this.smokingAllowed = smokingAllowed;
47+
this.underMaintenance = underMaintenance;
48+
}
49+
3350
public String getId() {
3451
return id;
3552
}
@@ -85,4 +102,9 @@ public String toString() {
85102
", underMaintenance=" + underMaintenance +
86103
'}';
87104
}
105+
106+
107+
public static RoomBuilder builder() {
108+
return new RoomBuilder();
109+
}
88110
}

0 commit comments

Comments
 (0)