// Path: client/src/main/java/com/nesscomputing/httpclient/HttpClientResponse.java
// public interface HttpClientResponse {
// 	/**
// 	 * Returns the status code for the request.
// 	 *
// 	 * @return the status code, use the related {@link HttpServletRequest} constants
// 	 */
// 	int getStatusCode();
// 
// 	/**
// 	 * Returns the status text for the request.
// 	 *
// 	 * @return the status text
// 	 */
// 	String getStatusText();
// 
// 	/**
// 	 * Returns an input stream for the response body.
// 	 *
// 	 * @return the input stream
// 	 * @throws IOException on error
// 	 */
// 	InputStream getResponseBodyAsStream() throws IOException;
// 
// 	/** @return the URI of the request. */
// 	URI getUri();
// 
// 	/** @return Content type of the response. */
// 	String getContentType();
// 
// 	/**
// 	 * @return Length of the content, if present. Can be null (not present), -1 (chunked) or 0 (no
// 	 *         content).
// 	 */
// 	@CheckForNull
// 	Long getContentLength();
// 
// 	/** @return Content charset if present in the header. Can be null. */
// 	@CheckForNull
// 	String getCharset();
// 
// 	/**
// 	 * @param name the header name
// 	 * @return The named header from the response. Response can be null.
// 	 */
// 	@CheckForNull
// 	String getHeader(String name);
// 
// 	/**
// 	 * @param name the header name
// 	 * @return all values for the given header. Response can be null.
// 	 */
// 	@CheckForNull
// 	List<String> getHeaders(String name);
// 
// 	/** @return Map of header name -> list of values for each header name */
//     @Nonnull
// 	public Map<String, List<String>> getAllHeaders();
// 
// 	/** @return true if the response redirects to another object. */
// 	boolean isRedirected();
// }


import java.io.IOException;
import java.io.InputStream;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.nesscomputing.httpclient.HttpClientResponse;
import com.nesscomputing.logging.Log;
    {
        return new JsonContentConverter<Type>(typeReference, objectMapper);
    }

    public static <CC> ContentResponseHandler<CC> getResponseHandler(final TypeReference<CC> typeReference, final ObjectMapper objectMapper, final boolean ignore404)
    {
        return ContentResponseHandler.forConverter(getConverter(typeReference, objectMapper, ignore404));
    }

    public static <Type> ContentConverter<Type> getConverter(final TypeReference<Type> typeReference, final ObjectMapper objectMapper, final boolean ignore404)
    {
        return new JsonContentConverter<Type>(typeReference, objectMapper, ignore404);
    }

    public JsonContentConverter(final TypeReference<T> typeReference,
                                final ObjectMapper objectMapper)
    {
        this(typeReference, objectMapper, false);
    }

    public JsonContentConverter(final TypeReference<T> typeReference,
                                final ObjectMapper objectMapper,
                                final boolean ignore404)
    {
        this.typeReference = typeReference;
        this.objectMapper = objectMapper;
        this.ignore404 = ignore404;
    }

    @Override
// Path: client/src/main/java/com/nesscomputing/httpclient/HttpClientResponse.java
// public interface HttpClientResponse {
// 	/**
// 	 * Returns the status code for the request.
// 	 *
// 	 * @return the status code, use the related {@link HttpServletRequest} constants
// 	 */
// 	int getStatusCode();
// 
// 	/**
// 	 * Returns the status text for the request.
// 	 *
// 	 * @return the status text
// 	 */
// 	String getStatusText();
// 
// 	/**
// 	 * Returns an input stream for the response body.
// 	 *
// 	 * @return the input stream
// 	 * @throws IOException on error
// 	 */
// 	InputStream getResponseBodyAsStream() throws IOException;
// 
// 	/** @return the URI of the request. */
// 	URI getUri();
// 
// 	/** @return Content type of the response. */
// 	String getContentType();
// 
// 	/**
// 	 * @return Length of the content, if present. Can be null (not present), -1 (chunked) or 0 (no
// 	 *         content).
// 	 */
// 	@CheckForNull
// 	Long getContentLength();
// 
// 	/** @return Content charset if present in the header. Can be null. */
// 	@CheckForNull
// 	String getCharset();
// 
// 	/**
// 	 * @param name the header name
// 	 * @return The named header from the response. Response can be null.
// 	 */
// 	@CheckForNull
// 	String getHeader(String name);
// 
// 	/**
// 	 * @param name the header name
// 	 * @return all values for the given header. Response can be null.
// 	 */
// 	@CheckForNull
// 	List<String> getHeaders(String name);
// 
// 	/** @return Map of header name -> list of values for each header name */
//     @Nonnull
// 	public Map<String, List<String>> getAllHeaders();
// 
// 	/** @return true if the response redirects to another object. */
// 	boolean isRedirected();
// }


// Path: client/src/main/java/com/nesscomputing/httpclient/response/JsonContentConverter.java
import java.io.IOException;
import java.io.InputStream;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.nesscomputing.httpclient.HttpClientResponse;
import com.nesscomputing.logging.Log;

    {
        return new JsonContentConverter<Type>(typeReference, objectMapper);
    }

    public static <CC> ContentResponseHandler<CC> getResponseHandler(final TypeReference<CC> typeReference, final ObjectMapper objectMapper, final boolean ignore404)
    {
        return ContentResponseHandler.forConverter(getConverter(typeReference, objectMapper, ignore404));
    }

    public static <Type> ContentConverter<Type> getConverter(final TypeReference<Type> typeReference, final ObjectMapper objectMapper, final boolean ignore404)
    {
        return new JsonContentConverter<Type>(typeReference, objectMapper, ignore404);
    }

    public JsonContentConverter(final TypeReference<T> typeReference,
                                final ObjectMapper objectMapper)
    {
        this(typeReference, objectMapper, false);
    }

    public JsonContentConverter(final TypeReference<T> typeReference,
                                final ObjectMapper objectMapper,
                                final boolean ignore404)
    {
        this.typeReference = typeReference;
        this.objectMapper = objectMapper;
        this.ignore404 = ignore404;
    }

    @Override
    public T convert(final HttpClientResponse httpClientResponse,