Skip to content

Commit

Permalink
fix: getPartByName 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
wonyongChoi05 committed Nov 23, 2023
1 parent 987678c commit 4312d22
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/src/main/java/wooteco/prolog/member/domain/Part.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ public boolean isContainedBy(String name) {
.anyMatch(p -> p.name.equals(name));
}

public static Part getPartByName(String name) {
return Arrays.stream(values())
.filter(part -> part.name.equals(name))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException());
}

}

0 comments on commit 4312d22

Please sign in to comment.