Package org.apache.juneau.http.response
Class HttpStatusLineBean
java.lang.Object
org.apache.juneau.http.response.HttpStatusLineBean
- All Implemented Interfaces:
HttpStatusLine
Default immutable implementation of
HttpStatusLine.
Create instances via the static factory methods:
See Also:
- Since:
- 9.2.1
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the HTTP protocol version (e.g.Returns the human-readable reason phrase (e.g.intReturns the HTTP status code (e.g.inthashCode()static HttpStatusLineBeanCreates anHTTP/1.1status line with the given status code and reason phrase.static HttpStatusLineBeanCreates a status line with a parsed protocol version, status code, and reason phrase.static HttpStatusLineBeanof(HttpProtocolVersion protocolVersion, int statusCode, String reasonPhrase) Creates a status line with the given typed protocol version, status code, and reason phrase.toString()
-
Method Details
-
of
Creates anHTTP/1.1status line with the given status code and reason phrase.- Parameters:
statusCode- The HTTP status code (e.g.200).reasonPhrase- The reason phrase (e.g."OK"). May benull .- Returns:
- A new instance. Never
null .
-
of
Creates a status line with a parsed protocol version, status code, and reason phrase.- Parameters:
protocolVersion- The protocol version string (e.g."HTTP/2"). Must not benull .statusCode- The HTTP status code.reasonPhrase- The reason phrase. May benull .- Returns:
- A new instance. Never
null .
-
of
public static HttpStatusLineBean of(HttpProtocolVersion protocolVersion, int statusCode, String reasonPhrase) Creates a status line with the given typed protocol version, status code, and reason phrase.- Parameters:
protocolVersion- The protocol version. Must not benull .statusCode- The HTTP status code.reasonPhrase- The reason phrase. May benull .- Returns:
- A new instance. Never
null .
-
getStatusCode
Description copied from interface:HttpStatusLineReturns the HTTP status code (e.g.200,404).- Specified by:
getStatusCodein interfaceHttpStatusLine- Returns:
- The status code.
-
getReasonPhrase
Description copied from interface:HttpStatusLineReturns the human-readable reason phrase (e.g."OK","Not Found"), ornull if absent.- Specified by:
getReasonPhrasein interfaceHttpStatusLine- Returns:
- The reason phrase, possibly
null .
-
getProtocolVersion
Description copied from interface:HttpStatusLineReturns the HTTP protocol version (e.g.HttpProtocolVersion.HTTP_1_1).- Specified by:
getProtocolVersionin interfaceHttpStatusLine- Returns:
- The protocol version. Never
null .
-
toString
-
equals
-
hashCode
-