Skip to content

Commit 9b5f231

Browse files
committed
refactor: 添加 @SuppressWarnings("unchecked") 到 JsonUtil
1 parent 424eb9e commit 9b5f231

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/info/cadecode/simple/util/JsonUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public static String objToStr(Object obj, boolean isPretty) {
8181
* @param clazz 自定义对象的 class 对象
8282
* @return 自定义对象
8383
*/
84+
@SuppressWarnings("unchecked")
8485
public static <T> T str2Obj(String str, Class<T> clazz) {
8586
if (StringUtil.isEmpty(str) || clazz == null) {
8687
return null;
@@ -103,6 +104,7 @@ public static <T> T str2Obj(String str, Class<T> clazz) {
103104
* @param typeReference 自定义对象的 TypeReference 对象
104105
* @return 自定义对象
105106
*/
107+
@SuppressWarnings("unchecked")
106108
public static <T> T str2Obj(String str, TypeReference<T> typeReference) {
107109
if (StringUtil.isEmpty(str) || typeReference == null) {
108110
return null;

0 commit comments

Comments
 (0)