public static Type parameterizedType ( Object object ) { if ( object != null ) { Type type = object . getClass ( ) . getGenericSuperclass ( ) ; if ( type instanceof ParameterizedType ) { return ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) [ 0 ] ; } } return Object . class ; }
Util function that returns the parameterizedType of a given object .