Class ModificationResponse<EntityT extends VdmEntity<?>>

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.ModificationResponse<EntityT>
Type Parameters:
EntityT - The generic entity type.

public final class ModificationResponse<EntityT extends VdmEntity<?>> extends Object
Generic OData service response wrapper for data modification requests.
  • Method Details

    • getModifiedEntity

      @Nonnull public EntityT getModifiedEntity()
      Get an updated version of the entity. If the service responded with an entity it is returned here. If the service didn't respond with an entity but send an @{code ETag} header, the entity is updated and returned. Otherwise a copy of the original, unmodified entity is returned.
      Returns:
      The modified entity.
    • getResponseEntity

      @Nonnull public io.vavr.control.Option<EntityT> getResponseEntity()
      Get the optional response entity parsed from the HTTP content.
      Returns:
      The parsed entity or none.
    • getRequestEntity

      @Nonnull public EntityT getRequestEntity()
      Access the original entity used to make the request.
      Returns:
      The original entity object used to perform an OData request.
    • getResponseStatusCode

      public int getResponseStatusCode()
      Get the response status code.
      Returns:
      The integer representation of the HTTP status code.
    • getResponseHeaders

      @Nonnull public Map<String,Iterable<String>> getResponseHeaders()
      Get the response headers.
      Returns:
      The headers of the HTTP status code.
    • getUpdatedVersionIdentifier

      @Nonnull public io.vavr.control.Option<String> getUpdatedVersionIdentifier()
      Get the version identifier present in the response headers, the identifier of the original entity or none, if neither exist.
      Returns:
      An up to date version identifier or none.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • of

      @Nonnull public static <EntityT extends VdmEntity<?>> ModificationResponse<EntityT> of(@Nonnull ODataRequestResultGeneric result, @Nonnull EntityT originalRequestEntity, @Nonnull Destination destination)