Class Song

java.lang.Object
org.localify.music.song.Song

@Entity public class Song extends Object
Represents a song.
  • Constructor Details

    • Song

      protected Song()
      Protected no-arg constructor for JPA.
    • Song

      public Song(String name)
      Constructs a new Song.
      Parameters:
      name - The name of the song.
  • Method Details

    • getPreviewUrl

      public String getPreviewUrl()
      Gets the preview URL for the song, preferring Apple Music over Spotify.
      Returns:
      The preview URL.
    • getId

      public UUID getId()
      Gets the ID of the song.
      Returns:
      The song ID.
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp.
      Returns:
      The creation timestamp.
    • getUpdatedAt

      public Instant getUpdatedAt()
      Gets the last update timestamp.
      Returns:
      The last update timestamp.
    • getName

      public String getName()
      Gets the name of the song.
      Returns:
      The song name.
    • getSpotifyId

      public String getSpotifyId()
      Gets the Spotify ID of the song.
      Returns:
      The Spotify ID.
    • setName

      public void setName(String name)
      Sets the name of the song.
      Parameters:
      name - The song name.
    • getSpotifyPopularity

      public Integer getSpotifyPopularity()
      Gets the Spotify popularity of the song.
      Returns:
      The Spotify popularity.
    • getSpotifyImage

      public String getSpotifyImage()
      Gets the Spotify image URL for the song.
      Returns:
      The Spotify image URL.
    • setSpotifyId

      public void setSpotifyId(String spotifyId)
      Sets the Spotify ID of the song.
      Parameters:
      spotifyId - The Spotify ID.
    • setSpotifyPopularity

      public void setSpotifyPopularity(Integer spotifyPopularity)
      Sets the Spotify popularity of the song.
      Parameters:
      spotifyPopularity - The Spotify popularity.
    • setSpotifyImage

      public void setSpotifyImage(String spotifyImage)
      Sets the Spotify image URL for the song.
      Parameters:
      spotifyImage - The Spotify image URL.
    • getIsrc

      public String getIsrc()
      Gets the ISRC of the song.
      Returns:
      The ISRC.
    • setIsrc

      public void setIsrc(String isrc)
      Sets the ISRC of the song.
      Parameters:
      isrc - The ISRC.
    • getDuration

      public Duration getDuration()
      Gets the duration of the song.
      Returns:
      The duration.
    • setDuration

      public void setDuration(Duration duration)
      Sets the duration of the song.
      Parameters:
      duration - The duration.
    • getSpotifyPreviewUrl

      public String getSpotifyPreviewUrl()
      Gets the Spotify preview URL for the song.
      Returns:
      The Spotify preview URL.
    • setSpotifyPreviewUrl

      public void setSpotifyPreviewUrl(String spotifyPreviewUrl)
      Sets the Spotify preview URL for the song.
      Parameters:
      spotifyPreviewUrl - The Spotify preview URL.
    • getAppleId

      public String getAppleId()
      Gets the Apple Music ID of the song.
      Returns:
      The Apple Music ID.
    • setAppleId

      public void setAppleId(String appleId)
      Sets the Apple Music ID of the song.
      Parameters:
      appleId - The Apple Music ID.
    • getAppleImage

      public String getAppleImage()
      Gets the Apple Music image URL for the song.
      Returns:
      The Apple Music image URL.
    • setAppleImage

      public void setAppleImage(String appleImage)
      Sets the Apple Music image URL for the song.
      Parameters:
      appleImage - The Apple Music image URL.
    • getSpotifyAudioAnalysis

      public se.michaelthelin.spotify.model_objects.miscellaneous.AudioAnalysis getSpotifyAudioAnalysis()
      Gets the Spotify audio analysis for the song.
      Returns:
      The Spotify audio analysis.
    • setSpotifyAudioAnalysis

      public void setSpotifyAudioAnalysis(se.michaelthelin.spotify.model_objects.miscellaneous.AudioAnalysis spotifyAudioAnalysis)
      Sets the Spotify audio analysis for the song.
      Parameters:
      spotifyAudioAnalysis - The Spotify audio analysis.
    • getApplePreviewUrl

      public String getApplePreviewUrl()
      Gets the Apple Music preview URL for the song.
      Returns:
      The Apple Music preview URL.
    • setApplePreviewUrl

      public void setApplePreviewUrl(String applePreviewUrl)
      Sets the Apple Music preview URL for the song.
      Parameters:
      applePreviewUrl - The Apple Music preview URL.
    • getSpotifyAudioFeatures

      public SpotifyAudioFeatures getSpotifyAudioFeatures()
      Gets the Spotify audio features for the song.
      Returns:
      The Spotify audio features.
    • setSpotifyAudioFeatures

      public void setSpotifyAudioFeatures(SpotifyAudioFeatures spotifyAudioFeatures)
      Sets the Spotify audio features for the song.
      Parameters:
      spotifyAudioFeatures - The Spotify audio features.