@Override
    public final void consumeResponse(
            final HttpResponse response,
            final EntityDetails entityDetails,
            final HttpContext context,
            final FutureCallback<T> resultCallback) throws HttpException, IOException {
        this.resultCallback = resultCallback;
        if (entityDetails != null) {
            final ContentType contentType;
            try {
                contentType = ContentType.parse(entityDetails.getContentType());
            } catch (final UnsupportedCharsetException ex) {
                throw new UnsupportedEncodingException(ex.getMessage());
            }
            Charset charset = contentType != null ? contentType.getCharset() : null;
            if (charset == null) {
                charset = defaultCharset;
            }
            setCharset(charset);
            start(response, contentType != null ? contentType : ContentType.DEFAULT_TEXT);
        } else {
            start(response, null);
            completed();
        }
    }
Triggered to generate object that represents a result of response message processing.

@return the result of response processing.
httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractCharResponseConsumer.java