Class CurrentlyPlaying
- java.lang.Object
-
- se.michaelthelin.spotify.model_objects.AbstractModelObject
-
- se.michaelthelin.spotify.model_objects.miscellaneous.CurrentlyPlaying
-
- All Implemented Interfaces:
Serializable,IModelObject
public class CurrentlyPlaying extends AbstractModelObject
Retrieve information about Currently Playing objects by creating instances from this class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCurrentlyPlaying.BuilderBuilder class for buildingCurrentlyPlayinginstances.static classCurrentlyPlaying.JsonUtilJsonUtil class for buildingCurrentlyPlayinginstances.-
Nested classes/interfaces inherited from interface se.michaelthelin.spotify.model_objects.IModelObject
IModelObject.IJsonUtil<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CurrentlyPlaying.Builderbuilder()Create a builder for building an instance of a model object.ActionsgetActions()Get which playback actions are available within the current context.ContextgetContext()Get the context the item was played from.CurrentlyPlayingTypegetCurrentlyPlayingType()Get the type of the currently playing item.BooleangetIs_playing()Check if something is played at the moment.IPlaylistItemgetItem()Get the currently played track or episode.IntegergetProgress_ms()Get the progress of the current played item.LonggetTimestamp()Get the timestamp when the received data was fetched.StringtoString()Returns a String representation of this model object in the style:
-
-
-
Method Detail
-
getContext
public Context getContext()
Get the context the item was played from.- Returns:
- The context the item was played from. Can be
null.
-
getTimestamp
public Long getTimestamp()
Get the timestamp when the received data was fetched.- Returns:
- Unix Millisecond Timestamp when data was fetched.
-
getProgress_ms
public Integer getProgress_ms()
Get the progress of the current played item.- Returns:
- Progress into the currently playing item. Can be
null.
-
getIs_playing
public Boolean getIs_playing()
Check if something is played at the moment.- Returns:
- If something is currently playing.
-
getItem
public IPlaylistItem getItem()
Get the currently played track or episode.- Returns:
- The currently playing track or episode. Can be
null.
-
getCurrentlyPlayingType
public CurrentlyPlayingType getCurrentlyPlayingType()
Get the type of the currently playing item.- Returns:
- The type of the currently playing item.
-
getActions
public Actions getActions()
Get which playback actions are available within the current context.
-
toString
public String toString()
Description copied from class:AbstractModelObjectReturns a String representation of this model object in the style:ModelObject(attr1=value1, attr2=value2, ...)- Specified by:
toStringin classAbstractModelObject
-
builder
public CurrentlyPlaying.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.
-
-