Class CurrentlyPlaying
- java.lang.Object
-
- com.wrapper.spotify.model_objects.AbstractModelObject
-
- com.wrapper.spotify.model_objects.miscellaneous.CurrentlyPlaying
-
- All Implemented Interfaces:
IModelObject
public class CurrentlyPlaying extends AbstractModelObject
Retrieve information about Currently Playing objects by creating instances from this class.
-
-
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 com.wrapper.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.booleanequals(Object obj)Helper method to compare twoCurrentlyPlayingobjects.ContextgetContext()Get the context the track was played from.BooleangetIs_playing()Check if something is played at the moment.TrackgetItem()Get the currently played track.IntegergetProgress_ms()Get the progress of the current played track.LonggetTimestamp()Get the timestamp when the recieved data was fetched.
-
-
-
Method Detail
-
getContext
public Context getContext()
Get the context the track was played from.- Returns:
- The context the track was played from. Can be
null.
-
getTimestamp
public Long getTimestamp()
Get the timestamp when the recieved data was fetched.- Returns:
- Unix Millisecond Timestamp when data was fetched.
-
getProgress_ms
public Integer getProgress_ms()
Get the progress of the current played track.- Returns:
- Progress into the currently playing track. 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 Track getItem()
Get the currently played track.- Returns:
- The currently playing track. Can be
null.
-
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.
-
equals
public boolean equals(Object obj)
Helper method to compare twoCurrentlyPlayingobjects. Both objects only have to contain the same track URI to be equal. (eg. the same track object)- Overrides:
equalsin classObject- Parameters:
obj- AnotherCurrentlyPlayingobject.- Returns:
- Whether the objects are equal or not.
-
-