| java.lang.Object | ||
| ↳ | com.google.gdata.client.Query | |
| ↳ | com.google.gdata.client.youtube.YouTubeQuery | |
A helper class that helps building queries for the YouTube feeds. Not all feeds implement all parameters defined on this class. See the documentation to get the list of parameters each feed supports.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| YouTubeQuery.OrderBy | Standard values for the orderby parameter. |
||||||||||
| YouTubeQuery.SafeSearch | Standard values for the safeSearch parameter. |
||||||||||
| YouTubeQuery.Time | Standard values for the time parameter. |
||||||||||
| YouTubeQuery.Uploader | Standard values for the uploader parameter. |
||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | FORMAT | ||||||||||
| String | LANGUAGE_RESTRICT | ||||||||||
| String | LOCATION | ||||||||||
| String | LOCATION_RADIUS | ||||||||||
| String | ORDERBY | ||||||||||
| String | RACY | ||||||||||
| String | RACY_EXCLUDE | ||||||||||
| String | RACY_INCLUDE | ||||||||||
| String | RESTRICTION | ||||||||||
| String | SAFE_SEARCH | ||||||||||
| String | TIME | ||||||||||
| String | UPLOADER | ||||||||||
| String | VQ | ||||||||||
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.client.Query
| |||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| COUNTRY_CODE_PATTERN | |||||||||||
| IP_V4_PATTERN | |||||||||||
| LOCATION_RADIUS_PATTERN | |||||||||||
| RELEVANCE_LANGUAGE_PATTERN | Prefix for specifying relevance by language. | ||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.client.Query
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new YouTubeQuery object that targets a feed.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves the country restriction set on the current query, if any.
| |||||||||||
Gets the value of the
format parameter. | |||||||||||
This method is deprecated.
Please use
getSafeSearch() instead.
| |||||||||||
Retrieves the IP restriction set on the current query, if any.
| |||||||||||
Gets the value of the
lr parameter. | |||||||||||
Returns the value of the
location parameter. | |||||||||||
Sets the value of the
location-radius parameter. | |||||||||||
Gets the language for which relevance ordering is optimized.
| |||||||||||
Gets the value of the
orderby parameter. | |||||||||||
Gets the value of the
safeSearch parameter. | |||||||||||
Gets the value of the
time parameter. | |||||||||||
Gets the value of the
uploader parameter. | |||||||||||
This method is deprecated.
Please use
getFullTextQuery() instead.
| |||||||||||
Returns
true if the query only wants results that have latitude
and longitude information. | |||||||||||
Sets the
restriction parameter to a country code. | |||||||||||
Sets the value of the
format parameter. | |||||||||||
Sets the value of the
format parameter. | |||||||||||
This method is deprecated.
Please use #setSafeSearch(String) instead.
| |||||||||||
Sets the
restriction parameter to an IP v4 address. | |||||||||||
Sets the value of the
lr parameter. | |||||||||||
Sets the value of the
location parameter. | |||||||||||
Sets the value of the
location-radius parameter. | |||||||||||
Sets the value of the
orderby parameter. | |||||||||||
Sets order by relevance with results optimized for a specific
language.
| |||||||||||
Set/unset the location restrict.
| |||||||||||
Sets the value of the
safeSearch parameter. | |||||||||||
Sets the value of the
time parameter. | |||||||||||
Sets the value of the
uploader parameter. | |||||||||||
This method is deprecated.
Please use Query#setFullTextQuery() instead.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.client.Query
| |||||||||||
From class
java.lang.Object
| |||||||||||
Prefix for specifying relevance by language.
Constructs a new YouTubeQuery object that targets a feed. The initial state of the query contains no parameters, meaning all entries in the feed would be returned if the query was executed immediately after construction.
| feedUrl | The URL of the feed against which queries will be executed. |
|---|
Retrieves the country restriction set on the current query, if any.
null if no country restriction is set.Gets the value of the format parameter.
| NumberFormatException | if the current value is invalid. |
|---|
This method is deprecated.
Please use getSafeSearch() instead.
Gets the value of the racy parameter.
racy=include parameter is presentRetrieves the IP restriction set on the current query, if any.
null if no IP restriction
is set.Gets the value of the lr parameter.
lr parameter; a language code
Returns the value of the location parameter.
GeoRssWhere element
describing the center of where to search.
Sets the value of the location-radius parameter. Format is
"100km". Valid units of measurement are "ft", "mi", "m", and "km".
Gets the language for which relevance ordering is optimized.
setOrderByRelevanceForLanguage(String) or null| IllegalStateException | if ordering is not set to relevance |
|---|
Gets the value of the orderby parameter.
orderby parameter.| IllegalStateException | if a time value was found in the
query that cannot be transformed into YouTubeQuery.OrderBy
|
|---|
Gets the value of the safeSearch parameter.
safeSearch parameter.| IllegalStateException | if a value was found in the
query that cannot be transformed into YouTubeQuery.SafeSearch
|
|---|
Gets the value of the time parameter.
time parameter| IllegalStateException | if a time value was found in the
query that cannot be transformed into YouTubeQuery.Time
|
|---|
Gets the value of the uploader parameter.
uploader parameter.| IllegalStateException | if a value was found in the
query that cannot be transformed into YouTubeQuery.Uploader
|
|---|
This method is deprecated.
Please use getFullTextQuery() instead.
Gets the value of the vq parameter.
Returns true if the query only wants results that have latitude
and longitude information.
true if the query is restricted by location, false otherwise.
Sets the restriction parameter to a country code.
This parameter restricts the returned results to content available for clients in the specified country.
Only one of the setCountryRestriction(String) or
setIpRestriction(String) should be used, using both will only take
into consideration the last used.
| countryCode | A two letter ISO-3166 country code, may be null
to mean no restriction at all. |
|---|
| IllegalArgumentException | if the given country code is not a well formated two letter country code. |
|---|
Sets the value of the format parameter.
See the documentation for a description of the
different formats that are be available.
| formats | Integer id of all the formats you are interested
in. Videos will be returned if and only if they have
downloadable content for at least one of these formats. null or an empty set removes the parameter
|
|---|
Sets the value of the format parameter.
See the documentation for a description of the
different formats that are be available.
| formats | Integer id of all the formats you are interested in. Videos will be returned if and only if they have downloadable content for at least one of these formats. No formats removes the parameter. |
|---|
This method is deprecated.
Please use #setSafeSearch(String) instead.
Sets the value of the racy parameter.
| includeRacy | true to include racy content, false
to exclude it, null to remove the parameter |
|---|
Sets the restriction parameter to an IP v4 address.
This parameter restricts the returned results to content available for clients in the country that the provided IP address belongs to.
Only one of the setCountryRestriction(String) or
setIpRestriction(String) should be used, using both will only take
into consideration the last used.
| ip | A v4 IP address and may be null to mean no restriction at
all. |
|---|
| IllegalArgumentException | if the given address is not a well formated IP v4 address. |
|---|
Sets the value of the lr parameter.
This parameters restricts the videos that are returned
to videos with its title, description and tags mostly
in the specified language.
It might be different from the language of the video itself.
| languageCode |
ISO 639-1 2-letter language code. zh-Hans for simplified
chinese, zh-Hant for traditional chinese.
|
|---|
Sets the value of the location parameter.
| where | A GeoRssWhere
element describing the center of where to search.
|
|---|
Sets the value of the location-radius parameter. Format is
"100km". Valid units of measurement are "ft", "mi", "m", and "km".
| locationRadius | The requested search radius. |
|---|
Sets the value of the orderby parameter.
| orderBy | Value of the orderby parameter,
null to remove the parameter
|
|---|
Sets order by relevance with results optimized for a specific language.
| languageCode | null or
ISO 639-1 2-letter language code. zh-Hans for simplified
chinese, zh-Hant for traditional chinese.
|
|---|
Set/unset the location restrict.
| isRestrictLocation | true if only videos that have
latitude and longitude information are to be returned,
false otherwise.
|
|---|
Sets the value of the safeSearch parameter.
| safeSearch | Value of safeSearch parameter,
null to remove the parameter
|
|---|
Sets the value of the time parameter.
| time | Time value, null to remove the parameter
|
|---|
Sets the value of the uploader parameter.
| uploader | Value of the uploader parameter,
null to remove the parameter
|
|---|
This method is deprecated.
Please use Query#setFullTextQuery() instead.
Sets the value of the vq parameter.
The vq parameter is exactly equivalent to the
q parameter.
| query | Query string, null to remove the parameter |
|---|