Class CurrentlyPlayingContext
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject
se.michaelthelin.spotify.model_objects.miscellaneous.CurrentlyPlayingContext
- All Implemented Interfaces:
Serializable
,IModelObject
Retrieve information about
Currently Playing
Context objects by creating instances from this class.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class for buildingCurrentlyPlayingContext
instances.static final class
JsonUtil class for buildingCurrentlyPlayingContext
instances.Nested classes/interfaces inherited from interface se.michaelthelin.spotify.model_objects.IModelObject
IModelObject.IJsonUtil<T>
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder for building an instance of a model object.Get which playback actions are available within the current context.Get the context from where the currently playing item is played from.Get the type of the currently playing item.Get the currently active device.Check whether a track or episode is playing on the device or not.getItem()
Get the currently playing track or episode, if the device is playing something.Get the progress of the currently playing item.Get the repeat state of the device.Get the shuffle state of the device.Get the Unix timestamp in milliseconds when the time was fetched.toString()
Returns a String representation of this model object in the style:
-
Method Details
-
getDevice
Get the currently active device.- Returns:
- The device that is currently active.
-
getRepeat_state
Get the repeat state of the device. (No repeat, track repeat, context repeat)- Returns:
- The repeat state.
-
getShuffle_state
Get the shuffle state of the device.- Returns:
- If shuffle is on or off.
-
getContext
Get the context from where the currently playing item is played from.- Returns:
- A Context Object. Can be
null
.
-
getTimestamp
Get the Unix timestamp in milliseconds when the time was fetched.- Returns:
- Unix Millisecond Timestamp when data was fetched.
-
getProgress_ms
Get the progress of the currently playing item.- Returns:
- Progress into the currently playing item. Can be
null
.
-
getIs_playing
Check whether a track or episode is playing on the device or not.- Returns:
- If something is currently playing.
-
getItem
Get the currently playing track or episode, if the device is playing something.- Returns:
- The currently playing item. Can be
null
.
-
getCurrentlyPlayingType
Get the type of the currently playing item.- Returns:
- The type of the currently playing item.
-
getActions
Get which playback actions are available within the current context. -
toString
Description copied from class:AbstractModelObject
Returns a String representation of this model object in the style:ModelObject(attr1=value1, attr2=value2, ...)
- Specified by:
toString
in classAbstractModelObject
-
builder
Description copied from interface:IModelObject
Create 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.
-