public class FeedGenerator extends Object implements Serializable
Constructor and Description |
---|
FeedGenerator() |
Modifier and Type | Method and Description |
---|---|
Feed |
execute()
Queries iTunes using the current state of this
FeedGenerator |
Feed |
execute(Connector connector)
Execute this Feed Generator API request using the provided
Connector implementation. |
Country |
getCountry() |
FeedType |
getFeedType() |
FeedFormat |
getFormat() |
MediaType |
getMediaType() |
int |
getResultsLimit() |
String |
getUrl()
Construct a valid feed URL based on the current state of this
FeedGenerator |
boolean |
isAllowExplicit() |
FeedGenerator |
setAllowExplicit(boolean allowExplicit)
Default value is
true |
FeedGenerator |
setCountry(Country country)
Default value is
Country.UNITED_STATES |
FeedGenerator |
setFeedType(FeedType feedType)
Default value is
FeedType.NEW_MUSIC The given FeedType must be compatible with the current
MediaType . |
FeedGenerator |
setFormat(FeedFormat format)
Default value is
FeedFormat.JSON |
FeedGenerator |
setMediaType(MediaType mediaType)
Default value is
MediaType.APPLE_MUSIC Setting MediaType also changes the FeedType to be compatible
with the given MediaType |
FeedGenerator |
setResultsLimit(int resultsLimit)
Default value is
10 Note that Apple limits results to 200, even when more are requested |
public String getUrl()
FeedGenerator
String
, never null
public Feed execute()
FeedGenerator
Feed
public Feed execute(Connector connector)
Connector
implementation.connector
- Connector
implementation, not null
Feed
response from iTunesIllegalArgumentException
- if argument null
RuntimeException
- wrapping any IOException
thrown performing the
request or parsing the responsepublic Country getCountry()
public FeedGenerator setCountry(Country country)
Country.UNITED_STATES
country
- a Country
, not null
this
instance for method chainingpublic MediaType getMediaType()
public FeedGenerator setMediaType(MediaType mediaType)
MediaType.APPLE_MUSIC
MediaType
also changes the FeedType
to be compatible
with the given MediaType
mediaType
- a MediaType
, not null
this
instance for method chainingpublic FeedType getFeedType()
public FeedGenerator setFeedType(FeedType feedType)
FeedType.NEW_MUSIC
FeedType
must be compatible with the current
MediaType
. Refer to MediaType.getCompatibleFeedTypes()
to
determine which FeedType
instances are compatible with the current
MediaType
.feedType
- a FeedType
, not null
this
instance for method chainingMediaType.getCompatibleFeedTypes()
public int getResultsLimit()
public FeedGenerator setResultsLimit(int resultsLimit)
10
resultsLimit
- a positive integerthis
instance for method chainingpublic boolean isAllowExplicit()
public FeedGenerator setAllowExplicit(boolean allowExplicit)
true
allowExplicit
- true if explicit results may be includedthis
instance for method chainingpublic FeedFormat getFormat()
public FeedGenerator setFormat(FeedFormat format)
FeedFormat.JSON
format
- a FeedFormat
, not null
this
instance for method chainingCopyright © 2018. All rights reserved.