Interface ITrack
- All Superinterfaces:
IModelObject, IPlaylistItem, Serializable
- All Known Implementing Classes:
Track, TrackSimplified
Represents the common properties of Spotify Track objects (full and simplified).
This interface extends IPlaylistItem and provides a common base for
Track and
TrackSimplified
objects.
-
Nested Class Summary
Nested classes/interfaces inherited from interface IModelObject
IModelObject.Builder, IModelObject.IJsonUtil<T> -
Method Summary
Modifier and TypeMethodDescriptionGet the artists who performed the track.Get the disc number of the track in its album.Check whether the track is explicit or not.Check whether the track is playable in the market, which may has been specified somewhere before requesting it.Get a link to a 30 second preview (MP3 format) of the track.Get the track number of the track.Methods inherited from interface IModelObject
builderMethods inherited from interface IPlaylistItem
getDurationMs, getExternalUrls, getHref, getId, getName, getType, getUri
-
Method Details
-
getArtists
ArtistSimplified[] getArtists()Get the artists who performed the track.- Returns:
- The artists who performed the track. Each artist object includes a link in
hrefto more detailed information about the artist.
-
getDiscNumber
Integer getDiscNumber()Get the disc number of the track in its album.- Returns:
- The disc number (usually 1 unless the album consists of more than one disc).
-
getExplicit
Boolean getExplicit()Check whether the track is explicit or not.- Returns:
- Whether or not the track has explicit lyrics (
true= yes it does;false= no it does not OR unknown).
-
getIsPlayable
Boolean getIsPlayable()Check whether the track is playable in the market, which may has been specified somewhere before requesting it. Part of the response when Track Relinking is applied.- Returns:
- If
true, the track is playable in the given market. Otherwisefalse.
-
getPreviewUrl
String getPreviewUrl()Get a link to a 30 second preview (MP3 format) of the track.nullif not available.- Returns:
- A link to a 30 second preview (MP3 format) of the track.
nullif not available.
-
getTrackNumber
Integer getTrackNumber()Get the track number of the track. If an album has several discs, the track number is the number on the specified disc.- Returns:
- The number of the track.
-