Class User.Builder
java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject.Builder
se.michaelthelin.spotify.model_objects.specification.User.Builder
- All Implemented Interfaces:
IModelObject.Builder
- Enclosing class:
User
Builder class for building
User
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a model object with the information set in the builder object.setBirthdate
(String birthdate) Set the birthday of the user object to be built.setCountry
(com.neovisionaries.i18n.CountryCode country) Set the home country of the user object to be built.setDisplayName
(String displayName) Set the display name of the user to be built.Set the email address of the user to be built.setExternalUrls
(ExternalUrl externalUrls) Set external urls of the user to be built.setFollowers
(Followers followers) Set the followers object of the user to be built.Set href of Spotify api endpoint of the user to be built.Set user ID of the user to be built.Set the profile image of the user to be built.setProduct
(ProductType product) Set the product type of the user to be built.setType
(ModelObjectType type) Set the type of the model object.Set the Spotify URI of the user to be built.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setBirthdate
Set the birthday of the user object to be built.- Parameters:
birthdate
- The user's date-of-birth.- Returns:
- A
User.Builder
.
-
setCountry
Set the home country of the user object to be built.- Parameters:
country
- An ISO 3166-1 alpha-2 country code.- Returns:
- A
User.Builder
.
-
setDisplayName
Set the display name of the user to be built. If the user hasn't a display name, setnull
instead.- Parameters:
displayName
- The name displayed on the user's profile.null
if not available.- Returns:
- A
User.Builder
.
-
setEmail
Set the email address of the user to be built.- Parameters:
email
- The user's email address, as entered by the user when creating their account.- Returns:
- A
User.Builder
.
-
setExternalUrls
Set external urls of the user to be built.- Parameters:
externalUrls
- Known external URLs for this user.- Returns:
- A
User.Builder
.
-
setFollowers
Set the followers object of the user to be built.- Parameters:
followers
- Information about the followers of the user.- Returns:
- A
User.Builder
.
-
setHref
Set href of Spotify api endpoint of the user to be built.- Parameters:
href
- A link to the Spotify Web API endpoint for this user.- Returns:
- A
User.Builder
.
-
setId
Set user ID of the user to be built.- Parameters:
id
- The Spotify user ID for the user.- Returns:
- A
User.Builder
.
-
setImages
Set the profile image of the user to be built.- Parameters:
images
- The user's profile image.- Returns:
- A
User.Builder
.
-
setProduct
Set the product type of the user to be built.- Parameters:
product
- The user's Spotify subscription level: "premium", "free", etc.- Returns:
- A
User.Builder
.
-
setType
Set the type of the model object. In this case "user".- Parameters:
type
- The object type: "user"- Returns:
- A
User.Builder
.
-
setUri
Set the Spotify URI of the user to be built.- Parameters:
uri
- The Spotify URI for the user.- Returns:
- A
User.Builder
.
-
build
Description copied from interface:IModelObject.Builder
Build a model object with the information set in the builder object.
The type of the model object and its methods depend on its corresponding implementation.- Returns:
- A model object.
-