BasicStatusLinepublic class BasicStatusLine extends Object implements StatusLine, CloneableRepresents a status line as returned from a HTTP server.
See RFC2616 section 6.1.
This class is immutable and therefore inherently thread safe. |
Fields Summary |
---|
private final ProtocolVersion | protoVersionThe protocol version. | private final int | statusCodeThe status code. | private final String | reasonPhraseThe reason phrase. |
Constructors Summary |
---|
public BasicStatusLine(ProtocolVersion version, int statusCode, String reasonPhrase)Creates a new status line with the given version, status, and reason.
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.Object | clone()
return super.clone();
| public org.apache.http.ProtocolVersion | getProtocolVersion()
return this.protoVersion;
| public java.lang.String | getReasonPhrase()
return this.reasonPhrase;
| public int | getStatusCode()
return this.statusCode;
| public java.lang.String | toString()
// no need for non-default formatting in toString()
return BasicLineFormatter.DEFAULT
.formatStatusLine(null, this).toString();
|
|