类 AssertUtils

java.lang.Object
com.cdkjframework.util.tool.AssertUtils

@Component public class AssertUtils extends Object
  • 构造器详细资料

    • AssertUtils

      public AssertUtils()
  • 方法详细资料

    • isEmptyMessage

      public static <T> void isEmptyMessage(T t) throws GlobalRuntimeException
      对象断言
      类型参数:
      T - 类型
      参数:
      t - 实体
      抛出:
      GlobalRuntimeException - 异常信息
    • isEmptyMessage

      public static void isEmptyMessage(String key) throws GlobalRuntimeException
      对象断言
      参数:
      key - 验证字段
      抛出:
      GlobalRuntimeException - 异常信息
    • isEmptyMessage

      public static void isEmptyMessage(String key, String message) throws GlobalRuntimeException
      对象断言
      参数:
      key - 验证字段
      message - 消息
      抛出:
      GlobalRuntimeException - 异常信息
    • isEmptyMessage

      public static <T> void isEmptyMessage(T t, String message) throws GlobalRuntimeException
      对象断言
      类型参数:
      T - 类型
      参数:
      t - 实体
      message - 错误信息
      抛出:
      GlobalRuntimeException - 异常信息
    • isNotEmptyMessage

      public static void isNotEmptyMessage(String value, String message)
      断言这个 value 不为 empty

      为 empty 则抛异常

      参数:
      value - 字符串
      message - 消息
    • isNotEmptyMessage

      public static <T> void isNotEmptyMessage(T t, String message)
      断言这个 value 不为 empty

      为 empty 则抛异常

      类型参数:
      T - 泛型
      参数:
      t - 字符串
      message - 消息
    • isListEmpty

      public static void isListEmpty(List<?> list) throws GlobalRuntimeException
      断言数据集是为空
      参数:
      list - 数据集
      抛出:
      GlobalRuntimeException - 异常信息
    • isListEmpty

      public static void isListEmpty(List<?> list, String message) throws GlobalRuntimeException
      断言数据集是为空
      参数:
      list - 数据集
      message - 错误信息
      抛出:
      GlobalRuntimeException - 异常信息
    • isTrue

      public static void isTrue(boolean expression, String message) throws GlobalRuntimeException
      断言这个 boolean 为 true

      为 false 则抛出异常

      参数:
      expression - boolean 值
      message - 消息
      抛出:
      GlobalRuntimeException
    • isFalse

      public static void isFalse(boolean expression, String message)
      断言这个 boolean 为 false

      为 true 则抛出异常

      参数:
      expression - boolean 值
      message - 消息