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 building
User instances.-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
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.
-
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, setnullinstead.- Parameters:
displayName- The name displayed on the user's profile.nullif 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.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.
-