Open ybroeker opened 3 years ago
I like your suggestion, as we also prefer to make everything non-nullable. But when we configure it at a wider scope, we need to be able to define exceptions to the rule, i.e. a @Nullable
annotation (or so). Maybe we could define the global setting in the config properties.
It would be nice, if
@NonNull
(or an alternative annotation) could be used at class or package-level to mark all fields as non null.Most of our classes look like this:
which could look like this if
@NonNull
on classes would be possible, where anything exceptsomeOptionalField
would be non-null:I don't know if
@NonNull
is the best approach for this, maybe a new annotation to specify default nullability for fields, inputs, parameters would be better.Maybe someone has an idea?