Class SerializationHelper

java.lang.Object
com.eqixiac.equinix.core.http.SerializationHelper

public final class SerializationHelper extends Object
Attaches JSON request bodies: the payload is carried on the request as a RequestBody and serialized to the wire by RequestFactory at dispatch time (once per attempt), honoring the request's content type and any Jackson FilterProvider. Because serialization is deferred, a payload mutated after attachment (e.g. a POST-search body whose pagination offset the paging pipeline advances) is re-serialized automatically on the next dispatch.

Split out of the former monolithic Utils class; see RequestAssembler, ResponseHandler and ParameterMapper for the other request/response helpers.

Author:
ianjones
  • Constructor Details

    • SerializationHelper

      public SerializationHelper()
  • Method Details

    • serializeJson

      public static <T> void serializeJson(EquinixRequest<T> equinixRequest, Object objectToSerialize)
      Attaches objectToSerialize as the request's JSON body.
      Parameters:
      equinixRequest - the request to carry the body
      objectToSerialize - the payload to serialize at dispatch time (never null)