@ SuppressWarnings ( "unchecked" ) public static final < E extends Object > E getStaticField ( String fieldName , Class < ? > clazz ) throws Exception { try { Field field = clazz . getField ( fieldName ) ; if ( field != null ) { return ( E ) field . get ( null ) ; } } catch ( Exception e ) { throw e ; } return null ; }
Gets the value of the given static field from the given class .