Class SongMeta

java.lang.Object
de.pottgames.tuningfork.jukebox.song.SongMeta

public class SongMeta extends Object
A class that holds basic meta data to a Song like title and artist. If you need custom attributes of arbitrary types, use addAttribute(Object, Object) and getAttribute(Object). It is a regular map of key-value pairs.
  • Field Details

    • artist

      protected String artist
    • title

      protected String title
    • album

      protected String album
  • Constructor Details

    • SongMeta

      public SongMeta()
  • Method Details

    • setArtist

      public SongMeta setArtist(String artist)
      Sets the artist.
      Parameters:
      artist - the artist
      Returns:
      the SongMeta for chaining
    • setTitle

      public SongMeta setTitle(String title)
      Sets the title.
      Parameters:
      title - the title
      Returns:
      the SongMeta for chaining
    • setAlbum

      public SongMeta setAlbum(String album)
      Sets the album.
      Parameters:
      album - the album title
      Returns:
      the SongMeta for chaining
    • getArtist

      public String getArtist()
      Returns the artist. May be null.
      Returns:
      the artist
    • getTitle

      public String getTitle()
      Returns the title. May be null.
      Returns:
      the title
    • getAlbum

      public String getAlbum()
      Returns the album. May be null.
      Returns:
      the album
    • addAttribute

      public SongMeta addAttribute(Object key, Object value)
      Adds a custom attribute. Attributes are simple key-value pairs.
      Parameters:
      key - the key
      value - the value
      Returns:
      the SongMeta for chaining
    • getAttribute

      public Object getAttribute(Object key)
      Returns the value that is connected to the given key.
      Parameters:
      key - the key
      Returns:
      value
    • toString

      public String toString()
      Overrides:
      toString in class Object