Skip to content

Commit

Permalink
Merge pull request #1625 from woowacourse/hotfix/#no-issue
Browse files Browse the repository at this point in the history
fix: getPartByName 생성
  • Loading branch information
wonyongChoi05 authored Nov 23, 2023
2 parents 0d0b21e + 4312d22 commit ca36ca2
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 ca36ca2

Please sign in to comment.