public static enum Nullable.Prevalence extends java.lang.Enum<Nullable.Prevalence>
ElementType.METHOD
to hint at how often it should return null
.Enum Constant and Description |
---|
NEVER
For method return values, returning
null will never happen. |
NORMAL
For method return values, returning
null is a part of normal program execution. |
RARE
For method return values, returning
null is a rare occurrence that may signify some deeper issue. |
Modifier and Type | Method and Description |
---|---|
static Nullable.Prevalence |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Nullable.Prevalence[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Nullable.Prevalence NORMAL
null
is a part of normal program execution.
null
is normal and expected.public static final Nullable.Prevalence RARE
null
is a rare occurrence that may signify some deeper issue.
null
is handled as a defensive measure but is rarely expected, and may signify some deeper issue upstream.
An assertion may be thrown and unit tests may fail, but an Exception
won't be thrown for program integrity's sake.public static final Nullable.Prevalence NEVER
null
will never happen.
null
is not allowed and may result in an Exception
.public static Nullable.Prevalence[] values()
for (Nullable.Prevalence c : Nullable.Prevalence.values()) System.out.println(c);
public static Nullable.Prevalence valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null