Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@JsonDeserialize(builder = PlaylistSimplified.Builder.class)
public class PlaylistSimplified extends AbstractModelObject implements ISearchModelObject {
private final Boolean collaborative;
private final String description;
private final ExternalUrl externalUrls;
private final String href;
private final String id;
Expand All @@ -34,6 +35,7 @@ private PlaylistSimplified(final Builder builder) {
super(builder);

this.collaborative = builder.collaborative;
this.description = builder.description;
this.externalUrls = builder.externalUrls;
this.href = builder.href;
this.id = builder.id;
Expand All @@ -59,6 +61,15 @@ public Boolean getIsCollaborative() {
return collaborative;
}

/**
* Get the description of the playlist.
*
* @return The playlist description. Only returned for modified, verified playlists, otherwise null.
*/
public String getDescription() {
return description;
}

/**
* Get the external URLs of the playlist. <br>
* Example: Spotify-URL.
Expand Down Expand Up @@ -174,9 +185,9 @@ public String getUri() {
@Override
public String toString() {
return "PlaylistSimplified(name=" + name + ", tracks=" + tracks + ", collaborative=" + collaborative
+ ", externalUrls=" + externalUrls + ", href=" + href + ", id=" + id + ", images=" + Arrays.toString(images)
+ ", owner=" + owner + ", publicAccess=" + publicAccess + ", snapshotId=" + snapshotId + ", type=" + type
+ ", uri=" + uri + ")";
+ ", description=" + description + ", externalUrls=" + externalUrls + ", href=" + href + ", id=" + id
+ ", images=" + Arrays.toString(images) + ", owner=" + owner + ", publicAccess=" + publicAccess
+ ", snapshotId=" + snapshotId + ", type=" + type + ", uri=" + uri + ")";
}

@Override
Expand All @@ -189,6 +200,7 @@ public Builder builder() {
*/
public static final class Builder extends AbstractModelObject.Builder {
private Boolean collaborative;
private String description;
private ExternalUrl externalUrls;
private String href;
private String id;
Expand All @@ -212,6 +224,17 @@ public Builder setCollaborative(Boolean collaborative) {
return this;
}

/**
* Set the description of the playlist to be built.
*
* @param description The playlist description.
* @return A {@link PlaylistSimplified.Builder}.
*/
public Builder setDescription(String description) {
this.description = description;
return this;
}

/**
* Set the external URLs of the playlist to be built.
*
Expand Down Expand Up @@ -355,6 +378,10 @@ public PlaylistSimplified createModelObject(JsonObject jsonObject) {
hasAndNotNull(jsonObject, "collaborative")
? jsonObject.get("collaborative").getAsBoolean()
: null)
.setDescription(
hasAndNotNull(jsonObject, "description")
? jsonObject.get("description").getAsString()
: null)
.setExternalUrls(
hasAndNotNull(jsonObject, "external_urls")
? new ExternalUrl.JsonUtil().createModelObject(
Expand Down