Class RequestSearchByField
- java.lang.Object
-
- aero.panasonic.inflight.services.contentdiscovery.v1.RequestBase<Item>
-
- aero.panasonic.inflight.services.contentdiscovery.v1.RequestSearchByField
-
public class RequestSearchByField extends RequestBase<Item>
The RequestSearchByField class returns items filtered by tag values.
Request Search By Field is similar toRequestItem. However, this class providessetMatchType(MatchType)to specify match type.
This is the class returned byContentDiscovery.searchByFieldRequest(Map))} ()} (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 filter the results.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 fields to be returned.voidsetSeatClass(java.lang.String seatClass)Specifies the seat class, such as first or business.-
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.
-
setFilterFields
public void setFilterFields(java.util.Map<SearchFilter,java.lang.String> filterFields)
Specifies the fields to filter the results.
Example: duration, subtitle, soundtrack, rating and category.
Multiple fields are allowed.- Parameters:
filterFields- Fields to use in filtering the results.
-
setRequestedFields
public void setRequestedFields(java.util.Set<java.lang.String> requestedFields)
Specifies fields to be returned.
Example: Title, genre, year, artist, actor and director.
If set, only the specified fields are returned.
If not set, all fields will be returned.- Parameters:
requestedFields- Fields to return.
-
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. 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:
- List of items.
- 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 retrieved successfully,ContentDiscovery.Listener.onDataReceived(List, RequestBase))} is called.
If error occurs,ContentDiscovery.Listener.onError(ContentDiscovery.Error, RequestBase)is called.
-
getSocketPayload
public JSONObject getSocketPayload()
- Specified by:
getSocketPayloadin classRequestBase<Item>
-
-