zl程序教程

您现在的位置是:首页 >  后端

当前栏目

spring源码之—Assert.notNull详解编程语言

Spring源码编程语言 详解 assert NotNull
2023-06-13 09:20:39 时间
org.springframework.core.io.support.EncodedResource中 

public EncodedResource(Resource resource, String encoding) { 

 Assert.notNull("Resource is required"); 

 this.resource = resource; 

 this.encoding = encoding; 

}

 


* Assert that an object is not code null /code . * pre Assert.notNull(clazz, "The class must not be null");

* @param object the object to check
* @param message the exception message to use if the assertion fails
* @throws IllegalArgumentException if the object is code null /code
*/
public static void notNull(Object object, String message) {
if (object == null) {
throw new IllegalArgumentException(message);
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/13333.html

cjava