cn.hutool.core.lang.Assert.isNull()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(558)

本文整理了Java中cn.hutool.core.lang.Assert.isNull()方法的一些代码示例,展示了Assert.isNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.isNull()方法的具体详情如下:
包路径:cn.hutool.core.lang.Assert
类名称:Assert
方法名:isNull

Assert.isNull介绍

[英]断言对象是否为 null ,如果不为 null 抛出 IllegalArgumentException 异常

Assert.isNull(value);

[中]断言对象是否为 无效的如果不为 无效的抛出 非法辩论例外异常

Assert.isNull(value);

代码示例

代码示例来源:origin: looly/hutool

/**
 * 断言对象是否为{@code null} ,如果不为{@code null} 抛出{@link IllegalArgumentException} 异常
 * 
 * <pre class="code">
 * Assert.isNull(value);
 * </pre>
 * 
 * @param object 被检查对象
 * @throws NullPointerException if the object is not {@code null}
 */
public static void isNull(Object object) throws NullPointerException {
  isNull(object, "[Assertion failed] - the object argument must be null");
}

代码示例来源:origin: looly/hutool

/**
 * 断言对象是否为{@code null} ,如果不为{@code null} 抛出{@link IllegalArgumentException} 异常
 * 
 * <pre class="code">
 * Assert.isNull(value);
 * </pre>
 * 
 * @param object 被检查对象
 * @throws NullPointerException if the object is not {@code null}
 */
public static void isNull(Object object) throws NullPointerException {
  isNull(object, "[Assertion failed] - the object argument must be null");
}

代码示例来源:origin: cn.hutool/hutool-all

/**
 * 断言对象是否为{@code null} ,如果不为{@code null} 抛出{@link IllegalArgumentException} 异常
 * 
 * <pre class="code">
 * Assert.isNull(value);
 * </pre>
 * 
 * @param object 被检查对象
 * @throws NullPointerException if the object is not {@code null}
 */
public static void isNull(Object object) throws NullPointerException {
  isNull(object, "[Assertion failed] - the object argument must be null");
}

相关文章