Class TrackSimplified.Builder
- java.lang.Object
-
- com.wrapper.spotify.model_objects.AbstractModelObject.Builder
-
- com.wrapper.spotify.model_objects.specification.TrackSimplified.Builder
-
- All Implemented Interfaces:
IModelObject.Builder
- Enclosing class:
- TrackSimplified
public static final class TrackSimplified.Builder extends AbstractModelObject.Builder
Builder class for buildingTrackSimplifiedinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrackSimplifiedbuild()Build a model object with the information set in the builder object.TrackSimplified.BuildersetArtists(ArtistSimplified... artists)Set the artists of the track to be built.TrackSimplified.BuildersetAvailableMarkets(com.neovisionaries.i18n.CountryCode... availableMarkets)Set the available markets of the track to be built.TrackSimplified.BuildersetDiscNumber(Integer discNumber)Set the disc numer of the track to be built.TrackSimplified.BuildersetDurationMs(Integer durationMs)Set the duration in milliseconds of the track to be built.TrackSimplified.BuildersetExplicit(Boolean explicit)Set whether the track to be built is explicit or not.TrackSimplified.BuildersetExternalUrls(ExternalUrl externalUrls)Set external URLs of the track to be built.TrackSimplified.BuildersetHref(String href)Set href of Spotify Web API endpoint of the track to be built.TrackSimplified.BuildersetId(String id)Set track ID of the track to be built.TrackSimplified.BuildersetIsPlayable(Boolean isPlayable)Set whether the track to be built is playable in your market region or not.TrackSimplified.BuildersetLinkedFrom(TrackLink linkedFrom)Set the track link object of the track to be built.TrackSimplified.BuildersetName(String name)Set the name of the track to be built.TrackSimplified.BuildersetPreviewUrl(String previewUrl)Set the preview URL of the track to be built.TrackSimplified.BuildersetTrackNumber(Integer trackNumber)Set the track number of the track to be built.TrackSimplified.BuildersetType(ModelObjectType type)Set the type of the model object.TrackSimplified.BuildersetUri(String uri)Set Spotify URI of the track to be built.
-
-
-
Method Detail
-
setArtists
public TrackSimplified.Builder setArtists(ArtistSimplified... artists)
Set the artists of the track to be built.- Parameters:
artists- The artists who performed the track.- Returns:
- A
TrackSimplified.Builder.
-
setAvailableMarkets
public TrackSimplified.Builder setAvailableMarkets(com.neovisionaries.i18n.CountryCode... availableMarkets)
Set the available markets of the track to be built.- Parameters:
availableMarkets- A list of the countries in which the track can be played, identified by their ISO 3166-1 alpha-2 code.- Returns:
- A
TrackSimplified.Builder.
-
setDiscNumber
public TrackSimplified.Builder setDiscNumber(Integer discNumber)
Set the disc numer of the track to be built.- Parameters:
discNumber- The disc number (usually 1 unless the album consists of more than one disc).- Returns:
- A
TrackSimplified.Builder.
-
setDurationMs
public TrackSimplified.Builder setDurationMs(Integer durationMs)
Set the duration in milliseconds of the track to be built.- Parameters:
durationMs- The track length in milliseconds.- Returns:
- A
TrackSimplified.Builder.
-
setExplicit
public TrackSimplified.Builder setExplicit(Boolean explicit)
Set whether the track to be built is explicit or not.- Parameters:
explicit- Whether or not the track has explicit lyrics (true= yes it does;false= no it does not OR unknown).- Returns:
- A
TrackSimplified.Builder.
-
setExternalUrls
public TrackSimplified.Builder setExternalUrls(ExternalUrl externalUrls)
Set external URLs of the track to be built.- Parameters:
externalUrls- Known external URLs for the track.- Returns:
- A
TrackSimplified.Builder.
-
setHref
public TrackSimplified.Builder setHref(String href)
Set href of Spotify Web API endpoint of the track to be built.- Parameters:
href- A link to the Web API endpoint providing full details of the track.- Returns:
- A
TrackSimplified.Builder.
-
setId
public TrackSimplified.Builder setId(String id)
Set track ID of the track to be built.- Parameters:
id- The Spotify ID for the track.- Returns:
- A
TrackSimplified.Builder.
-
setIsPlayable
public TrackSimplified.Builder setIsPlayable(Boolean isPlayable)
Set whether the track to be built is playable in your market region or not.- Parameters:
isPlayable- Iftrue, the track is playable in the given market. Otherwisefalse.- Returns:
- A
TrackSimplified.Builder.
-
setLinkedFrom
public TrackSimplified.Builder setLinkedFrom(TrackLink linkedFrom)
Set the track link object of the track to be built.- Parameters:
linkedFrom- The track in thelinked_fromobject contains information about the originally requested track.- Returns:
- A
TrackSimplified.Builder.
-
setName
public TrackSimplified.Builder setName(String name)
Set the name of the track to be built.- Parameters:
name- Track name.- Returns:
- A
TrackSimplified.Builder.
-
setPreviewUrl
public TrackSimplified.Builder setPreviewUrl(String previewUrl)
Set the preview URL of the track to be built.- Parameters:
previewUrl- A link to a 30 second preview (MP3 format) of the track.nullif not available.- Returns:
- A
TrackSimplified.Builder.
-
setTrackNumber
public TrackSimplified.Builder setTrackNumber(Integer trackNumber)
Set the track number of the track to be built.- Parameters:
trackNumber- The track number.- Returns:
- A
TrackSimplified.Builder.
-
setType
public TrackSimplified.Builder setType(ModelObjectType type)
Set the type of the model object. In this case "track".- Parameters:
type- The object type: "track".- Returns:
- A
TrackSimplified.Builder.
-
setUri
public TrackSimplified.Builder setUri(String uri)
Set Spotify URI of the track to be built.- Parameters:
uri- The Spotify URI for the track.- Returns:
- A
TrackSimplified.Builder.
-
build
public TrackSimplified build()
Description copied from interface:IModelObject.BuilderBuild a model object with the information set in the builder object.
The type of the model object and its methods depend on its corresponding implementation.- Returns:
- A model object.
-
-