diff --git a/backend/src/main/java/wooteco/prolog/member/domain/Part.java b/backend/src/main/java/wooteco/prolog/member/domain/Part.java index bc65384eb..36cf9e6a1 100644 --- a/backend/src/main/java/wooteco/prolog/member/domain/Part.java +++ b/backend/src/main/java/wooteco/prolog/member/domain/Part.java @@ -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()); + } + }