private static Class < ? > type ( Field field ) { if ( Types . isKindOf ( field . getType ( ) , List . class ) ) { // for the purpose of this implementation only first parameterized // type matters, as result from list declaration List<E> return ( Class < ? > ) ( ( ParameterizedType ) field . getGenericType ( ) ) . getActualTypeArguments ( ) [ 0 ] ; } return field . getType ( ) ; }
Return field class or actual type argument if given field is a list .