Class User.Builder
- java.lang.Object
-
- com.wrapper.spotify.model_objects.AbstractModelObject.Builder
-
- com.wrapper.spotify.model_objects.specification.User.Builder
-
- All Implemented Interfaces:
IModelObject.Builder
- Enclosing class:
- User
public static final class User.Builder extends AbstractModelObject.Builder
Builder class for buildingUserinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Userbuild()Build a model object with the information set in the builder object.User.BuildersetBirthdate(String birthdate)Set the birthday of the user object to be built.User.BuildersetCountry(com.neovisionaries.i18n.CountryCode country)Set the home country of the user object to be built.User.BuildersetDisplayName(String displayName)Set the display name of the user to be built.User.BuildersetEmail(String email)Set the email address of the user to be built.User.BuildersetExternalUrls(ExternalUrl externalUrls)Set external urls of the user to be built.User.BuildersetFollowers(Followers followers)Set the followers object of the user to be built.User.BuildersetHref(String href)Set href of Spotify api endpoint of the user to be built.User.BuildersetId(String id)Set user ID of the user to be built.User.BuildersetImages(Image... images)Set the profile image of the user to be built.User.BuildersetProduct(ProductType product)Set the product type of the user to be built.User.BuildersetType(ModelObjectType type)Set the type of the model object.User.BuildersetUri(String uri)Set the Spotify URI of the user to be built.
-
-
-
Method Detail
-
setBirthdate
public User.Builder setBirthdate(String birthdate)
Set the birthday of the user object to be built.- Parameters:
birthdate- The user's date-of-birth.- Returns:
- A
User.Builder.
-
setCountry
public User.Builder setCountry(com.neovisionaries.i18n.CountryCode country)
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
public User.Builder setDisplayName(String displayName)
Set the display name of the user to be built. If the user hasn't a display name, setnullinstead.- Parameters:
displayName- The name displayed on the user's profile.nullif not available.- Returns:
- A
User.Builder.
-
setEmail
public User.Builder setEmail(String email)
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
public User.Builder setExternalUrls(ExternalUrl externalUrls)
Set external urls of the user to be built.- Parameters:
externalUrls- Known external URLs for this user.- Returns:
- A
User.Builder.
-
setFollowers
public User.Builder setFollowers(Followers followers)
Set the followers object of the user to be built.- Parameters:
followers- Information about the followers of the user.- Returns:
- A
User.Builder.
-
setHref
public User.Builder setHref(String href)
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
public User.Builder setId(String id)
Set user ID of the user to be built.- Parameters:
id- The Spotify user ID for the user.- Returns:
- A
User.Builder.
-
setImages
public User.Builder setImages(Image... images)
Set the profile image of the user to be built.- Parameters:
images- The user's profile image.- Returns:
- A
User.Builder.
-
setProduct
public User.Builder setProduct(ProductType product)
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
public User.Builder setType(ModelObjectType type)
Set the type of the model object. In this case "user".- Parameters:
type- The object type: "user"- Returns:
- A
User.Builder.
-
setUri
public User.Builder setUri(String uri)
Set the Spotify URI of the user to be built.- Parameters:
uri- The Spotify URI for the user.- Returns:
- A
User.Builder.
-
build
public User build()
Description copied from interface:IModelObject.BuilderBuild 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.
-
-