java.lang.Object
com.baomidou.mybatisplus.core.toolkit.Assert

public final class Assert
extends Object
断言类
从以下版本开始:
2018-07-24
作者:
miemie
  • 构造器详细资料

    • Assert

      public Assert()
  • 方法详细资料

    • isTrue

      public static void isTrue​(boolean expression, String message, Object... params)
      断言这个 boolean 为 true

      为 false 则抛出异常

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

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

      为 true 则抛出异常

      参数:
      expression - boolean 值
      message - 消息
    • isNull

      public static void isNull​(Object object, String message, Object... params)
      断言这个 object 为 null

      不为 null 则抛异常

      参数:
      object - 对象
      message - 消息
    • notNull

      public static void notNull​(Object object, String message, Object... params)
      断言这个 object 不为 null

      为 null 则抛异常

      参数:
      object - 对象
      message - 消息
    • notEmpty

      public static void notEmpty​(String value, String message, Object... params)
      断言这个 value 不为 empty

      为 empty 则抛异常

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

      public static void notEmpty​(Collection<?> collection, String message, Object... params)
      断言这个 collection 不为 empty

      为 empty 则抛异常

      参数:
      collection - 集合
      message - 消息
    • notEmpty

      public static void notEmpty​(Map<?,​?> map, String message, Object... params)
      断言这个 map 不为 empty

      为 empty 则抛异常

      参数:
      map - 集合
      message - 消息
    • notEmpty

      public static void notEmpty​(Object[] array, String message, Object... params)
      断言这个 数组 不为 empty

      为 empty 则抛异常

      参数:
      array - 数组
      message - 消息