NonNullByDefault annotation.
Each constant of this enum describes a specific kind of type use.
Wildcards and the use of type variables are always excluded from NonNullByDefault.
| Modifier and Type | Field and Description |
|---|---|
| public static final DefaultLocation | ARRAY_CONTENTS
Defines that a given |
| public static final DefaultLocation | FIELD
Defines that a given |
| public static final DefaultLocation | PARAMETER
Defines that a given |
| public static final DefaultLocation | RETURN_TYPE
Defines that a given |
| public static final DefaultLocation | TYPE_ARGUMENT
Defines that a given |
| public static final DefaultLocation | TYPE_BOUND
Defines that a given |
| public static final DefaultLocation | TYPE_PARAMETER
Defines that a given |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static DefaultLocation | |
| public static DefaultLocation[] |
| ARRAY_CONTENTS | back to summary |
|---|---|
| public static final DefaultLocation ARRAY_CONTENTS Defines that a given Example @NonNullByDefault(ARRAY_CONTENTS)
interface X {
Number[] n1;
Number[][] n2;
}
These declarations are interpreted as: @NonNull Number [] n1; @NonNull Number [] @NonNull[] n2;
I.e., both fields can still be | |
| FIELD | back to summary |
|---|---|
| public static final DefaultLocation FIELD Defines that a given Example @NonNullByDefault(FIELD)
class X {
Number number = Integer.MAX_VALUE;
}
Here | |
| PARAMETER | back to summary |
|---|---|
| public static final DefaultLocation PARAMETER Defines that a given Example @NonNullByDefault(PARAMETER)
interface X {
void print(Number n);
}
Here | |
| RETURN_TYPE | back to summary |
|---|---|
| public static final DefaultLocation RETURN_TYPE Defines that a given Example @NonNullByDefault(RETURN_TYPE)
interface X {
Number getNumber();
}
Here | |
| TYPE_ARGUMENT | back to summary |
|---|---|
| public static final DefaultLocation TYPE_ARGUMENT Defines that a given Example @NonNullByDefault(TYPE_ARGUMENT)
interface X<T> {
void process(List<T> tl, List<Number> nl);
}
Here | |
| TYPE_BOUND | back to summary |
|---|---|
| public static final DefaultLocation TYPE_BOUND Defines that a given Example @NonNullByDefault(TYPE_BOUND)
interface X {
<T extends Number> void process(T t, List<? super Number> l);
}
Here both occurrences of | |
| TYPE_PARAMETER | back to summary |
|---|---|
| public static final DefaultLocation TYPE_PARAMETER Defines that a given Example @NonNullByDefault(TYPE_PARAMETER)
class X {
<T> T identity(T t) { return t; }
}
Here | |
| DefaultLocation | back to summary |
|---|---|
| private DefaultLocation() | |
| valueOf | back to summary |
|---|---|
| public static DefaultLocation valueOf(String name) | |
| values | back to summary |
|---|---|
| public static DefaultLocation[] values() | |