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 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:
  • Constructor Details

    • AbstractHttpResponseCodec

      public AbstractHttpResponseCodec()
  • Method Details

    • encode

      public org.openqa.selenium.remote.http.HttpResponse encode(Supplier<org.openqa.selenium.remote.http.HttpResponse> factory, Response response)
      Encodes the given response as an HTTP response message. This method is guaranteed not to throw.
      Specified by:
      encode in interface ResponseCodec<org.openqa.selenium.remote.http.HttpResponse>
      Parameters:
      response - The response to encode.
      factory - creates a new instance of T.
      Returns:
      The encoded response.
    • getValueToEncode

      protected abstract 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 interface ResponseCodec<org.openqa.selenium.remote.http.HttpResponse>
      Parameters:
      encodedResponse - the response to decode.
      Returns:
      the decoded response.
    • reconstructValue

      protected abstract Response reconstructValue(Response response)