protected < T > WrapperGenericList < T > processWrapper ( TypeReference typeRef , URL url , String errorMessageSuffix ) throws MovieDbException { String webpage = httpTools . getRequest ( url ) ; try { // Due to type erasure, this doesn't work // TypeReference<WrapperGenericList<T>> typeRef = new TypeReference<WrapperGenericList<T>>() {}; return MAPPER . readValue ( webpage , typeRef ) ; } catch ( IOException ex ) { throw new MovieDbException ( ApiExceptionType . MAPPING_FAILED , "Failed to get " + errorMessageSuffix , url , ex ) ; } }
Process the wrapper list and return the whole wrapper