260109_01_ENH : PageRequest, PageResponse 이동, 유틸 생성, 코드 이넘 컨버터 추가 및 등록

This commit is contained in:
2026-01-09 14:22:05 +09:00
parent 6f6abdc385
commit 5c6439743b
8 changed files with 215 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
package com.kri.common.util;
import java.util.UUID;
public final class CommonUtil {
public static String uuid32() {
return UUID.randomUUID().toString().replace("-", "");
}
public static boolean isNumeric(String s) {
if (s == null || s.isBlank()) return false;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c < '0' || c > '9') return false;
}
return true;
}
public static short safeParseShort(String s, short def) {
try {
return Short.parseShort(s);
} catch (Exception e) {
return def;
}
}
public static int safeParseInt(String s, short def) {
try {
return Integer.parseInt(s);
} catch (Exception e) {
return def;
}
}
public static long safeParseLong(String s, short def) {
try {
return Long.parseLong(s);
} catch (Exception e) {
return def;
}
}
}