Package org.openrewrite.internal.lang
Class NullUtils
java.lang.Object
org.openrewrite.internal.lang.NullUtils
-
Constructor Summary
Constructors -
Method Summary
-
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, or a requiredOption. This method will also look at the class's package level to see if the API for that package is defaulted as Non-Null. Fields with explicit Nullable annotations will be excluded. Any other annotation that has runtime retention and matches one 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.
-