/
Details.java
62 lines (49 loc) 路 1.67 KB
/
Details.java
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
package com.woowacourse.moamoa.study.domain;
import static lombok.AccessLevel.PROTECTED;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import lombok.NoArgsConstructor;
@Embeddable
@NoArgsConstructor(access = PROTECTED)
public class Details {
private static final String CLOSE = "CLOSE";
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String excerpt;
@Column(nullable = false)
private String thumbnail;
@Column(nullable = false)
private String status;
@Column(nullable = false)
private String description;
public Details(final String title, final String excerpt, final String thumbnail, final String status,
final String description) {
this.title = title;
this.excerpt = excerpt;
this.thumbnail = thumbnail;
this.status = status;
this.description = description;
}
public boolean isCloseStatus() {
return status.equals(CLOSE);
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Details details = (Details) o;
return Objects.equals(title, details.title) && Objects.equals(excerpt, details.excerpt)
&& Objects.equals(thumbnail, details.thumbnail) && Objects.equals(status,
details.status) && Objects.equals(description, details.description);
}
@Override
public int hashCode() {
return Objects.hash(title, excerpt, thumbnail, status, description);
}
}