-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuestHouse.java
More file actions
145 lines (115 loc) · 3.77 KB
/
GuestHouse.java
File metadata and controls
145 lines (115 loc) · 3.77 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package main.java.com.example.model;
import java.util.ArrayList;
import java.util.List;
public class GuestHouse {
private Long guesthouseId;
private String guesthouseName;
private String location;
private String facilities;
private String contact;
private String intro;
private double averageRating;
private String[] hashtag;
private String image;
// Employer와의 관계
private Employer employer;
// Announcement와의 1:N 관계
private List<Announcement> announcements = new ArrayList<>();
// GuestHouseReview와의 1:N 관계
private List<GuestHouseReview> reviews = new ArrayList<>();
// Getters and Setters
public Long getGuesthouseId() {
return guesthouseId;
}
public void setGuesthouseId(Long guesthouseId) {
this.guesthouseId = guesthouseId;
}
public String getGuesthouseName() {
return guesthouseName;
}
public void setGuesthouseName(String guesthouseName) {
this.guesthouseName = guesthouseName;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getFacilities() {
return facilities;
}
public void setFacilities(String facilities) {
this.facilities = facilities;
}
public String getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public double getAverageRating() {
return averageRating;
}
public void setAverageRating(double averageRating) {
this.averageRating = averageRating;
}
public String[] getHashtag() {
return hashtag;
}
public void setHashtag(String[] hashtag) {
this.hashtag = hashtag;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Employer getEmployer() {
return employer;
}
public void setEmployer(Employer employer) {
this.employer = employer;
}
public List<Announcement> getAnnouncements() {
return announcements;
}
public void addAnnouncement(Announcement announcement) {
announcements.add(announcement);
}
public List<GuestHouseReview> getReviews() {
return reviews;
}
public void addReview(GuestHouseReview review) {
reviews.add(review);
review.setGuestHouse(this); // GuestHouseReview의 GuestHouse 설정
}
public void displayGuestHouseDetails() {
System.out.println("GuestHouse Details:");
System.out.println("ID: " + guesthouseId);
System.out.println("Name: " + guesthouseName);
System.out.println("Location: " + location);
System.out.println("Facilities: " + facilities);
System.out.println("Contact: " + contact);
System.out.println("Intro: " + intro);
System.out.println("Average Rating: " + averageRating);
System.out.println("Hashtags: " + (hashtag != null ? String.join(", ", hashtag) : "No hashtags"));
System.out.println("Image: " + image);
System.out.println("Employer: " + (employer != null ? employer.getEmployerName() : "No Employer"));
System.out.println("Announcements:");
for (Announcement announcement : announcements) {
System.out.println("- " + announcement.getTitle());
}
System.out.println("Reviews:");
for (GuestHouseReview review : reviews) {
System.out.println("- Review ID: " + review.getReviewId() + ", Rating: " + review.getRating());
}
}
}