Enum Class Nullability
- All Implemented Interfaces:
Serializable,Comparable<Nullability>,Constable
The declared nullability of a
Parameter, as reported by a NullabilityResolver.
This is deliberately three-valued. Absence of a Nullable annotation is not evidence that a parameter is
non-null, since most Java code carries no nullability annotations at all. A resolver that cannot form an opinion
therefore reports UNKNOWN rather than NON_NULL, allowing lower-priority resolvers to answer and
letting the caller apply its own default.
Marked Internal as it forms part of the NullabilityResolver contract.
- Since:
- 5.3.0
- Author:
- Mateusz Nowak
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic NullabilityReturns the enum constant of this class with the specified name.static Nullability[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NULLABLE
The parameter is explicitly declared as acceptingnull. -
NON_NULL
The parameter is explicitly declared as not acceptingnull. -
UNKNOWN
No nullability could be determined for the parameter.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-