Class PlaylistItemFactory
java.lang.Object
se.michaelthelin.spotify.model_objects.utils.PlaylistItemFactory
Factory class for creating playlist item objects from JSON data.
This utility handles the creation of different types of playlist items
such as tracks and episodes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IPlaylistItem
createPlaylistItem
(com.google.gson.JsonObject trackObj) Creates a playlist item from a JSON object.
-
Constructor Details
-
PlaylistItemFactory
public PlaylistItemFactory()Default constructor.
-
-
Method Details
-
createPlaylistItem
Creates a playlist item from a JSON object. Determines the type of item (track or episode) based on the "type" field and creates the appropriate model object.- Parameters:
trackObj
- the JSON object containing playlist item data- Returns:
- the created playlist item, or null if the type is not recognized
-