类 Assert

java.lang.Object
cn.smallbun.screw.core.util.Assert

public class Assert extends Object
断言
作者:
SanLi Created by qinggang.zuo@gmail.com / 2689170096@qq.com on 2020/3/30 22:18
  • 构造器详细资料

    • Assert

      public Assert()
  • 方法详细资料

    • isTrue

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

      为 false 则抛出异常

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

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

      为 true 则抛出异常

      参数:
      expression - Boolean boolean 值
      message - String 消息
      params - Object
    • isNull

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

      不为 null 则抛异常

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

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

      为 null 则抛异常

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

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

      为 empty 则抛异常

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

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

      为 empty 则抛异常

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

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

      为 empty 则抛异常

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

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

      为 empty 则抛异常

      参数:
      array - Object 数组
      message - String消息
      params - String 参数