Class CurrentlyPlayingContext
- java.lang.Object
-
- se.michaelthelin.spotify.model_objects.AbstractModelObject
-
- se.michaelthelin.spotify.model_objects.miscellaneous.CurrentlyPlayingContext
-
- All Implemented Interfaces:
Serializable,IModelObject
public class CurrentlyPlayingContext extends AbstractModelObject
Retrieve information about Currently Playing Context objects by creating instances from this class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCurrentlyPlayingContext.BuilderBuilder class for buildingCurrentlyPlayingContextinstances.static classCurrentlyPlayingContext.JsonUtilJsonUtil class for buildingCurrentlyPlayingContextinstances.-
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 CurrentlyPlayingContext.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 from where the currently playing item is played from.CurrentlyPlayingTypegetCurrentlyPlayingType()Get the type of the currently playing item.DevicegetDevice()Get the currently active device.BooleangetIs_playing()Check whether a track or episode is playing on the device or not.IPlaylistItemgetItem()Get the currently playing track or episode, if the device is playing something.IntegergetProgress_ms()Get the progress of the currently playing item.StringgetRepeat_state()Get the repeat state of the device.BooleangetShuffle_state()Get the shuffle state of the device.LonggetTimestamp()Get the Unix timestamp in milliseconds when the time was fetched.StringtoString()Returns a String representation of this model object in the style:
-
-
-
Method Detail
-
getDevice
public Device getDevice()
Get the currently active device.- Returns:
- The device that is currently active.
-
getRepeat_state
public String getRepeat_state()
Get the repeat state of the device. (No repeat, track repeat, context repeat)- Returns:
- The repeat state.
-
getShuffle_state
public Boolean getShuffle_state()
Get the shuffle state of the device.- Returns:
- If shuffle is on or off.
-
getContext
public Context getContext()
Get the context from where the currently playing item is played from.- Returns:
- A Context Object. Can be
null.
-
getTimestamp
public Long getTimestamp()
Get the Unix timestamp in milliseconds when the time was fetched.- Returns:
- Unix Millisecond Timestamp when data was fetched.
-
getProgress_ms
public Integer getProgress_ms()
Get the progress of the currently playing item.- Returns:
- Progress into the currently playing item. Can be
null.
-
getIs_playing
public Boolean getIs_playing()
Check whether a track or episode is playing on the device or not.- Returns:
- If something is currently playing.
-
getItem
public IPlaylistItem getItem()
Get the currently playing track or episode, if the device is playing something.- Returns:
- The currently playing item. 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 CurrentlyPlayingContext.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.
-
-