Package org.apache.http.message
Class BasicStatusLine
java.lang.Object
org.apache.http.message.BasicStatusLine
- All Implemented Interfaces:
Cloneable,StatusLine
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.
- Since:
- 4.0
- Version:
- $Id: BasicStatusLine.java 604625 2007-12-16 14:11:11Z olegk $
- Author:
- Jeff Dever, Mike Bowler
- See Also:
HttpStatus
-
Constructor Summary
Constructors Constructor Description BasicStatusLine(ProtocolVersion version, int statusCode, String reasonPhrase)Creates a new status line with the given version, status, and reason. -
Method Summary
Modifier and Type Method Description Objectclone()Creates and returns a copy of thisObject.ProtocolVersiongetProtocolVersion()StringgetReasonPhrase()intgetStatusCode()StringtoString()Returns a string containing a concise, human-readable description of this object.
-
Constructor Details
-
BasicStatusLine
Creates a new status line with the given version, status, and reason.- Parameters:
version- the protocol version of the responsestatusCode- the status code of the responsereasonPhrase- the reason phrase to the status code, ornull
-
-
Method Details
-
getStatusCode
public int getStatusCode()- Specified by:
getStatusCodein interfaceStatusLine- Returns:
- the Status-Code
-
getProtocolVersion
- Specified by:
getProtocolVersionin interfaceStatusLine- Returns:
- the HTTP-Version
-
getReasonPhrase
- Specified by:
getReasonPhrasein interfaceStatusLine- Returns:
- the Reason-Phrase
-
toString
Description copied from class:ObjectReturns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod. -
clone
Description copied from class:ObjectCreates and returns a copy of thisObject. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should callsuper.clone()to create the new instance and then create deep copies of the nested, mutable objects.- Overrides:
clonein classObject- Returns:
- a copy of this object.
- Throws:
CloneNotSupportedException- if this object's class does not implement theCloneableinterface.
-