Class RequestCategory
- java.lang.Object
-
- aero.panasonic.inflight.services.contentdiscovery.v1.RequestBase<Category>
-
- aero.panasonic.inflight.services.contentdiscovery.v1.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 byContentDiscovery.getCategoriesRequest(String).
It has a method to execute request synchronously and asynchronously and also provides a set of Set methods for the parameters.
-
-
Field Summary
-
Fields inherited from class aero.panasonic.inflight.services.contentdiscovery.v1.RequestBase
mLangCode, mSeatClass
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteAsync(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.JSONObjectgetSocketPayload()voidsetCategoryRoot(java.lang.String categoryRoot)Sets the category root, such as movies, music or tv.voidsetImageResolutions(java.util.Set<java.lang.String> imageResolutions)Returns images, such as posters or synopses, in the specified resolution.voidsetImageSizeSelectors(java.util.Set<java.lang.Integer> imageSizeSelectors)Returns images, such as posters or synopses, in the specified size as defined by the airlines.voidsetRequestedFields(java.util.Set<java.lang.String> requestedFields)Specifies the fields to be returned.If this is not set, all fields will be returned.voidsetSeatClass(java.lang.String seatClass)Sets the seat class, such as first or business.voidsetTreeDepth(int depth)Used to fetch category tree up to specified depth.-
Methods inherited from class aero.panasonic.inflight.services.contentdiscovery.v1.RequestBase
cancel, getRequestId, setRequestCancelling
-
-
-
-
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 bySeatClass.
-
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.
-
executeAsync
public void executeAsync(ContentDiscovery.Listener<Category> listener)
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 asynchronous.
The list is tree structure.- Parameters:
listener- Data is passed back in the form of a listener. If data is retrieved successfully,ContentDiscovery.Listener.onDataReceived(List, RequestBase)is called. If an error occurs,ContentDiscovery.Listener.onError(ContentDiscovery.Error, RequestBase)is called.
-
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.
-
getSocketPayload
public JSONObject getSocketPayload()
- Specified by:
getSocketPayloadin classRequestBase<Category>
-
-