FileDocCategorySizeDatePackage
BasicStatusLine.javaAPI DocAndroid 1.5 API4150Wed May 06 22:41:10 BST 2009org.apache.http.message

BasicStatusLine

public class BasicStatusLine extends Object implements StatusLine, Cloneable
Represents a status line as returned from a HTTP server. See RFC2616 section 6.1. This class is immutable and therefore inherently thread safe.
see
HttpStatus
author
Jeff Dever
author
Mike Bowler
version
$Id: BasicStatusLine.java 604625 2007-12-16 14:11:11Z olegk $
since
4.0

Fields Summary
private final ProtocolVersion
protoVersion
The protocol version.
private final int
statusCode
The status code.
private final String
reasonPhrase
The reason phrase.
Constructors Summary
public BasicStatusLine(ProtocolVersion version, int statusCode, String reasonPhrase)
Creates a new status line with the given version, status, and reason.

param
version the protocol version of the response
param
statusCode the status code of the response
param
reasonPhrase the reason phrase to the status code, or null

        super();
        if (version == null) {
            throw new IllegalArgumentException
                ("Protocol version may not be null.");
        }
        if (statusCode < 0) {
            throw new IllegalArgumentException
                ("Status code may not be negative.");
        }
        this.protoVersion = version;
        this.statusCode   = statusCode;
        this.reasonPhrase = reasonPhrase;
    
Methods Summary
public java.lang.Objectclone()

        return super.clone();
    
public org.apache.http.ProtocolVersiongetProtocolVersion()

return
the HTTP-Version

        return this.protoVersion;
    
public java.lang.StringgetReasonPhrase()

return
the Reason-Phrase

        return this.reasonPhrase;
    
public intgetStatusCode()

return
the Status-Code

        return this.statusCode;
    
public java.lang.StringtoString()

        // no need for non-default formatting in toString()
        return BasicLineFormatter.DEFAULT
            .formatStatusLine(null, this).toString();