Class TrackSimplified
- java.lang.Object
-
- com.wrapper.spotify.model_objects.AbstractModelObject
-
- com.wrapper.spotify.model_objects.specification.TrackSimplified
-
- All Implemented Interfaces:
IModelObject
public class TrackSimplified extends AbstractModelObject
Retrieve information about simplified Track objects by building instances from this class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTrackSimplified.BuilderBuilder class for buildingTrackSimplifiedinstances.static classTrackSimplified.JsonUtilJsonUtil class for buildingTrackSimplifiedinstances.-
Nested classes/interfaces inherited from interface com.wrapper.spotify.model_objects.IModelObject
IModelObject.IJsonUtil<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrackSimplified.Builderbuilder()Create a builder for building an instance of a model object.ArtistSimplified[]getArtists()Get the artists who performed the track.com.neovisionaries.i18n.CountryCode[]getAvailableMarkets()Get the country codes of all countries, in which the track is available.IntegergetDiscNumber()Get the disc number of the track in its album.IntegergetDurationMs()Get the duration of the track in milliseconds.ExternalUrlgetExternalUrls()Get the external URLs of the track.
Example: Spotify-URL.StringgetHref()Get the full Spotify Web API endpoint URL of the track.StringgetId()Get the Spotify ID of the track.BooleangetIsExplicit()Check whether the track is explicit or not.BooleangetIsPlayable()Check whether the track is playable in the market, which may has been specified somewhere before requesting it.TrackLinkgetLinkedFrom()Get the track link object of the track if Track Relinking was applied and the requested track has been replaced with a different track.StringgetName()Get the name of a track.StringgetPreviewUrl()Get a link to a 30 second preview (MP3 format) of the track.IntegergetTrackNumber()Get the track number of the track.ModelObjectTypegetType()Get the model object type, which should be a "track" in this case.StringgetUri()Get the Spotify track URI.
-
-
-
Method Detail
-
getArtists
public 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.
-
getAvailableMarkets
public 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.
-
getDiscNumber
public 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).
-
getDurationMs
public Integer getDurationMs()
Get the duration of the track in milliseconds.- Returns:
- The track length in milliseconds.
-
getIsExplicit
public Boolean getIsExplicit()
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).
-
getExternalUrls
public ExternalUrl getExternalUrls()
Get the external URLs of the track.
Example: Spotify-URL.- Returns:
- Known external URLs for this track.
-
getHref
public String getHref()
Get the full Spotify Web API endpoint URL of the track.- Returns:
- A link to the Web API endpoint providing full details of the track.
-
getId
public String getId()
Get the Spotify ID of the track.- Returns:
- The Spotify ID for the track.
-
getIsPlayable
public 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.
-
getLinkedFrom
public TrackLink getLinkedFrom()
Get 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.
-
getName
public String getName()
Get the name of a track.- Returns:
- Track name.
-
getPreviewUrl
public 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
public 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.
-
getType
public ModelObjectType getType()
Get the model object type, which should be a "track" in this case.- Returns:
- The object type: "track".
-
getUri
public String getUri()
Get the Spotify track URI.- Returns:
- The Spotify URI for the track.
-
builder
public TrackSimplified.Builder builder()
Description 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.- Returns:
- A builder object.
-
-