Original URL: Spring tool class - the use of Assert_IT sharp knife unsheathed blog-CSDN blog
Introduction
illustrate
This article introduces the usage of Spring's Assert tool class.
The role of the Assert tool class: to judge a certain field, for example: to determine that it is not null, if it is null, this tool class will report an error.
package location
org/springframework/util/Assert.java
example
Assert.notNull(obj, "cannot be empty")
At this time, if obj is null, an exception will be thrown, and the message of the exception is "cannot be null".
Usage Encyclopedia
The above is part of the content of the article. For the convenience of maintenance, the full text has been transferred to this website: Spring Tool Class - Assert Use - Self-study Wizard