File tree Expand file tree Collapse file tree
src/main/java/se/michaelthelin/spotify/model_objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 *
1313 * <p>This interface provides a common base for {@link Playlist} and
1414 * {@link PlaylistSimplified} objects.
15+ *
16+ * @param <T> The concrete type of the items/tracks metadata object. {@link Playlist} uses
17+ * {@link se.michaelthelin.spotify.model_objects.specification.Paging} and
18+ * {@link PlaylistSimplified} uses
19+ * {@link se.michaelthelin.spotify.model_objects.miscellaneous.PlaylistTracksInformation}.
1520 */
16- public interface IPlaylist {
21+ public interface IPlaylist < T extends IHasTotal > {
1722 /**
1823 * Check whether the owner allows other users to modify the playlist.
1924 *
@@ -93,7 +98,7 @@ public interface IPlaylist {
9398 *
9499 * @return Item information containing total count.
95100 */
96- IHasTotal getItems ();
101+ T getItems ();
97102
98103 /**
99104 * Get the snapshot ID, the version identifier for the current playlist. Can be supplied in other requests to target
Original file line number Diff line number Diff line change 1515 * Playlist objects</a> by building instances from this class.
1616 */
1717@ JsonDeserialize (builder = Playlist .Builder .class )
18- public class Playlist extends AbstractModelObject implements IPlaylist {
18+ public class Playlist extends AbstractModelObject implements IPlaylist < Paging < PlaylistTrack >> {
1919 /** Whether the playlist is collaborative. */
2020 private final Boolean collaborative ;
2121 /** The description of the playlist. */
Original file line number Diff line number Diff line change 1717 * simplified Playlist objects</a> by building instances from this class.
1818 */
1919@ JsonDeserialize (builder = PlaylistSimplified .Builder .class )
20- public class PlaylistSimplified extends AbstractModelObject implements ISearchModelObject , IPlaylist {
20+ public class PlaylistSimplified extends AbstractModelObject implements ISearchModelObject , IPlaylist < PlaylistTracksInformation > {
2121 /** Whether the playlist is collaborative. */
2222 private final Boolean collaborative ;
2323 /** The description of the playlist. */
You can’t perform that action at this time.
0 commit comments