Class CountReader

  • All Implemented Interfaces:
    EntityReader

    public class CountReader
    extends AbstractEntityReader
    The CountReader reads number of items in the platform matching the request conditions.
    • Constructor Detail

      • CountReader

        public CountReader()
    • Method Detail

      • isApplicable

        public boolean isApplicable​(org.apache.olingo.odata2.api.uri.UriInfo uriInfo)
        Description copied from interface: EntityReader
        Indicates whether this EntityReader can read the requested information
        Parameters:
        uriInfo - Used to determine whether this EntityReader is applicable
        Returns:
        true if this EntityReader can do the read, otherwise false
      • read

        public org.apache.olingo.odata2.api.processor.ODataResponse read​(ItemLookupRequest request)
                                                                  throws org.apache.olingo.odata2.api.exception.ODataException
        Reads from the commerce suite the requested information

        This method reads only number of items matching the conditions specified in the request.

        Parameters:
        request - parameter object that contains the request with the conditions for the items to be counted.
        Returns:
        a response containing a number of matching items in its body. The response content type is plain/text for that reason
        Throws:
        org.apache.olingo.odata2.api.exception.ODataException - when the request violates the OData protocol