public class UserProfileBuilder extends Object
UserProfile
instance returned by ApiAdapter.fetchUserProfile(Object)
Makes it easy to construct a profile instance where some of the individual fields may be null.
Also allows new profile fields to be introduced in the future without breaking compatibility with existing ApiAdapter
implementations.UserProfile
Constructor and Description |
---|
UserProfileBuilder() |
Modifier and Type | Method and Description |
---|---|
UserProfile |
build()
Builds the user profile.
|
UserProfileBuilder |
setEmail(String email)
Sets the profile email field.
|
UserProfileBuilder |
setFirstName(String firstName)
Sets the profile firstName field.
|
UserProfileBuilder |
setLastName(String lastName)
Sets the profile lastName field.
|
UserProfileBuilder |
setName(String name)
Sets the profile name field.
|
UserProfileBuilder |
setUsername(String username)
Sets the profile username field.
|
public UserProfileBuilder setName(String name)
name
- the user's nameUserProfileBuilder
for setting more propertiespublic UserProfileBuilder setFirstName(String firstName)
firstName
- the user's first nameUserProfileBuilder
for setting more propertiespublic UserProfileBuilder setLastName(String lastName)
lastName
- the user's last nameUserProfileBuilder
for setting more propertiespublic UserProfileBuilder setEmail(String email)
email
- the user's email addressUserProfileBuilder
for setting more propertiespublic UserProfileBuilder setUsername(String username)
username
- the user's usernameUserProfileBuilder
for setting more propertiespublic UserProfile build()
UserProfile