Skip to content

Commit

Permalink
refactor(Category): 질문 저장하는 자료형 Set으로 변경
Browse files Browse the repository at this point in the history
Co-Authored-By: tkdgur0906 <[email protected]>
  • Loading branch information
shin-jisong and tkdgur0906 committed Jul 25, 2024
1 parent b4b20de commit bd3d8d6
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package com.bang_ggood.category.domain;

import java.util.Arrays;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.Set;

public enum Category {

CLEAN(1, "청결", List.of(1, 2, 3, 4, 5)),
ROOM_CONDITION(2, "방 컨디션", List.of(6, 7, 8, 9, 10, 11)),
AMENITY(3, "편의시설", List.of(12, 13, 14)),
OPTION(4, "옵션", List.of(15, 16)),
ENVIRONMENT(5, "주거환경", List.of(17, 18, 19, 20, 21, 22)),
SECURITY(6, "보안", List.of(22, 23, 24, 25, 26, 27, 28, 29, 30)),
ECONOMIC(7, "경제적", List.of(31, 32));
CLEAN(1, "청결", new LinkedHashSet<>(Set.of(1, 2, 3, 4, 5))),
ROOM_CONDITION(2, "방 컨디션", new LinkedHashSet<>(Set.of(6, 7, 8, 9, 10, 11))),
AMENITY(3, "편의시설", new LinkedHashSet<>(Set.of(12, 13, 14))),
OPTION(4, "옵션", new LinkedHashSet<>(Set.of(15, 16))),
ENVIRONMENT(5, "주거환경", new LinkedHashSet<>(Set.of(17, 18, 19, 20, 21, 22))),
SECURITY(6, "보안", new LinkedHashSet<>(Set.of(22, 23, 24, 25, 26, 27, 28, 29, 30))),
ECONOMIC(7, "경제적", new LinkedHashSet<>(Set.of(31, 32)));

private final int id;
private final String description;
private final List<Integer> questionIds;
private final Set<Integer> questionIds;

Category(int id, String description, List<Integer> questionIds) {
Category(int id, String description, Set<Integer> questionIds) {
this.id = id;
this.description = description;
this.questionIds = questionIds;
Expand All @@ -36,7 +37,7 @@ public String getDescription() {
return description;
}

public List<Integer> getQuestionIds() {
public Set<Integer> getQuestionIds() {
return questionIds;
}
}

0 comments on commit bd3d8d6

Please sign in to comment.