Class GenericsUtils


  • public class GenericsUtils
    extends Object
    Get a variable's java type, or a collection's generic type
    For Example,
    "String a" => String.class, and "List<Integer> b" => Integer.class
    • Constructor Detail

      • GenericsUtils

        public GenericsUtils()
    • Method Detail

      • getFieldGenericType

        public static Class<?> getFieldGenericType​(Field field)
      • getMethodGenericReturnType

        public static Class<?> getMethodGenericReturnType​(Method method)
      • getMethodGenericParameterTypes

        public static Class<?> getMethodGenericParameterTypes​(Method method,
                                                              int paramIndex)
      • getMethodGenericParameterName

        public static String getMethodGenericParameterName​(Method method,
                                                           int paramIndex)