Class User
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject
se.michaelthelin.spotify.model_objects.specification.User
- All Implemented Interfaces:
Serializable
,IModelObject
Retrieve information about
User objects by building instances from this class.
Note: Many methods of this model object may return
Note: Many methods of this model object may return
null
, depending on the scopes specified in the
authentication request.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class for buildingUser
instances.static final class
JsonUtil class for buildingUser
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
Get the users birthdate.com.neovisionaries.i18n.CountryCode
Get the country code of the users set home country.Get the users display name if available.getEmail()
Get the users email address.Get the external URLs of the user.Get information about the followers of the user.getHref()
Get the Spotify Web API endpoint URL of the user.getId()
Get the Spotify ID of the user.Image[]
Get the profile image of the user in different sizes.Get the product type of the users account.getType()
Get the model object type.getUri()
Get the Spotify URI of the user.int
hashCode()
toString()
Returns a String representation of this model object in the style:
-
Method Details
-
getBirthdate
Get the users birthdate.
Note: This field is only available when the current user has granted access to theuser-read-birthdate
scope.- Returns:
- The user's date-of-birth.
- See Also:
-
getCountry
public com.neovisionaries.i18n.CountryCode getCountry()Get the country code of the users set home country.
Note: This field is only available when the current user has granted access to theuser-read-private
scope.- Returns:
- An ISO 3166-1 alpha-2 country code.
- See Also:
-
getDisplayName
Get the users display name if available.
If the display name is not available,null
will be returned.- Returns:
- The name displayed on the user's profile.
null
if not available.
-
getEmail
Get the users email address.
Important! This email address is unverified; there is no proof that it actually belongs to the user.
Note: This field is only available when the current user has granted access to theuser-read-email
scope.- Returns:
- The user's email address, as entered by the user when creating their account.
- See Also:
-
getExternalUrls
Get the external URLs of the user.
Example: Spotify-URL.- Returns:
- Known external URLs for this user.
-
getFollowers
Get information about the followers of the user.
Example: Follower count.- Returns:
- Information about the followers of the user.
-
getHref
Get the Spotify Web API endpoint URL of the user.- Returns:
- A link to the Spotify Web API endpoint for this user.
-
getId
Get the Spotify ID of the user.- Returns:
- The Spotify user ID for the user.
-
getImages
Get the profile image of the user in different sizes.- Returns:
- The user's profile image.
-
getProduct
Get the product type of the users account.
Product type refers to premium account, free account, etc.
Note: This field is only available when the current user has granted access to theuser-read-private
scope.- Returns:
- The user's Spotify subscription level: "premium", "free", etc.
- See Also:
-
getType
Get the model object type. In this case "user".- Returns:
- The object type: "user"
-
getUri
Get the Spotify URI of the user.- Returns:
- The Spotify URI for the user.
-
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()
-