package com.nova.sankuai.infra.utils;
|
|
import java.util.Objects;
|
|
public class PubFunUtil {
|
private static PubFunUtil pubFun = null;
|
public static PubFunUtil getInstance() {
|
if (null == pubFun) {
|
pubFun = new PubFunUtil();
|
}
|
return pubFun;
|
}
|
|
public PubFunUtil(){
|
|
}
|
|
/**
|
* Describe:判断字符串是否为json格式
|
*
|
* @param str : String 字符串
|
* @return true是
|
* Author: 纪新雷
|
* CreateTime: 2022-08-18
|
*/
|
public boolean isJSON2(String str) {
|
boolean result = false;
|
try {
|
Object obj = com.alibaba.fastjson.JSON.parse(str);
|
result = true;
|
} catch (Exception e) {
|
result = false;
|
}
|
return result;
|
}
|
/**
|
* Describe:判断List是否为空
|
*
|
* @param listValue : java.util.List 值
|
* @return true 为空
|
* Author: 纪新雷
|
* CreateTime: 2024-03-28
|
*/
|
public boolean listIsNull(java.util.List listValue) {
|
|
//return ((null == listValue) || (CollectionUtils.isEmpty(listValue)) || (listValue.isEmpty())) ;
|
return ((null == listValue) || Objects.isNull(listValue) || (listValue.isEmpty())) ;
|
}
|
/**
|
* Describe:判断Integer是否为空
|
*
|
* @param ai_value : Integer 值
|
* @return true 为空
|
* Author: 纪新雷
|
* CreateTime: 2024-03-15
|
*/
|
public boolean integerIsNull(Integer ai_value) {
|
|
return ((null == ai_value) || (Objects.isNull(ai_value))) ;
|
}
|
}
|