Skip to content

Commit

Permalink
[FEAT] 예외처리를 위한 of 메서드 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks committed Jan 16, 2024
1 parent c0c0de2 commit a14a1eb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
package com.nonsoolmate.nonsoolmateServer.domain.member.entity.enums;

import static com.nonsoolmate.nonsoolmateServer.domain.auth.exception.AuthExceptionType.INVALID_PLATFORM_TYPE;

import com.nonsoolmate.nonsoolmateServer.domain.auth.exception.AuthException;
import java.util.Arrays;

public enum PlatformType {
NAVER, NONE
NAVER, NONE;

public static PlatformType of(String platformType) {
return Arrays.stream(PlatformType.values()).filter(type -> type.equals(platformType)).findAny()
.orElseThrow(() -> new AuthException(INVALID_PLATFORM_TYPE));
}
}

0 comments on commit a14a1eb

Please sign in to comment.