Assert.hasText()方法的用法,我们看源码可以知道
public static void hasText(java.lang.String text);
0 aload_0 [text]
[b] 1 ldc <String "[Assertion failed] - this String argument must have text; it must not be null, empty, or blank"> [58][/b]
3 invokestatic org.springframework.util.Assert.hasText(java.lang.String, java.lang.String) : void [60]
6 return
Line numbers:
[pc: 0, line: 174]
[pc: 6, line: 176]
Local variable table:
[pc: 0, pc: 7] local: text index: 0 type: java.lang.String
一条我们可以看到这个方法可以进行非空验证
public static void hasText(java.lang.String text);
0 aload_0 [text]
[b] 1 ldc <String "[Assertion failed] - this String argument must have text; it must not be null, empty, or blank"> [58][/b]
3 invokestatic org.springframework.util.Assert.hasText(java.lang.String, java.lang.String) : void [60]
6 return
Line numbers:
[pc: 0, line: 174]
[pc: 6, line: 176]
Local variable table:
[pc: 0, pc: 7] local: text index: 0 type: java.lang.String
一条我们可以看到这个方法可以进行非空验证