Skip to content

Commit

Permalink
#48 [fix] DayOfWeek index 값을 주면, value 값을 가져오는 함수 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyejungg committed Sep 7, 2022
1 parent 96ca59c commit c9f35d4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/hous/server/domain/todo/DayOfWeek.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,24 @@ public static String toString(Set<DayOfWeek> dayOfWeekSet) {
.map(DayOfWeek::getValue)
.collect(Collectors.joining(", "));
}

public static String fromIndex(int index) {
switch (index) {
case 1:
return MONDAY.getValue();
case 2:
return TUESDAY.getValue();
case 3:
return WEDNESDAY.getValue();
case 4:
return THURSDAY.getValue();
case 5:
return FRIDAY.getValue();
case 6:
return SATURDAY.getValue();
case 7:
return SUNDAY.getValue();
}
return null;
}
}

0 comments on commit c9f35d4

Please sign in to comment.