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>Modifier and TypeInterfaceDescriptionstatic interfaceInterface with methods used in builder classes of model objects.static interfaceInterface with methods used in JsonUtil classes of model objects. -
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
builderModifier and TypeMethodDescriptionbuilder()Create a builder for building an instance of a model object.Methods inherited from interface IPlaylistItem
getDurationMs, getExternalUrls, getHref, getId, getName, getType, getUriModifier and TypeMethodDescriptionGet the duration of this playlist item in milliseconds.Get the external URLs of the playlist item.
Example: Spotify-URL.getHref()Get the full Spotify Web API endpoint URL of the playlist item.getId()Get the Spotify ID of the playlist item.getName()Get the name of the playlist item.getType()Get the type of the IPlaylistItem.getUri()Get the Spotify playlist item URI.
-
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.
-