@ SuppressWarnings ( "unchecked" ) protected < T > Class < T > getClassOrDefault ( final String className , final Class < T > defaultResult ) { try { return className == null ? defaultResult : ( Class < T > ) Class . forName ( className ) ; } catch ( final ClassNotFoundException e ) { LOG . error ( "ClassNotFoundException for {} - defaulting to {}" , className , defaultResult ) ; return defaultResult ; } }
Helper method used to obtain a class from a fully qualified class name . If the value is null or an exception is thrown return the default result instead .