Class Device
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject
se.michaelthelin.spotify.model_objects.miscellaneous.Device
- All Implemented Interfaces:
Serializable
,IModelObject
Retrieve information about Device
objects by creating instances from this class.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class for buildingDevice
instances.static final class
JsonUtil class for buildingDevice
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.boolean
getId()
Get the ID of the device.Check whether the device is the currently active device.Get whether the device is in a private session.Check whether the device is restricted or not.getName()
Get the name of the device.Check whether the device can be used to set the volume.getType()
Get the type of the device.Get the current volume of the device in percent.int
hashCode()
toString()
Returns a String representation of this model object in the style:
-
Method Details
-
getId
Get the ID of the device.- Returns:
- The device ID. This may be
null
.
-
getIs_active
Check whether the device is the currently active device.- Returns:
- If this device is the currently active device.
-
getIs_private_session
Get whether the device is in a private session. Access to playback info is limited on clients in a private session.- Returns:
- Whether the user has put the client into a private session.
-
getIs_restricted
Check whether the device is restricted or not. Restricted devices don't accept Spotify Web API calls.- Returns:
- Whether controlling this device is restricted.
-
getName
Get the name of the device.- Returns:
- The name of the device.
-
getSupports_volume
Check whether the device can be used to set the volume.- Returns:
- If this device can be used to set the volume.
-
getType
Get the type of the device.- Returns:
- Device type, such as "Computer", "Smartphone" or "Speaker".
-
getVolume_percent
Get the current volume of the device in percent.- Returns:
- The current volume in percent. This may be
null
.
-
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.
-
equals
-
hashCode
public int hashCode()
-