Class NullUtils


  • public class NullUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      NullUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.reflect.Field> findNonNullFields​(@NonNull java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NullUtils

        public NullUtils()
    • Method Detail

      • findNonNullFields

        public static java.util.List<java.lang.reflect.Field> findNonNullFields​(@NonNull
                                                                                @NonNull java.lang.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. 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.