Class ReflectionUtils


  • public class ReflectionUtils
    extends Object
    Just slightly adapted from http://www.artima.com/weblogs/viewpost.jsp?thread=208860
    Version:
    $Id$
    Author:
    Ian Robertson, Fabrizio Giudici
    • Constructor Detail

      • ReflectionUtils

        public ReflectionUtils()
    • Method Detail

      • getTypeArguments

        public static <T> List<Class<?>> getTypeArguments​(@Nonnull
                                                          Class<T> baseClass,
                                                          @Nonnull
                                                          Class<? extends T> childClass)
        Get the actual type arguments a child class has used to extend a generic base class.
        Parameters:
        baseClass - the base class
        childClass - the child class
        Returns:
        a list of the raw classes for the actual type arguments.