src/main/java/com/sgoertzen/sonarbreak/QueryExecutor.java
protected static Result parseResponse(String response) throws SonarBreakException {
        ObjectMapper mapper = new ObjectMapper();
        final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        mapper.setDateFormat(df);
        List<Result> results;
        try {
            results = mapper.readValue(response, new TypeReference<List<Result>>() {
            });
        } catch (IOException e) {
            throw new SonarBreakException("Unable to parse the json into a List of QualityGateResults.  Json is: " + response, e);
        }
        if (results == null || results.size() != 1) {
            throw new SonarBreakException("Unable to deserialize JSON response: " + response);
        }
        return results.get(0);
    }
protected static Result parseResponse(String response) throws SonarBreakException {
        ObjectMapper mapper = new ObjectMapper();
        final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        mapper.setDateFormat(df);
        List<Result> results;
        try {
            results = mapper.readValue(response, new TypeReference<List<Result>>() {
            });
        } catch (IOException e) {
            throw new SonarBreakException("Unable to parse the json into a List of QualityGateResults.  Json is: " + response, e);
        }
        if (results == null || results.size() != 1) {
            throw new SonarBreakException("Unable to deserialize JSON response: " + response);
        }
        return results.get(0);
    }
protected static Result parseResponse ( String response ) throws SonarBreakException { ObjectMapper mapper = new ObjectMapper ( ) ; final DateFormat df = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss" ) ; mapper . setDateFormat ( df ) ; List < Result > results ; try { results = mapper . readValue ( response , new TypeReference < List < Result > > ( ) { } ) ; } catch ( IOException e ) { throw new SonarBreakException ( "Unable to parse the json into a List of QualityGateResults.  Json is: " + response , e ) ; } if ( results == null || results . size ( ) != 1 ) { throw new SonarBreakException ( "Unable to deserialize JSON response: " + response ) ; } return results . get ( 0 ) ; }
Parses the string response from sonar into POJOs.

@param response The json response from the sonar server.
@return Object representing the Sonar response
@throws SonarBreakException Thrown if the response is not JSON or it does not contain quality gate data.
Parses the string response from sonar into POJOs .