On the one hand there is @NonNull
, for which Oracle says "The compiler can determine cases where a code path might receive a null value, without ever having to debug a NullPointerException
.". So, I suppose it is processed at compile time.
On the other hand there is @Inject
, which injects constructors, methods and fields regardless of their access modifiers. So, I suppose they are processed at runtime.
One more thing that confuses me is that the fields can be injected at runtime even though they are private. Does it mean that the fields that have @Inject
must have setter?