Package org.openrewrite.internal.lang
Class NullUtils
java.lang.Object
org.openrewrite.internal.lang.NullUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindNonNullFields(@NonNull Class<?> _class) The method uses reflection to find all declared fields of a class that have been marked (via commonly used annotations) as being Non-Null.
-
Constructor Details
-
NullUtils
public NullUtils()
-
-
Method Details
-
findNonNullFields
The method uses reflection to find all declared fields of a class that have been marked (via commonly used annotations) as being Non-Null. This method will also look at the class's package level to see if the API for that package is defaulted as Non-Null. ANY annotation that has runtime retention and matches on of the simple annotation names (minus any package) will be considered a match.- Parameters:
_class- The class to reflect over- Returns:
- A list of fields marked as non-null, sorted by their name in alphabetical order.
-