Class TypeUtil

    • Method Detail

      • getAllDeclaredFields

        public static List<Field> getAllDeclaredFields​(Class<?> cls)
        Gets all declared fields for the given class (including superclasses).
        Parameters:
        cls - the class to examine
        Returns:
        all declared fields for the given class (including superclasses).
        See Also:
        Class.getDeclaredFields()
      • isAssignable

        public static boolean isAssignable​(Type lhs,
                                           Type rhs)
        Indicates if two Types are assignment compatible.
        Parameters:
        lhs - the left hand side to check assignability to
        rhs - the right hand side to check assignability from
        Returns:
        true if it is legal to assign a variable of type rhs to a variable of type lhs
        See Also:
        Class.isAssignableFrom(Class)