public class Search extends Object implements Serializable
Constructor and Description |
---|
Search()
No-arg constructor.
|
Search(String term)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
build()
Create the request URL for this
Search |
Response |
execute()
Execute this iTunes Search API request.
|
Response |
execute(Connector connector)
Execute this iTunes Search API request using the provided
Connector implementation. |
Attribute |
getAttribute() |
Country |
getCountry() |
Entity |
getEntity() |
Lang |
getLang() |
Integer |
getLimit() |
Media |
getMedia() |
String |
getTerm() |
Integer |
getVersion() |
Boolean |
isExplicit() |
Search |
setAttribute(Attribute attribute) |
Search |
setCountry(Country country) |
Search |
setEntity(Entity entity) |
Search |
setExplicit(boolean explicit) |
Search |
setLang(Lang lang) |
Search |
setLimit(int limit)
The number of search results you want the iTunes Store to return.
|
Search |
setMedia(Media media) |
Search |
setTerm(String term) |
Search |
setVersion(int version)
The search result key version you want to receive back from your search.
|
public Response execute()
Response
from iTunesIllegalStateException
- as thrown by build()
RuntimeException
- wrapping any IOException
thrown performing the
request or parsing the responsepublic Response execute(Connector connector)
Connector
implementation.connector
- Connector
implementation, not null
Response
from iTunesIllegalArgumentException
- if argument null
IllegalStateException
- as thrown by build()
RuntimeException
- wrapping any IOException
thrown performing the
request or parsing the responsepublic Search setTerm(String term)
term
- word or phrase to search for, String
, can be
null
this
instance for method chainingpublic Search setCountry(Country country)
country
- Country
, can be null
this
instance for method chainingpublic Search setMedia(Media media)
media
- Media
, can be null
this
instance for method chainingpublic Search setEntity(Entity entity)
entity
- Entity
, can be null
this
instance for method chainingpublic Search setAttribute(Attribute attribute)
attribute
- Attribute
, can be null
this
instance for method chainingpublic Search setLimit(int limit)
limit
- int
between 1 (inclusive) and 200 (inclusive)this
instance for method chainingIllegalArgumentException
- if limit not validpublic Search setLang(Lang lang)
lang
- Lang
, can be null
this
instance for method chainingpublic Search setVersion(int version)
version
- int
1 or 2this
instance for method chainingIllegalArgumentException
- if version not validpublic Search setExplicit(boolean explicit)
explicit
- boolean
indicating whether or not to include explicit
resultsthis
instance for method chainingpublic String build()
Search
Search
IllegalStateException
- if no term is set in this Search
Copyright © 2018. All rights reserved.