Class Track
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject
se.michaelthelin.spotify.model_objects.specification.Track
- All Implemented Interfaces:
- Serializable,- IModelObject,- IPlaylistItem,- IArtistTrackModelObject,- ISearchModelObject
public class Track
extends AbstractModelObject
implements IArtistTrackModelObject, ISearchModelObject, IPlaylistItem
Retrieve information about 
 Track objects by building instances from this class.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for buildingTrackinstances.static final classJsonUtil class for buildingTrackinstances.Nested classes/interfaces inherited from interface se.michaelthelin.spotify.model_objects.IModelObjectIModelObject.IJsonUtil<T>
- 
Method SummaryModifier and TypeMethodDescriptionbuilder()Create a builder for building an instance of a model object.booleangetAlbum()Get the album on which the track appears.Get the artists who performed the track.com.neovisionaries.i18n.CountryCode[]Get the country codes of all countries, in which the track is available.Get the disc number of the track in its album.Get the duration of the track in milliseconds.Get the external IDs of the track.
 Example: isrc -> "International Standard Recording Code".Get the external URLs of the track.
 Example: Spotify-URL.getHref()Get the full Spotify Web API endpoint URL of the track.getId()Get the Spotify ID of the track.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 the track link object of the track if Track Relinking was applied and the requested track has been replaced with a different track.getName()Get the name of the track.Get the popularity of the track.Get a link to a 30 second preview (MP3 format) of the track.Get the restrictions of the track.Get the track number of the track.getType()Get the model object type, which should be a "track" in this case.getUri()Get the Spotify track URI.inthashCode()toString()Returns a String representation of this model object in the style:
- 
Method Details- 
getAlbumGet the album on which the track appears.- Returns:
- The album on which the track appears. The (simplified) album object includes a link in href to full information about the album.
 
- 
getArtistsGet 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.
 
- 
getAvailableMarketspublic com.neovisionaries.i18n.CountryCode[] getAvailableMarkets()Get the country codes of all countries, in which the track is available.- Returns:
- A list of the countries in which the track can be played, identified by their ISO 3166-1 alpha-2 code.
 
- 
getDiscNumberGet the disc number of the track in its album.- Returns:
- The disc number (usually 1 unless the album consists of more than one disc).
 
- 
getDurationMsGet the duration of the track in milliseconds.- Specified by:
- getDurationMsin interface- IPlaylistItem
- Returns:
- The track length in milliseconds.
 
- 
getIsExplicitCheck 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).
 
- 
getExternalIdsGet the external IDs of the track.
 Example: isrc -> "International Standard Recording Code".- Returns:
- Known external IDs for the track.
 
- 
getExternalUrlsGet the external URLs of the track.
 Example: Spotify-URL.- Specified by:
- getExternalUrlsin interface- IPlaylistItem
- Returns:
- Known external URLs for this track.
 
- 
getHrefGet the full Spotify Web API endpoint URL of the track.- Specified by:
- getHrefin interface- IPlaylistItem
- Returns:
- A link to the Web API endpoint providing full details of the track.
 
- 
getIdGet the Spotify ID of the track.- Specified by:
- getIdin interface- IPlaylistItem
- Returns:
- The Spotify ID for the track.
 
- 
getIsPlayableCheck 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.
 
- 
getLinkedFromGet the track link object of the track if Track Relinking was applied and the requested track has been replaced with a different track. The track in thelinked_fromobject contains information about the originally requested track.- Returns:
- The track in the linked_fromobject contains information about the originally requested track.
 
- 
getRestrictionsGet the restrictions of the track. Part of the response when Track Relinking is applied, the original track is not available in the given market, and Spotify did not have any tracks to relink it with. The track response will still contain metadata for the original track, and a restrictions object containing the reason why the track is not available.
 Example:"restrictions" : {"reason" : "market"}- Returns:
- The track response will still contain metadata for the original track, and a restrictions object containing the reason why the track is not available.
 
- 
getNameGet the name of the track.- Specified by:
- getNamein interface- IPlaylistItem
- Returns:
- Track name.
 
- 
getPopularityGet the popularity of the track. The value will be between 0 and 100, with 100 being the most popular.
 The popularity of a track is a value between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are. 
 Generally speaking, songs that are being played a lot now will have a higher popularity than songs that were played a lot in the past. Duplicate tracks (e.g. the same track from a single and an album) are rated independently. Artist and album popularity is derived mathematically from track popularity. Note that the popularity value may lag actual popularity by a few days: the value is not updated in real time. - Returns:
- The popularity of the track. The value will be between 0 and 100, with 100 being the most popular.
 
- 
getPreviewUrlGet 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.
 
- 
getTrackNumberGet 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.
 
- 
getTypeGet the model object type, which should be a "track" in this case.- Specified by:
- getTypein interface- IPlaylistItem
- Returns:
- The object type: "track".
 
- 
getUriGet the Spotify track URI.- Specified by:
- getUriin interface- IPlaylistItem
- Returns:
- The Spotify URI for the track.
 
- 
toStringDescription copied from class:AbstractModelObjectReturns a String representation of this model object in the style:ModelObject(attr1=value1, attr2=value2, ...)- Specified by:
- toStringin class- AbstractModelObject
 
- 
builderDescription copied from interface:IModelObjectCreate a builder for building an instance of a model object.
 The type of the builder and its methods depend on its corresponding implementation.- Specified by:
- builderin interface- IModelObject
- Returns:
- A builder object.
 
- 
equals
- 
hashCodepublic int hashCode()
 
-