Class Playlist.Builder
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject.Builder
se.michaelthelin.spotify.model_objects.specification.Playlist.Builder
- All Implemented Interfaces:
IModelObject.Builder
- Enclosing class:
Playlist
Builder class for building
Playlist
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a model object with the information set in the builder object.setCollaborative
(Boolean collaborative) Set whether the playlist to be built is collaborative or not.setDescription
(String description) Set the description of the playlist to be built.setExternalUrls
(ExternalUrl externalUrls) Set the external URLs of the playlist to be built.setFollowers
(Followers followers) Set information about the followers of the playlist to be built.Set the link to the Spotify Web API endpoint providing full details of the playlist.Set the Spotify ID for the playlist to be built.Set the cover image of the playlist to be built.Set the name of the playlist to be built.Set the owner of the playlist to be built.setPublicAccess
(Boolean publicAccess) Set whether the playlist to be built is available in public or not.setSnapshotId
(String snapshotId) Set the version identifier for the playlist to be built.setTracks
(Paging<PlaylistTrack> tracks) Set the tracks of the playlist to be built.setType
(ModelObjectType type) Set the type of the model object.Set the Spotify URI of the playlist to be built.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setCollaborative
Set whether the playlist to be built is collaborative or not.- Parameters:
collaborative
-true
if the owner allows other users to modify the playlist,false
if not.- Returns:
- A
Playlist.Builder
.
-
setDescription
Set the description of the playlist to be built.- Parameters:
description
- Playlist description.- Returns:
- A
Playlist.Builder
.
-
setExternalUrls
Set the external URLs of the playlist to be built.- Parameters:
externalUrls
- Known external URLs for this playlist.- Returns:
- A
Playlist.Builder
.
-
setFollowers
Set information about the followers of the playlist to be built.- Parameters:
followers
- Information about the followers of the playlist.- Returns:
- A
Playlist.Builder
.
-
setHref
Set the link to the Spotify Web API endpoint providing full details of the playlist.- Parameters:
href
- A link to the Spotify Web API endpoint providing full details of the playlist.- Returns:
- A
Playlist.Builder
.
-
setId
Set the Spotify ID for the playlist to be built.- Parameters:
id
- The Spotify ID for the playlist.- Returns:
- A
Playlist.Builder
.
-
setImages
Set the cover image of the playlist to be built.- Parameters:
images
- An array of images in different sizes.- Returns:
- A
Playlist.Builder
.
-
setName
Set the name of the playlist to be built.- Parameters:
name
- The playlist name.- Returns:
- A
Playlist.Builder
.
-
setOwner
Set the owner of the playlist to be built.- Parameters:
owner
- A user object.- Returns:
- A
Playlist.Builder
.
-
setPublicAccess
Set whether the playlist to be built is available in public or not.- Parameters:
publicAccess
-true
the playlist is public,false
the playlist is private,null
the playlist status is not relevant.- Returns:
- A
Playlist.Builder
.
-
setSnapshotId
Set the version identifier for the playlist to be built.- Parameters:
snapshotId
- The version identifier for the playlist.- Returns:
- A
Playlist.Builder
.
-
setTracks
Set the tracks of the playlist to be built.- Parameters:
tracks
- Information about the tracks of the playlist.- Returns:
- A
Playlist.Builder
.
-
setType
Set the type of the model object. In this case "playlist".- Parameters:
type
- The model object type.- Returns:
- A
Playlist.Builder
.
-
setUri
Set the Spotify URI of the playlist to be built.- Parameters:
uri
- The Spotify playlist URI.- Returns:
- A
Playlist.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.
-