Class Playlist.Builder
- java.lang.Object
-
- com.wrapper.spotify.model_objects.AbstractModelObject.Builder
-
- com.wrapper.spotify.model_objects.specification.Playlist.Builder
-
- All Implemented Interfaces:
IModelObject.Builder
- Enclosing class:
- Playlist
public static final class Playlist.Builder extends AbstractModelObject.Builder
Builder class for buildingPlaylistinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Playlistbuild()Build a model object with the information set in the builder object.Playlist.BuildersetCollaborative(Boolean collaborative)Set whether the playlist to be built is collaborative or not.Playlist.BuildersetDescription(String description)Set the description of the playlist to be built.Playlist.BuildersetExternalUrls(ExternalUrl externalUrls)Set the external URLs of the playlist to be built.Playlist.BuildersetFollowers(Followers followers)Set information about the followers of the playlist to be built.Playlist.BuildersetHref(String href)Set the link to the Spotify Web API endpoint providing full details of the playlist.Playlist.BuildersetId(String id)Set the Spotify ID for the playlist to be built.Playlist.BuildersetImages(Image... images)Set the cover image of the playlist to be built.Playlist.BuildersetName(String name)Set the name of the playlist to be built.Playlist.BuildersetOwner(User owner)Set the owner of the playlist to be built.Playlist.BuildersetPublicAccess(Boolean publicAccess)Set whether the playlist to be built is available in public or not.Playlist.BuildersetSnapshotId(String snapshotId)Set the version identifier for the playlist to be built.Playlist.BuildersetTracks(Paging<PlaylistTrack> tracks)Set the tracks of the playlist to be built.Playlist.BuildersetType(ModelObjectType type)Set the type of the model object.Playlist.BuildersetUri(String uri)Set the Spotify URI of the playlist to be built.
-
-
-
Method Detail
-
setCollaborative
public Playlist.Builder setCollaborative(Boolean collaborative)
Set whether the playlist to be built is collaborative or not.- Parameters:
collaborative-trueif the owner allows other users to modify the playlist,falseif not.- Returns:
- A
Playlist.Builder.
-
setDescription
public Playlist.Builder setDescription(String description)
Set the description of the playlist to be built.- Parameters:
description- Playlist description.- Returns:
- A
Playlist.Builder.
-
setExternalUrls
public Playlist.Builder setExternalUrls(ExternalUrl externalUrls)
Set the external URLs of the playlist to be built.- Parameters:
externalUrls- Known external URLs for this playlist.- Returns:
- A
Playlist.Builder.
-
setFollowers
public Playlist.Builder setFollowers(Followers followers)
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
public Playlist.Builder setHref(String href)
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
public Playlist.Builder setId(String id)
Set the Spotify ID for the playlist to be built.- Parameters:
id- The Spotify ID for the playlist.- Returns:
- A
Playlist.Builder.
-
setImages
public Playlist.Builder setImages(Image... images)
Set the cover image of the playlist to be built.- Parameters:
images- An array of images in different sizes.- Returns:
- A
Playlist.Builder.
-
setName
public Playlist.Builder setName(String name)
Set the name of the playlist to be built.- Parameters:
name- The playlist name.- Returns:
- A
Playlist.Builder.
-
setOwner
public Playlist.Builder setOwner(User owner)
Set the owner of the playlist to be built.- Parameters:
owner- A user object.- Returns:
- A
Playlist.Builder.
-
setPublicAccess
public Playlist.Builder setPublicAccess(Boolean publicAccess)
Set whether the playlist to be built is available in public or not.- Parameters:
publicAccess-truethe playlist is public,falsethe playlist is private,nullthe playlist status is not relevant.- Returns:
- A
Playlist.Builder.
-
setSnapshotId
public Playlist.Builder setSnapshotId(String snapshotId)
Set the version identifier for the playlist to be built.- Parameters:
snapshotId- The version identifier for the playlist.- Returns:
- A
Playlist.Builder.
-
setTracks
public Playlist.Builder setTracks(Paging<PlaylistTrack> tracks)
Set the tracks of the playlist to be built.- Parameters:
tracks- Information about the tracks of the playlist.- Returns:
- A
Playlist.Builder.
-
setType
public Playlist.Builder setType(ModelObjectType type)
Set the type of the model object. In this case "playlist".- Parameters:
type- The model object type.- Returns:
- A
Playlist.Builder.
-
setUri
public Playlist.Builder setUri(String uri)
Set the Spotify URI of the playlist to be built.- Parameters:
uri- The Spotify playlist URI.- Returns:
- A
Playlist.Builder.
-
build
public Playlist 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.
-
-