Class TrackSimplified.Builder
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject.Builder
se.michaelthelin.spotify.model_objects.specification.TrackSimplified.Builder
- All Implemented Interfaces:
IModelObject.Builder
- Enclosing class:
TrackSimplified
Builder class for building
TrackSimplified
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a model object with the information set in the builder object.setArtists
(ArtistSimplified... artists) Set the artists of the track to be built.setAvailableMarkets
(com.neovisionaries.i18n.CountryCode... availableMarkets) Set the available markets of the track to be built.setDiscNumber
(Integer discNumber) Set the disc number of the track to be built.setDurationMs
(Integer durationMs) Set the duration in milliseconds of the track to be built.setExplicit
(Boolean explicit) Set whether the track to be built is explicit or not.setExternalUrls
(ExternalUrl externalUrls) Set external URLs of the track to be built.Set href of Spotify Web API endpoint of the track to be built.Set track ID of the track to be built.setIsPlayable
(Boolean isPlayable) Set whether the track to be built is playable in your market region or not.setLinkedFrom
(TrackLink linkedFrom) Set the track link object of the track to be built.Set the name of the track to be built.setPreviewUrl
(String previewUrl) Set the preview URL of the track to be built.setTrackNumber
(Integer trackNumber) Set the track number of the track to be built.setType
(ModelObjectType type) Set the type of the model object.Set Spotify URI of the track to be built.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setArtists
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
Set the disc number 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
Set the duration in milliseconds of the track to be built.- Parameters:
durationMs
- The track length in milliseconds.- Returns:
- A
TrackSimplified.Builder
.
-
setExplicit
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
Set external URLs of the track to be built.- Parameters:
externalUrls
- Known external URLs for the track.- Returns:
- A
TrackSimplified.Builder
.
-
setHref
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
Set track ID of the track to be built.- Parameters:
id
- The Spotify ID for the track.- Returns:
- A
TrackSimplified.Builder
.
-
setIsPlayable
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
Set the track link object of the track to be built.- Parameters:
linkedFrom
- The track in thelinked_from
object contains information about the originally requested track.- Returns:
- A
TrackSimplified.Builder
.
-
setName
Set the name of the track to be built.- Parameters:
name
- Track name.- Returns:
- A
TrackSimplified.Builder
.
-
setPreviewUrl
Set the preview URL of the track to be built.- Parameters:
previewUrl
- A link to a 30 second preview (MP3 format) of the track.null
if not available.- Returns:
- A
TrackSimplified.Builder
.
-
setTrackNumber
Set the track number of the track to be built.- Parameters:
trackNumber
- The track number.- Returns:
- A
TrackSimplified.Builder
.
-
setType
Set the type of the model object. In this case "track".- Parameters:
type
- The object type: "track".- Returns:
- A
TrackSimplified.Builder
.
-
setUri
Set Spotify URI of the track to be built.- Parameters:
uri
- The Spotify URI for the track.- Returns:
- A
TrackSimplified.Builder
.
-
build
Description copied from interface:IModelObject.Builder
Build 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.
-