Skip to content

Commit 4306fdb

Browse files
committed
feat: 도메인에 final 추가
1 parent 25a1c1c commit 4306fdb

File tree

5 files changed

+24
-33
lines changed

5 files changed

+24
-33
lines changed

src/main/java/com/nexters/teamace/emotion/domain/Emotion.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package com.nexters.teamace.emotion.domain;
22

3-
import static lombok.AccessLevel.PROTECTED;
4-
53
import lombok.Getter;
6-
import lombok.NoArgsConstructor;
74

8-
@NoArgsConstructor(access = PROTECTED)
5+
@Getter
96
public class Emotion {
107

11-
@Getter private Long id;
12-
@Getter private String name;
13-
@Getter private String description;
8+
@Getter private final Long id;
9+
@Getter private final String name;
10+
@Getter private final String description;
1411

1512
public Emotion(final String name, final String description) {
13+
this.id = null;
1614
this.name = name;
1715
this.description = description;
1816
}

src/main/java/com/nexters/teamace/fairy/domain/AcquiredFairy.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
@Getter
66
public class AcquiredFairy {
7-
private Long id;
8-
private Long fairyId;
9-
private Long userId;
7+
private final Long id;
8+
private final Long fairyId;
9+
private final Long userId;
1010

1111
public AcquiredFairy(Long id, Long fairyId, Long userId) {
1212
this.id = id;
@@ -15,6 +15,8 @@ public AcquiredFairy(Long id, Long fairyId, Long userId) {
1515
}
1616

1717
public AcquiredFairy(Long fairyId, Long userId) {
18-
this(null, fairyId, userId);
18+
this.id = null;
19+
this.fairyId = fairyId;
20+
this.userId = userId;
1921
}
2022
}

src/main/java/com/nexters/teamace/fairy/domain/Fairy.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
package com.nexters.teamace.fairy.domain;
22

3-
import static lombok.AccessLevel.PROTECTED;
4-
53
import lombok.Getter;
6-
import lombok.NoArgsConstructor;
74

85
@Getter
9-
@NoArgsConstructor(access = PROTECTED)
106
public class Fairy {
117

12-
private Long id;
13-
private String name;
14-
private String imageUrl;
15-
private String silhouetteImageUrl;
16-
private Long emotionId;
8+
private final Long id;
9+
private final String name;
10+
private final String imageUrl;
11+
private final String silhouetteImageUrl;
12+
private final Long emotionId;
1713

1814
public Fairy(
1915
final String name,
2016
final String imageUrl,
2117
final String silhouetteImageUrl,
2218
final Long emotionId) {
19+
this.id = null;
2320
this.name = name;
2421
this.imageUrl = imageUrl;
2522
this.silhouetteImageUrl = silhouetteImageUrl;
2623
this.emotionId = emotionId;
2724
}
2825

29-
public Fairy(
30-
final Long id,
31-
final String name,
32-
final String imageUrl,
33-
final String silhouetteImageUrl,
34-
final Long emotionId) {
26+
public Fairy(Long id, String name, String imageUrl, String silhouetteImageUrl, Long emotionId) {
3527
this.id = id;
3628
this.name = name;
3729
this.imageUrl = imageUrl;

src/main/java/com/nexters/teamace/fairy/domain/FairyBook.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package com.nexters.teamace.fairy.domain;
22

3-
import static lombok.AccessLevel.PROTECTED;
4-
53
import java.util.List;
64
import lombok.Getter;
7-
import lombok.NoArgsConstructor;
85

96
@Getter
10-
@NoArgsConstructor(access = PROTECTED)
117
public class FairyBook {
128

13-
List<FairyBookEntry> fairies;
9+
private final List<FairyBookEntry> fairies;
1410

1511
public FairyBook(List<FairyBookEntry> fairies) {
1612
this.fairies = fairies;
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package com.nexters.teamace.fairy.domain;
22

3-
import lombok.AllArgsConstructor;
43
import lombok.Getter;
54

65
@Getter
7-
@AllArgsConstructor
86
public class FairyBookEntry {
97
private final Fairy fairy;
108
private final boolean acquired;
9+
10+
public FairyBookEntry(Fairy fairy, boolean acquired) {
11+
this.fairy = fairy;
12+
this.acquired = acquired;
13+
}
1114
}

0 commit comments

Comments
 (0)