private static < T > T createInstagramObject ( Verbs verbs , Class < T > clazz , String methodName , Map < String , String > params ) throws InstagramException { Response response ; try { response = getApiResponse ( verbs , methodName , params ) ; } catch ( IOException e ) { throw new InstagramException ( "IOException while retrieving data" , e ) ; } if ( response . getCode ( ) >= 200 && response . getCode ( ) < 300 ) { return createObjectFromResponse ( clazz , response . getBody ( ) ) ; } throw handleInstagramError ( response ) ; }
Create an Instagram object based on class - name and response .