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