Enum Class Nullness
- All Implemented Interfaces:
- Serializable,- Comparable<Nullness>,- Constable
Constants that indicate nullness, as well as related utility methods.
 
Nullness applies to type usage, a field, a method return type, or a parameter.
 JSpecify annotations are
 fully supported, as well as
 Kotlin null safety,
 @Nullable annotations regardless of their package, and Java primitive
 types.
 
JSR-305 annotations as well as Spring null safety annotations in the
 org.springframework.lang package such as @NonNullApi,
 @NonNullFields, and @NonNull are not supported by this API.
 However, @Nullable is supported via the package-less check. Migrating
 to JSpecify is recommended.
- Since:
- 7.0
- Author:
- Sebastien Deleuze
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionWill not include null (Kotlin default and JSpecify@NullMarkedcode).Can include null (typically specified with a@Nullableannotation).Unspecified nullness (Java default for non-primitive types and JSpecify@NullUnmarkedcode).
- 
Method SummaryModifier and TypeMethodDescriptionstatic NullnessReturn the nullness of the given field.static NullnessforMethodParameter(MethodParameter methodParameter) Return the nullness of the given method parameter.static NullnessforMethodReturnType(Method method) Return the nullness of the return type for the given method.static NullnessforParameter(Parameter parameter) Return the nullness of the given parameter.static NullnessReturns the enum constant of this class with the specified name.static Nullness[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
UNSPECIFIEDUnspecified nullness (Java default for non-primitive types and JSpecify@NullUnmarkedcode).
- 
NULLABLECan include null (typically specified with a@Nullableannotation).
- 
NON_NULLWill not include null (Kotlin default and JSpecify@NullMarkedcode).
 
- 
- 
Method Details- 
valuesReturns 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
 
- 
valueOfReturns 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 name
- NullPointerException- if the argument is null
 
- 
forMethodReturnType
- 
forParameter
- 
forMethodParameterReturn the nullness of the given method parameter.- Parameters:
- methodParameter- the method parameter descriptor
- Returns:
- the corresponding nullness
 
- 
forField
 
-