You can’t do the same as a
@NotNull annotation for a primitive
boolean, because the primitive
boolean has only 2 possible values, and none of them represent the lack of a value.
If you want a 3-state value, with states
missing, you must use
Or you can use an
enum with 3 values.
CLICK HERE to find out more related problems solutions.