Package org.apache.juneau.http.response
Class SwitchingProtocols
java.lang.Object
org.apache.juneau.http.response.BasicHttpResponse<SwitchingProtocols>
org.apache.juneau.http.response.SwitchingProtocols
- All Implemented Interfaces:
HttpResponseMessage
- Direct Known Subclasses:
SwitchingProtocols.Unmodifiable
Represents an HTTP 101 Switching Protocols response.
The requester has asked the server to switch protocols and the server has agreed to do so.
See Also:
- Since:
- 9.2.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUnmodifiable point-in-time snapshot of the enclosingSwitchingProtocolsresponse. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SwitchingProtocolsDefault unmodifiable instancestatic final StringReason phrasestatic final intHTTP status code -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SwitchingProtocols(String body) Constructor with a plain-text string body.SwitchingProtocols(HttpBody body) Constructor with a response body.SwitchingProtocols(SwitchingProtocols copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable snapshot of this bean.Methods inherited from class org.apache.juneau.http.response.BasicHttpResponse
addHeader, addHeader, equals, freeze, getBody, getHeaders, getLocale, getStatusCode, getStatusLine, hashCode, isUnmodifiable, modify, self, setBody, setContent, setContent, setHeader, setHeader, setHeaders, setHeaders, setLocale, setLocation, setLocation, setProtocolVersion, setReasonPhrase, setStatusCode, setStatusLine, toString, withBody, withBody, withHeader, withHeaderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.http.response.HttpResponseMessage
getFirstHeader, getHeaders
-
Field Details
-
STATUS_CODE
HTTP status code- See Also:
-
REASON_PHRASE
Reason phrase- See Also:
-
INSTANCE
Default unmodifiable instance
-
-
Constructor Details
-
SwitchingProtocols
public SwitchingProtocols()Constructor. -
SwitchingProtocols
Constructor with a response body.- Parameters:
body- The response body. May benull .
-
SwitchingProtocols
Constructor with a plain-text string body.- Parameters:
body- The response body as a plain-text string. May benull .
-
SwitchingProtocols
Copy constructor.- Parameters:
copyFrom- The bean to copy from. Must not benull .
-
-
Method Details
-
unmodifiable
Description copied from class:BasicHttpResponseReturns an unmodifiable snapshot of this bean.The returned instance is a point-in-time copy of the leaf's nested
Unmodifiabletype; any attempt to set a property on it throws anUnsupportedOperationException. This method is idempotent: if this bean is already unmodifiable it returns itself rather than taking another snapshot. The receiver is left unchanged (and still modifiable unless it was already unmodifiable).- Specified by:
unmodifiablein classBasicHttpResponse<SwitchingProtocols>- Returns:
- An unmodifiable snapshot of this bean, or this bean if it is already unmodifiable.
-