/**
 *
 */
package com.softcorporation.util.net;

/**
 * Client response
 * 
 * @author Vadim Permakoff
 *
 */
public class ClientResponse {

    private ClientRequest clientRequest;
    private String url;
    private int statusCode;
    private String statusText;
    private String content;
    private String chksum;
    private long contentLength;

    /**
     * Constructor
     * @param clientRequest The request
     */
    public ClientResponse(final ClientRequest clientRequest) {
        this.clientRequest = clientRequest;
    }

    /**
     * Get request
     * @return The request
     */
    public ClientRequest getClientRequest() {
        return clientRequest;
    }

    /**
     * Set request
     * @param clientRequest The request
     */
    public void setClientRequest(final ClientRequest clientRequest) {
        this.clientRequest = clientRequest;
    }

    /**
     * Get checksum
     * @return The checksum String
     */
    public String getChksum() {
        return chksum;
    }

    /**
     * Set checksum
     * @param chksum The checksum
     */
    public void setChksum(final String chksum) {
        this.chksum = chksum;
    }

    /**
     * Get content
     * @return The content String
     */
    public String getContent() {
        return content;
    }

    /**
     * Set content
     * @param content The data
     */
    public void setContent(final String content) {
        this.content = content;
    }

    /**
     * Get status code
     * @return The code int
     */
    public int getStatusCode() {
        return statusCode;
    }

    /**
     * Set status code
     * @param statusCode The code
     */
    public void setStatusCode(final int statusCode) {
        this.statusCode = statusCode;
    }

    /**
     * Get length
     * @return The length long
     */
    public long getContentLength() {
        return contentLength;
    }

    /**
     * Set contentLength
     * @param contentLength The length
     */
    public void setContentLength(final long contentLength) {
        this.contentLength = contentLength;
    }

    /**
     * Creates a printable representation of this object.
     * 
     * @return The string representing this object.
     */
    @Override
    public String toString() {
        StringBuilder buf = new StringBuilder(86);
        buf.append("ClientResponse:{url:\"");
        buf.append(url);
        buf.append("\", statusCode:\"");
        buf.append(statusCode);
        buf.append("\", statusText:\"");
        buf.append(statusText);
        buf.append("\", chksum:\"");
        buf.append(chksum);
        buf.append("\", request:\"");
        buf.append(clientRequest);
        buf.append("\"}");
        return buf.toString();
    }

}
