Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix(playlist): allow to extend the has-total interface
  • Loading branch information
dargmuesli committed Apr 29, 2026
commit 57276ddd270bef30951e7189f9909894ecc9d232
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
*
* <p>This interface provides a common base for {@link Playlist} and
* {@link PlaylistSimplified} objects.
*
* @param <T> The concrete type of the items/tracks metadata object. {@link Playlist} uses
* {@link se.michaelthelin.spotify.model_objects.specification.Paging} and
* {@link PlaylistSimplified} uses
* {@link se.michaelthelin.spotify.model_objects.miscellaneous.PlaylistTracksInformation}.
*/
public interface IPlaylist {
public interface IPlaylist<T extends IHasTotal> {
/**
* Check whether the owner allows other users to modify the playlist.
*
Expand Down Expand Up @@ -93,7 +98,7 @@ public interface IPlaylist {
*
* @return Item information containing total count.
*/
IHasTotal getItems();
T getItems();

/**
* Get the snapshot ID, the version identifier for the current playlist. Can be supplied in other requests to target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Playlist objects</a> by building instances from this class.
*/
@JsonDeserialize(builder = Playlist.Builder.class)
public class Playlist extends AbstractModelObject implements IPlaylist {
public class Playlist extends AbstractModelObject implements IPlaylist<Paging<PlaylistTrack>> {
/** Whether the playlist is collaborative. */
private final Boolean collaborative;
/** The description of the playlist. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* simplified Playlist objects</a> by building instances from this class.
*/
@JsonDeserialize(builder = PlaylistSimplified.Builder.class)
public class PlaylistSimplified extends AbstractModelObject implements ISearchModelObject, IPlaylist {
public class PlaylistSimplified extends AbstractModelObject implements ISearchModelObject, IPlaylist<PlaylistTracksInformation> {
/** Whether the playlist is collaborative. */
private final Boolean collaborative;
/** The description of the playlist. */
Expand Down
Loading