Repository navigation
Expand file tree
/
Copy pathQuestion.java
More file actions
96 lines (89 loc) · 2.44 KB
/
Copy pathQuestion.java
File metadata and controls
96 lines (89 loc) · 2.44 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
package next.model;
import java.util.Date;
public class Question {
private long questionId;
private String writer;
private String title;
private String contents;
private Date createdDate;
private int countOfAnswer;
public Question(long questionId, String writer, String title, String contents, Date createdDate,
int countOfAnswer) {
this.questionId = questionId;
this.writer = writer;
this.title = title;
this.contents = contents;
this.createdDate = createdDate;
this.countOfAnswer = countOfAnswer;
}
public long getQuestionId() {
return questionId;
}
public String getWriter() {
return writer;
}
public String getTitle() {
return title;
}
public String getContents() {
return contents;
}
public Date getCreatedDate() {
return createdDate;
}
public int getCountOfAnswer() {
return countOfAnswer;
}
@Override
public String toString() {
return "Question [questionId=" + questionId + ", writer=" + writer + ", title=" + title + ", contents="
+ contents + ", createdDate=" + createdDate + ", countOfAnswer=" + countOfAnswer + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((contents == null) ? 0 : contents.hashCode());
result = prime * result + countOfAnswer;
result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
result = prime * result + (int) (questionId ^ (questionId >>> 32));
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((writer == null) ? 0 : writer.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Question other = (Question) obj;
if (contents == null) {
if (other.contents != null)
return false;
} else if (!contents.equals(other.contents))
return false;
if (countOfAnswer != other.countOfAnswer)
return false;
if (createdDate == null) {
if (other.createdDate != null)
return false;
} else if (!createdDate.equals(other.createdDate))
return false;
if (questionId != other.questionId)
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
if (writer == null) {
if (other.writer != null)
return false;
} else if (!writer.equals(other.writer))
return false;
return true;
}
}