update 统一格式化代码结构

This commit is contained in:
疯狂的狮子li
2021-10-22 10:04:15 +08:00
parent 32bfe334c0
commit 336adbd056
54 changed files with 806 additions and 987 deletions

View File

@ -24,9 +24,9 @@ public class JsonUtils {
private static ObjectMapper objectMapper = SpringUtils.getBean(ObjectMapper.class);
public static String toJsonString(Object object) {
if (StringUtils.isNull(object)) {
return null;
}
if (StringUtils.isNull(object)) {
return null;
}
try {
return objectMapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
@ -57,9 +57,9 @@ public class JsonUtils {
}
public static <T> T parseObject(String text, TypeReference<T> typeReference) {
if (StringUtils.isBlank(text)) {
return null;
}
if (StringUtils.isBlank(text)) {
return null;
}
try {
return objectMapper.readValue(text, typeReference);
} catch (IOException e) {
@ -67,16 +67,17 @@ public class JsonUtils {
}
}
public static <T> Map<String, T> parseMap(String text) {
if (StringUtils.isBlank(text)) {
return null;
}
try {
return objectMapper.readValue(text, new TypeReference<Map<String, T>>() {});
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static <T> Map<String, T> parseMap(String text) {
if (StringUtils.isBlank(text)) {
return null;
}
try {
return objectMapper.readValue(text, new TypeReference<Map<String, T>>() {
});
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static <T> List<T> parseArray(String text, Class<T> clazz) {
if (StringUtils.isEmpty(text)) {