Class User

    • Method Detail

      • 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:
        Spotify: Using Scopes
      • 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:
        Spotify: Using Scopes
      • 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:
        Spotify: Using Scopes
      • 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:
        Spotify: Using Scopes
      • 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.
      • 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.