Class ODataResponseDeserializer

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.ODataResponseDeserializer

public class ODataResponseDeserializer extends Object
Implementation to deserialize OData responses based on a given ODataProtocol.
  • Constructor Details

    • ODataResponseDeserializer

      public ODataResponseDeserializer(@Nonnull ODataProtocol protocol)
  • Method Details

    • positionReaderToResultSet

      public void positionReaderToResultSet(@Nonnull com.google.gson.stream.JsonReader reader) throws IOException
      Position the to the response result set.
      Parameters:
      reader - The internal JsonReader instance.
      Throws:
      IOException - If response cannot be read.
    • getElementToResultSet

      @Nonnull public io.vavr.control.Option<com.google.gson.JsonArray> getElementToResultSet(@Nonnull com.google.gson.JsonElement element)
      Get the element to the response result set.
      Parameters:
      element - The root element.
      Returns:
      The optional result as JsonArray.
    • getElementToResultSingle

      @Nonnull public io.vavr.control.Option<com.google.gson.JsonObject> getElementToResultSingle(@Nonnull com.google.gson.JsonElement element)
      Get the element to the single response result item.
      Parameters:
      element - The root element.
      Returns:
      The optional result as JsonObject.
    • getElementToResultPrimitiveSet

      @Nonnull public io.vavr.control.Option<com.google.gson.JsonArray> getElementToResultPrimitiveSet(@Nonnull com.google.gson.JsonElement element)
      Get the element to the response result set.
      Parameters:
      element - The root element.
      Returns:
      The optional result as JsonArray.
    • getElementToResultPrimitiveSingle

      @Nonnull public io.vavr.control.Option<com.google.gson.JsonPrimitive> getElementToResultPrimitiveSingle(@Nonnull com.google.gson.JsonElement element)
      Get the element to the single response result item.
      Parameters:
      element - The root element.
      Returns:
      The optional result as JsonPrimitive.