Warning
Type-checking for this annotation is not implemented at present.
Here is an example use:
@AssertNonNullIfNonNull("id")
@Pure
public @Nullable Long getId() {
return id;
}
Note the direction of the implication. This annotation says that if the result is non-null, then
the variable id is also non-null. The annotation does not say that if id is
non-null, then the result is non-null. (There is not currently a way to say the latter, though it
would also be useful.)
You should not write a formal parameter name or this as the argument of this
annotation. In those cases, use the PolyNull annotation instead.
NonNull, PolyNull, org.checkerframework.checker.nullness.NullnessChecker
| Modifier and Type | Method and Description |
|---|---|
| public String[] |
| value | back to summary |
|---|---|
| public String[] value() Java expression(s) that are non-null after the method returns a non-null value. | |