java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject
se.michaelthelin.spotify.model_objects.specification.User
All Implemented Interfaces:
Serializable, IModelObject

public class User extends AbstractModelObject
Retrieve information about User objects by building instances from this class.
Note: Many methods of this model object may return null, depending on the scopes specified in the authentication request.
See Also:
  • Method Details

    • getBirthdate

      public String getBirthdate()
      Get the users birthdate.
      Note: This field is only available when the current user has granted access to the user-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 the user-read-private scope.
      Returns:
      An ISO 3166-1 alpha-2 country code.
      See Also:
    • getDisplayName

      public String 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

      public String 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 the user-read-email scope.
      Returns:
      The user's email address, as entered by the user when creating their account.
      See Also:
    • getExternalUrls

      public ExternalUrl getExternalUrls()
      Get the external URLs of the user.
      Example: Spotify-URL.
      Returns:
      Known external URLs for this user.
    • getFollowers

      public Followers getFollowers()
      Get information about the followers of the user.
      Example: Follower count.
      Returns:
      Information about the followers of the user.
    • getHref

      public String getHref()
      Get the Spotify Web API endpoint URL of the user.
      Returns:
      A link to the Spotify Web API endpoint for this user.
    • getId

      public String getId()
      Get the Spotify ID of the user.
      Returns:
      The Spotify user ID for the user.
    • getImages

      public Image[] getImages()
      Get the profile image of the user in different sizes.
      Returns:
      The user's profile image.
    • getProduct

      public ProductType 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 the user-read-private scope.
      Returns:
      The user's Spotify subscription level: "premium", "free", etc.
      See Also:
    • getType

      public ModelObjectType getType()
      Get the model object type. In this case "user".
      Returns:
      The object type: "user"
    • getUri

      public String getUri()
      Get the Spotify URI of the user.
      Returns:
      The Spotify URI for the user.
    • toString

      public String 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 class AbstractModelObject
    • builder

      public User.Builder 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object