Class PlaylistItemFactory

java.lang.Object
se.michaelthelin.spotify.model_objects.utils.PlaylistItemFactory

public class PlaylistItemFactory extends Object
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 Details

    • PlaylistItemFactory

      public PlaylistItemFactory()
      Default constructor.
  • Method Details

    • createPlaylistItem

      public static IPlaylistItem createPlaylistItem(com.google.gson.JsonObject trackObj)
      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