notnull
notnull
-
NotNull : @ NotNull annotation ensures that the annotated element must not be null .
NotNull:@NotNull确保被注解的元素不能为null。
-
Out of the box , OVal supports this constraint with the @ NotNull annotation , which is specified before any desired parameter for a method .
OVal通过@NotNull标注支持此约束条件,该标注在方法所需的所有参数前指定。
-
I can be a little pickier and specify EasyMock . notNull () to allow only non-null strings
还可以更挑剔一点儿,通过指定EasyMock.notNull()只允许非null字符串
-
Now , @ NotNull is by no means the only constraint OVal provides , but I 've found it quite useful in limiting those nasty NullPointerExceptions , or at least exposing them quickly .
当然,@NotNull绝不是OVal提供的惟一约束条件,但我发现它能非常有效地限制这些令人讨厌的NullPointerException,或至少能够快速地暴露它们。