Skip to content

Commit

Permalink
feat: 검증 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Feb 8, 2024
1 parent 4cc0683 commit 5131e5e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/com/gdschongik/gdsc/domain/member/domain/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,16 @@ private void updateNickname(String nickname) {
this.nickname = nickname;
}
}

private void validateStringNotNull(String value) {
if (value == null) {
throw new CustomException(ErrorCode.METHOD_ARGUMENT_NULL);
}
}

private void validateRegex(String value, String regex) {
if (!value.matches(regex)) {
throw new CustomException(ErrorCode.REGEX_VIOLATION);
}
}
}

0 comments on commit 5131e5e

Please sign in to comment.