public @interface AssertNonNullIfFalse
For instance, if AbstractCollection.isEmpty()
is false, then
PriorityQueue.peek()
is nonnull. You can express
this relationship as:
@AssertNonNullIfFalse({"peek()"})
public boolean isEmpty() { ... }
Another example is this method:
// Returns whether the line is blank (or null).
@AssertNonNullIfFalse("#0")
private static boolean isBlank(@Nullable String line) {
return (line == null) || line.trim().equals("");
}
As a final example, consider this method:
// Indicates whether the representation has been erased
@AssertNonNullIfFalse("values")
public boolean repNulled() {
return values == null;
}
NonNull
,
AssertNonNullIfTrue
,
NullnessChecker
public abstract String[] value