@ SuppressWarnings ( "unchecked" ) private < T extends WorkContext > Class < T > getSupportedWorkContextClass ( Class < T > adaptorWorkContext ) { for ( Class < ? extends WorkContext > supportedWorkContext : SUPPORTED_WORK_CONTEXT_CLASSES ) { // Assignable or not if ( supportedWorkContext . isAssignableFrom ( adaptorWorkContext ) ) { Class clz = adaptorWorkContext ; while ( clz != null ) { // Supported by the server if ( clz . equals ( supportedWorkContext ) ) { return clz ; } clz = clz . getSuperclass ( ) ; } } } return null ; }
Returns work context class if given work context is supported by server returns null instance otherwise .