public class Accertion {
public static void isBlank(String str,String message){
if(StringUtils.isNotBlank(str)){
throw new BusinessException(message);
}
}
public static void isNotBlank(String str,String message){
if(StringUtils.isBlank(str)){
throw new BusinessException(message);
}
}
public static void isNull(Object obj,String message){
if(Objects.nonNull(obj)){
throw new BusinessException(message);
}
}
public static void isNull(Object obj,ResponseCode responseCode){
if(Objects.nonNull(obj)){
throw new BusinessException(responseCode);
}
}
public static void isNotNull(Object obj,String message){
if(Objects.isNull(obj)){
throw new BusinessException(message);
}
}
public static void isNotNull(Object obj, ResponseCode responseCode){
if(Objects.isNull(obj)){
throw new BusinessException(responseCode);
}
}
public static void isNull(Collection collection, String message){
if(collection != null && collection.size() > 0){
throw new BusinessException(message);
}
}
public static void isNotNull(Collection collection, String message){
if(collection == null || collection.size() == 0){
throw new BusinessException(message);
}
}
public static void isEq(String str1,String str2,String message){
if(!str1.equals(str2)){
throw new BusinessException(message);
}
}
public static void isEq(String str1, String str2, ResponseCode responseCode){
if(!str1.equals(str2)){
throw new BusinessException(responseCode);
}
}
}