Interface ODataRequestResultDeserializable

All Known Implementing Classes:
ODataRequestResultGeneric

public interface ODataRequestResultDeserializable
Generic type of an OData request result.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    as(Class<T> objectType)
    Converts ODataRequestResult into POJO.
    <T> List<T>
    asList(Class<T> objectType)
    Converts ODataRequestResult into list of POJOs.
    Construct and get a list of key-value maps from the OData response.
    Construct and get a key-value map from the OData response.
    long
    Get the count of elements in the result set.
    void
    Run a consumer for fluent API type ResultElement to iterate over the OData response with a continuous data stream.
  • Method Details

    • as

      @Nonnull <T> T as(@Nonnull Class<T> objectType)
      Converts ODataRequestResult into POJO.
      Type Parameters:
      T - The generic type of POJO
      Parameters:
      objectType - type of POJO
      Returns:
      T - POJO
      Throws:
      ODataResponseException - When the HTTP status indicates an erroneous response.
      ODataDeserializationException - When deserialization process failed for the OData response object.
    • asList

      @Nonnull <T> List<T> asList(@Nonnull Class<T> objectType)
      Converts ODataRequestResult into list of POJOs.
      Type Parameters:
      T - Generic type of the POJO
      Parameters:
      objectType - type of POJO
      Returns:
      List - list of POJOs
      Throws:
      ODataResponseException - When the HTTP status indicates an erroneous response.
      ODataDeserializationException - When deserialization process failed for the OData response objects.
    • streamElements

      void streamElements(@Nonnull Consumer<ResultElement> handler)
      Run a consumer for fluent API type ResultElement to iterate over the OData response with a continuous data stream. The HttpEntity will be consumed.
      Parameters:
      handler - The consumer for generic ResultElement.
      Throws:
      ODataResponseException - When the HTTP status indicates an erroneous response.
      ODataDeserializationException - When deserialization process failed for the OData response objects.
    • getInlineCount

      long getInlineCount()
      Get the count of elements in the result set.
      Returns:
      The number of elements.
      Throws:
      ODataResponseException - When the HTTP status indicates an erroneous response.
    • asMap

      @Nonnull Map<String,Object> asMap()
      Construct and get a key-value map from the OData response. The HttpEntity will be consumed.
      Returns:
      The key-value map.
      Throws:
      ODataResponseException - When the HTTP status indicates an erroneous response.
      ODataDeserializationException - When deserialization process failed for the OData response object.
    • asListOfMaps

      @Nonnull List<Map<String,Object>> asListOfMaps()
      Construct and get a list of key-value maps from the OData response. The HttpEntity will be consumed.
      Returns:
      The list of key-value maps.
      Throws:
      ODataResponseException - When the HTTP status indicates an erroneous response.
      ODataDeserializationException - When deserialization process failed for the OData response objects.