Package org.mpris
Class Metadata.Builder
java.lang.Object
org.mpris.Metadata.Builder
- Enclosing class:
Metadata
Builds
Metadata. Setting mpris:trackid is mandatory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()setAlbumArtists(List<String> albumArtists) Sets xesam:albumArtist
The album artist(s).setAlbumName(String albumName) Sets xesam:album
The album name.setArtists(List<String> artists) Sets xesam:artist
The track artist(s).Sets mpris:artUrl
The location of an image representing the track or album.Sets xesam:asText
The track lyrics.setAudioBPM(int bpm) Sets xesam:audioBPM
The speed of the music, in beats per minute.setAutoRating(double autoRating) Sets xesam:autoRating
An automatically-generated rating, based on things such as how often it has been played.setComments(List<String> comments) Sets xesam:comment
A (list of) freeform comment(s).setComposers(List<String> composers) Sets xesam:composer
The composer(s) of the track.setContentCreated(Date date, ZoneOffset offset) Sets xesam:contentCreated
When the track was created.setDiscNumber(int discNumber) Sets xesam:discNumber
The disc number on the album that this track is from.setFirstUsed(Date date, ZoneOffset offset) Sets xesam:firstUsed
When the track was first played.Sets xesam:genre
The genre(s) of the track.setLastUsed(Date date, ZoneOffset offset) Sets xesam:lastUsed
When the track was last played.setLength(long duration) Sets mpris:length
The duration of the track in microseconds.setLyricists(List<String> lyricists) Sets xesam:lyricist
The lyricist(s) of the track.Sets xesam:title
The track title.setTrackID(org.freedesktop.dbus.DBusPath trackID) Sets mpris:trackid
A unique identity for this track within the context of an MPRIS object (eg: tracklist).setTrackNumber(int trackNumber) Sets xesam:trackNumber
The track number on the album disc.Sets xesam:url
The location of the media file.setUseCount(int useCount) Sets xesam:useCount
The number of times the track has been played.setUserRating(double userRating) Sets xesam:userRating
A user-specified rating.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setTrackID
Sets mpris:trackid
A unique identity for this track within the context of an MPRIS object (eg: tracklist).- Parameters:
trackID- The value of mpris:trackid- Returns:
- This builder
-
setLength
Sets mpris:length
The duration of the track in microseconds.- Parameters:
duration- The value of mpris:length- Returns:
- This builder
-
setArtURL
Sets mpris:artUrl
The location of an image representing the track or album. Clients should not assume this will continue to exist when the media player stops giving out the URL.- Parameters:
artURL- The value of mpris:artUrl- Returns:
- This builder
-
setAlbumName
Sets xesam:album
The album name.- Parameters:
albumName- The value of xesam:album- Returns:
- This builder
-
setAlbumArtists
Sets xesam:albumArtist
The album artist(s).- Parameters:
albumArtists- The value of xesam:albumArtist- Returns:
- This builder
-
setArtists
Sets xesam:artist
The track artist(s).- Parameters:
artists- The value of xesam:artist- Returns:
- This builder
-
setAsText
Sets xesam:asText
The track lyrics.- Parameters:
text- The value of xesam:asText- Returns:
- This builder
-
setAudioBPM
Sets xesam:audioBPM
The speed of the music, in beats per minute.- Parameters:
bpm- The value of xesam:audioBPM- Returns:
- This builder
-
setAutoRating
Sets xesam:autoRating
An automatically-generated rating, based on things such as how often it has been played. This should be in the range 0.0 to 1.0.- Parameters:
autoRating- The value of xesam:autoRating- Returns:
- This builder
- Throws:
IllegalArgumentException
-
setComments
Sets xesam:comment
A (list of) freeform comment(s).- Parameters:
comments- The value of xesam:comment- Returns:
- This builder
-
setComposers
Sets xesam:composer
The composer(s) of the track.- Parameters:
composers- The value of xesam:composer- Returns:
- This builder
-
setContentCreated
Sets xesam:contentCreated
When the track was created. Usually only the year component will be useful.- Parameters:
date- The value of xesam:contentCreatedoffset- The time zone offset of the date- Returns:
- This builder
-
setDiscNumber
Sets xesam:discNumber
The disc number on the album that this track is from.- Parameters:
discNumber- The value of xesam:discNumber- Returns:
- This builder
-
setFirstUsed
Sets xesam:firstUsed
When the track was first played.- Parameters:
date- The value of xesam:firstUsedoffset- The time zone offset of the date- Returns:
- This builder
-
setGenres
Sets xesam:genre
The genre(s) of the track.- Parameters:
genres- The value of xesam:genre- Returns:
- This builder
-
setLastUsed
Sets xesam:lastUsed
When the track was last played.- Parameters:
date- The value of xesam:lastUsedoffset- The time zone offset of the date- Returns:
- This builder
-
setLyricists
Sets xesam:lyricist
The lyricist(s) of the track.- Parameters:
lyricists- The value of xesam:lyricist- Returns:
- This builder
-
setTitle
Sets xesam:title
The track title.- Parameters:
title- The value of xesam:title- Returns:
- This builder
-
setTrackNumber
Sets xesam:trackNumber
The track number on the album disc.- Parameters:
trackNumber- The value of xesam:trackNumber- Returns:
- This builder
-
setURL
Sets xesam:url
The location of the media file.- Parameters:
url- The value of xesam:url- Returns:
- This builder
-
setUseCount
Sets xesam:useCount
The number of times the track has been played.- Parameters:
useCount- The value of xesam:useCount- Returns:
- This builder
-
setUserRating
Sets xesam:userRating
A user-specified rating. This should be in the range 0.0 to 1.0.- Parameters:
userRating- The value of xesam:userRating- Returns:
- This builder
- Throws:
IllegalArgumentException
-
build
- Returns:
- The built metadata
- Throws:
IllegalArgumentException- If mpris:trackid was not set
-