public Class < E > getEventClass ( ) { if ( cachedClazz != null ) { return cachedClazz ; } Class < ? > clazz = this . getClass ( ) ; while ( clazz != Object . class ) { try { Type mySuperclass = clazz . getGenericSuperclass ( ) ; Type tType = ( ( ParameterizedType ) mySuperclass ) . getActualTypeArguments ( ) [ 0 ] ; cachedClazz = ( Class < E > ) Class . forName ( tType . getTypeName ( ) ) ; return cachedClazz ; } catch ( Exception e ) { } clazz = clazz . getSuperclass ( ) ; } throw new IllegalStateException ( "Failed to load event class - " + this . getClass ( ) . getCanonicalName ( ) ) ; }
Returns the Class object of the Event implementation .