public static < T > T getField ( Object object , String name ) { Check . notNull ( object ) ; Check . notNull ( name ) ; try { final Class < ? > clazz = getClass ( object ) ; final Field field = getDeclaredFieldSuper ( clazz , name ) ; setAccessible ( field , true ) ; @ SuppressWarnings ( "unchecked" ) final T value = ( T ) field . get ( object ) ; return value ; } catch ( final NoSuchFieldException | IllegalAccessException exception ) { throw new LionEngineException ( exception , ERROR_FIELD + name ) ; } }
Get the field by reflection .