Class RequestSearchByText
- java.lang.Object
-
- aero.panasonic.inflight.services.contentdiscovery.v1.RequestBase<Item>
-
- aero.panasonic.inflight.services.contentdiscovery.v1.RequestSearchByText
-
public class RequestSearchByText extends RequestBase<Item>
The RequestSearchByText class returns items filtered by text.
Request Search By Text is similar toRequestSearchByField. However, in this class, the text will be searched in any of the following fields: title, genre, year, artist, actor and director.
All fields are equally searched.
This is the class returned byContentDiscovery.searchByTextRequest(String)()} (String)}.
It has method to execute request synchronously and asynchronously and provides a set of Set methods for 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<Item> listener)Gets a list of items asynchronously.java.util.List<Item>executeSync()Gets a list of items synchronously.JSONObjectgetSocketPayload()voidsetContentType(java.lang.String contentType)Specifies the content type to filter the results.voidsetFilterFields(java.util.Map<SearchFilter,java.lang.String> filterFields)Specifies the fields to be filtered.
Example: duration, subtitle, soundtrack, rating and category.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 airline.voidsetMatchType(MatchType matchType)Specifies the match type to filter results.voidsetPagination(PagingOption paging)Identifies the pagination parameter for the page offset and page size.voidsetRequestedFields(java.util.Set<java.lang.String> requestedFields)Specifies the fields to be returned.
Example: Title, genre, year, artist, actor and director.voidsetSeatClass(java.lang.String seatClass)Specifies the seat class, such as first or business.
If not specified, SeatClass.All will be used.-
Methods inherited from class aero.panasonic.inflight.services.contentdiscovery.v1.RequestBase
cancel, getRequestId, setRequestCancelling
-
-
-
-
Method Detail
-
setContentType
public void setContentType(java.lang.String contentType)
Specifies the content type to filter the results.
Example: movie, audio and tv series.- Parameters:
contentType- Only accepts the strings defined inContentType.Type
-
setMatchType
public void setMatchType(MatchType matchType)
Specifies the match type to filter results.
The types of matches are:
-
MatchType.BROAD_MATCH: broad or fuzzy match. Search criteria includes: typo correction, not all words need to exist. -
MatchType.PHRASE_MATCH: phrase match. Search criteria includes: typo correction, all words need to be included. -
MatchType.EXACT_MATCH: exact match. Search criteria includes: no typo correction, text needs to be exact.
The default isMatchType.BROAD_MATCH- Parameters:
matchType- Sets the type of match as broad, phrase or exact.
-
-
setSeatClass
public void setSeatClass(java.lang.String seatClass)
Specifies the seat class, such as first or business.
If not specified, SeatClass.All will be used.- Parameters:
seatClass- Only accepts strings provided bySeatClass, such as first, business or all.
-
setFilterFields
public void setFilterFields(java.util.Map<SearchFilter,java.lang.String> filterFields)
Specifies the fields to be filtered.
Example: duration, subtitle, soundtrack, rating and category.- Parameters:
filterFields- Specifies the fields to be filtered.
-
setRequestedFields
public void setRequestedFields(java.util.Set<java.lang.String> requestedFields)
Specifies the fields to be returned.
Example: Title, genre, year, artist, actor and director.
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 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.
-
setPagination
public void setPagination(PagingOption paging)
Identifies the pagination parameter for the page offset and page size.
The offset sets the number of items to skip in the result. The default is 0 items to skip.
If this offset is negative, 0 will be used.
If the offset is greater than the total amount of the matched data, nothing will be returned.
The page size sets the maximum number of items to return in the result. The default is 150 items. For example: offset=60&page_size=15 - The first 60 items will be skipped. The items 61 to 75 will be returned, if available.- Parameters:
paging- pagination
-
executeSync
public java.util.List<Item> executeSync() throws ContentDiscovery.Exception
Gets a list of items synchronously.- Returns:
- a list of Item.
- Throws:
ContentDiscovery.Exception- if error occurs.
-
executeAsync
public void executeAsync(ContentDiscovery.Listener<Item> listener)
Gets a list of items asynchronously.- Parameters:
listener- Data is passed back in the listener. If data is retrieved successfully,ContentDiscovery.Listener.onDataReceived(List, RequestBase)is called.
If error happens,ContentDiscovery.Listener.onError(ContentDiscovery.Error, RequestBase)is called.
-
getSocketPayload
public JSONObject getSocketPayload()
- Specified by:
getSocketPayloadin classRequestBase<Item>
-
-