File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
src/main/java/org/soujava/demos/mongodb/document Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 44import jakarta .nosql .Entity ;
55import jakarta .nosql .Id ;
66
7+ import java .util .Objects ;
8+
79@ Entity
810public class Room {
911
@@ -28,4 +30,59 @@ public class Room {
2830 @ Column
2931 private boolean underMaintenance ;
3032
33+ public String getId () {
34+ return id ;
35+ }
36+
37+ public int getRoomNumber () {
38+ return roomNumber ;
39+ }
40+
41+ public RoomType getType () {
42+ return type ;
43+ }
44+
45+ public RoomStatus getStatus () {
46+ return status ;
47+ }
48+
49+ public CleanStatus getCleanStatus () {
50+ return cleanStatus ;
51+ }
52+
53+ public boolean isSmokingAllowed () {
54+ return smokingAllowed ;
55+ }
56+
57+ public boolean isUnderMaintenance () {
58+ return underMaintenance ;
59+ }
60+
61+
62+ @ Override
63+ public boolean equals (Object o ) {
64+ if (o == null || getClass () != o .getClass ()) {
65+ return false ;
66+ }
67+ Room room = (Room ) o ;
68+ return Objects .equals (id , room .id );
69+ }
70+
71+ @ Override
72+ public int hashCode () {
73+ return Objects .hashCode (id );
74+ }
75+
76+ @ Override
77+ public String toString () {
78+ return "Room{" +
79+ "id='" + id + '\'' +
80+ ", roomNumber=" + roomNumber +
81+ ", type=" + type +
82+ ", status=" + status +
83+ ", cleanStatus=" + cleanStatus +
84+ ", smokingAllowed=" + smokingAllowed +
85+ ", underMaintenance=" + underMaintenance +
86+ '}' ;
87+ }
3188}
You can’t perform that action at this time.
0 commit comments