Package com.neovisionaries.ws.client
Class StatusLine
- java.lang.Object
-
- com.neovisionaries.ws.client.StatusLine
-
public class StatusLine extends java.lang.ObjectHTTP status line returned from an HTTP server.- Since:
- 1.19
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmHttpVersionHTTP version.private java.lang.StringmReasonPhraseReason phrase.private intmStatusCodeStatus code.private java.lang.StringmStringString representation of this instance (= the raw status line).
-
Constructor Summary
Constructors Constructor Description StatusLine(java.lang.String line)Constructor with a raw status line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHttpVersion()Get the HTTP version.java.lang.StringgetReasonPhrase()Get the reason phrase.intgetStatusCode()Get the status code.java.lang.StringtoString()Get the string representation of this instance, which is equal to the raw status line.
-
-
-
Field Detail
-
mHttpVersion
private final java.lang.String mHttpVersion
HTTP version.
-
mStatusCode
private final int mStatusCode
Status code.
-
mReasonPhrase
private final java.lang.String mReasonPhrase
Reason phrase.
-
mString
private final java.lang.String mString
String representation of this instance (= the raw status line).
-
-
Constructor Detail
-
StatusLine
StatusLine(java.lang.String line)
Constructor with a raw status line.- Parameters:
line- A status line.- Throws:
java.lang.NullPointerException-lineisnulljava.lang.IllegalArgumentException- The number of elements inlineis less than 2.java.lang.NumberFormatException- Failed to parse the second element inlineas an integer.
-
-
Method Detail
-
getHttpVersion
public java.lang.String getHttpVersion()
Get the HTTP version.- Returns:
- The HTTP version. For example,
"HTTP/1.1".
-
getStatusCode
public int getStatusCode()
Get the status code.- Returns:
- The status code. For example,
404.
-
getReasonPhrase
public java.lang.String getReasonPhrase()
Get the reason phrase.- Returns:
- The reason phrase. For example,
"Not Found".
-
toString
public java.lang.String toString()
Get the string representation of this instance, which is equal to the raw status line.- Overrides:
toStringin classjava.lang.Object- Returns:
- The raw status line. For example,
"HTTP/1.1 404 Not Found".
-
-