-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
246 additions
and
52 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
Api/src/main/java/allchive/server/api/common/util/StringParamUtil.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
Api/src/main/java/allchive/server/api/common/util/StringUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package allchive.server.api.common.util; | ||
|
||
|
||
import allchive.server.core.error.exception.EmptyParamValueException; | ||
import org.springframework.stereotype.Component; | ||
|
||
import static allchive.server.core.consts.AllchiveConst.HANGUL_BASE; | ||
import static allchive.server.core.consts.AllchiveConst.KOREAN_ALPHA; | ||
|
||
@Component | ||
public class StringUtil { | ||
public static void checkEmptyString(String param) { | ||
if (param.equals("")) { | ||
throw EmptyParamValueException.EXCEPTION; | ||
} | ||
} | ||
|
||
public static char extractKoreanInitial(char ch) { | ||
int index = (ch - HANGUL_BASE) / (21 * 28); // 21개의 중성, 28개의 종성 | ||
return KOREAN_ALPHA[index]; | ||
} | ||
|
||
public static boolean isEnglish(char ch) { | ||
return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); | ||
} | ||
|
||
public static boolean isKorean(char ch) { | ||
return (ch >= '\uAC00' && ch <= '\uD7A3'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.