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
Constructors -
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 ObjectgetValueToEncode(Response response) protected abstract ResponsereconstructValue(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:
encodein interfaceResponseCodec<HttpResponse>- Parameters:
response- The response to encode.factory- creates a new instance ofT.- Returns:
- The encoded response.
-
getValueToEncode
-
decode
Description copied from interface:ResponseCodecDecodes a response.- Specified by:
decodein interfaceResponseCodec<HttpResponse>- Parameters:
encodedResponse- the response to decode.- Returns:
- the decoded response.
-
reconstructValue
-