Class RequestCategory


  • public class RequestCategory
    extends RequestBase<Category>
    The Request Catagory class returns all categories, such as movies, tv episodes and music, with the title and children category IDs, for the specific content type.

    In addition, you can specifies one or multiple requested_fields, such as parent category and attributes, and language to return.
    This class is returned by ContentDiscovery.getCategoriesRequest(String).
    It has a method to execute request synchronously and asynchronously and also provides a set of Set methods for the parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void executeAsync​(ContentDiscovery.Listener<Category> listener)
      Gets a list of categories for the specified content name.
      java.util.List<Category> executeSync()
      Gets a list of categories for the specified content name.
      JSONObject getSocketPayload()  
      void setCategoryRoot​(java.lang.String categoryRoot)
      Sets the category root, such as movies, music or tv.
      void setImageResolutions​(java.util.Set<java.lang.String> imageResolutions)
      Returns images, such as posters or synopses, in the specified resolution.
      void setImageSizeSelectors​(java.util.Set<java.lang.Integer> imageSizeSelectors)
      Returns images, such as posters or synopses, in the specified size as defined by the airlines.
      void setRequestedFields​(java.util.Set<java.lang.String> requestedFields)
      Specifies the fields to be returned.If this is not set, all fields will be returned.
      void setSeatClass​(java.lang.String seatClass)
      Sets the seat class, such as first or business.
      void setTreeDepth​(int depth)
      Used to fetch category tree up to specified depth.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setSeatClass

        public void setSeatClass​(java.lang.String seatClass)
        Sets the seat class, such as first or business.

        If not specified, SeatClass.All will be used.
        Parameters:
        seatClass - Only accepts strings provided by SeatClass.
      • setRequestedFields

        public void setRequestedFields​(java.util.Set<java.lang.String> requestedFields)
        Specifies the fields to be returned.If this is not set, all fields will be returned.
        Parameters:
        requestedFields - Specifies the fields to be returned.
      • setImageSizeSelectors

        public void setImageSizeSelectors​(java.util.Set<java.lang.Integer> imageSizeSelectors)
        Returns images, such as posters or synopses, in the specified size as defined by the airlines.

        Sample format is 1,2 and defined by the airline.
        When both image_size_selector and image_resolution are present, image_size_selector takes priority.
        If neither are present, all images will be returned.
        Parameters:
        imageSizeSelectors - Specifies the image size.
      • setImageResolutions

        public void setImageResolutions​(java.util.Set<java.lang.String> imageResolutions)
        Returns images, such as posters or synopses, in the specified resolution.

        Format is widthxheight, such as "800x600".

        When both image_size_selector and image_resolution are present, image_size_selector takes priority. If neither are present, all images will be returned.
        Parameters:
        imageResolutions - Specifies the image resolution.
      • setTreeDepth

        public void setTreeDepth​(int depth)
        Used to fetch category tree up to specified depth.

        Parameters:
        depth - Specifies the depth.
      • executeSync

        public java.util.List<Category> executeSync()
                                             throws ContentDiscovery.Exception
        Gets a list of categories for the specified content name. For example, the content name 'media' could contain a 'Kids' Movies', 'TV Shows' or 'Featured' category. This call is synchronous.

        The list is tree structure.
        Returns:
        a list of Category.
        Throws:
        ContentDiscovery.Exception - if error occurs.
      • setCategoryRoot

        public void setCategoryRoot​(java.lang.String categoryRoot)
        Sets the category root, such as movies, music or tv. The values are defined by the airline.
        Parameters:
        categoryRoot - Category root, such as movies, music or tv, to filter the results.