Package org.openqa.selenium.remote.codec
Class AbstractHttpResponseCodec
java.lang.Object
org.openqa.selenium.remote.codec.AbstractHttpResponseCodec
- All Implemented Interfaces:
ResponseCodec<HttpResponse>
- Direct Known Subclasses:
W3CHttpResponseCodec
public abstract class AbstractHttpResponseCodec
extends Object
implements ResponseCodec<HttpResponse>
A response codec usable as a base for both the JSON and W3C wire protocols.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(HttpResponse encodedResponse) Decodes a response.encode
(Supplier<HttpResponse> factory, Response response) Encodes the given response as an HTTP response message.protected abstract Object
getValueToEncode
(Response response) protected abstract Response
reconstructValue
(Response response)
-
Constructor Details
-
AbstractHttpResponseCodec
public AbstractHttpResponseCodec()
-
-
Method Details
-
encode
Encodes the given response as an HTTP response message. This method is guaranteed not to throw.- Specified by:
encode
in interfaceResponseCodec<HttpResponse>
- Parameters:
response
- The response to encode.factory
- creates a new instance ofT
.- Returns:
- The encoded response.
-
getValueToEncode
-
decode
Description copied from interface:ResponseCodec
Decodes a response.- Specified by:
decode
in interfaceResponseCodec<HttpResponse>
- Parameters:
encodedResponse
- the response to decode.- Returns:
- the decoded response.
-
reconstructValue
-