Class ThemePlayListProvider

java.lang.Object
de.pottgames.tuningfork.jukebox.playlist.ThemePlayListProvider
All Implemented Interfaces:
PlayListProvider

public class ThemePlayListProvider extends Object implements PlayListProvider
This provider offers PlayLists based on the currently set theme. PlayLists are not consumed/removed when fetched.
Theme - PlayList is a 1:1 relation, you can only connect one PlayList to one theme.
  • Field Details

    • theme

      protected int theme
  • Constructor Details

    • ThemePlayListProvider

      public ThemePlayListProvider()
  • Method Details

    • setTheme

      public ThemePlayListProvider setTheme(int theme)
      Sets the theme.
      Parameters:
      theme - the theme identifier
      Returns:
      the ThemePlayListProvider for chaining
    • getTheme

      public int getTheme()
      Returns the theme.
      Returns:
      the theme
    • add

      public ThemePlayListProvider add(PlayList list, int theme)
      Adds a theme and the corresponding PlayList, potentially replacing a previously set PlayList for that theme.
      Parameters:
      list - the playlist
      theme - a custom id you can choose freely
      Returns:
      the ThemePlayListProvider for chaining
    • remove

      public ThemePlayListProvider remove(int theme)
      Removes a PlayList and the theme from the internal map.
      Parameters:
      theme - a custom id you can choose freely
      Returns:
      the ThemePlayListProvider for chaining
    • next

      public PlayList next()
      Description copied from interface: PlayListProvider
      Returns the next PlayList. May be null if none is available.
      Specified by:
      next in interface PlayListProvider
      Returns:
      the PlayList
    • hasNext

      public boolean hasNext()
      Description copied from interface: PlayListProvider
      Returns true if a PlayList is available via PlayListProvider.next().
      Specified by:
      hasNext in interface PlayListProvider
      Returns:
      true if a PlayList is available, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object