Package com.spotify.github.v3
Class ImmutableUser.Builder
- java.lang.Object
-
- com.spotify.github.v3.ImmutableUser.Builder
-
- Enclosing class:
- ImmutableUser
@NotThreadSafe public static final class ImmutableUser.Builder extends Object
Builds instances of typeImmutableUser. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableUser.BuilderavatarUrl(URI avatarUrl)Initializes the value for theavatarUrlattribute.ImmutableUserbuild()Builds a newImmutableUser.ImmutableUser.BuildereventsUrl(String eventsUrl)Initializes the value for theeventsUrlattribute.ImmutableUser.BuilderfollowersUrl(URI followersUrl)Initializes the value for thefollowersUrlattribute.ImmutableUser.BuilderfollowingUrl(String followingUrl)Initializes the value for thefollowingUrlattribute.ImmutableUser.Builderfrom(User instance)Fill a builder with attribute values from the providedUserinstance.ImmutableUser.BuildergistsUrl(String gistsUrl)Initializes the value for thegistsUrlattribute.ImmutableUser.BuildergravatarId(String gravatarId)Initializes the optional valuegravatarIdto gravatarId.ImmutableUser.BuildergravatarId(Optional<String> gravatarId)Initializes the optional valuegravatarIdto gravatarId.ImmutableUser.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutableUser.Builderid(Integer id)Initializes the value for theidattribute.ImmutableUser.Builderlogin(String login)Initializes the value for theloginattribute.ImmutableUser.BuilderorganizationsUrl(URI organizationsUrl)Initializes the value for theorganizationsUrlattribute.ImmutableUser.BuilderreceivedEventsUrl(URI receivedEventsUrl)Initializes the value for thereceivedEventsUrlattribute.ImmutableUser.BuilderreposUrl(URI reposUrl)Initializes the value for thereposUrlattribute.ImmutableUser.BuildersiteAdmin(boolean siteAdmin)Initializes the optional valuesiteAdminto siteAdmin.ImmutableUser.BuildersiteAdmin(Optional<Boolean> siteAdmin)Initializes the optional valuesiteAdminto siteAdmin.ImmutableUser.BuilderstarredUrl(String starredUrl)Initializes the value for thestarredUrlattribute.ImmutableUser.BuildersubscriptionsUrl(URI subscriptionsUrl)Initializes the value for thesubscriptionsUrlattribute.ImmutableUser.Buildertype(String type)Initializes the value for thetypeattribute.ImmutableUser.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableUser.Builder from(User instance)
Fill a builder with attribute values from the providedUserinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
login
@CanIgnoreReturnValue public final ImmutableUser.Builder login(@Nullable String login)
Initializes the value for theloginattribute.- Parameters:
login- The value for login (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableUser.Builder id(@Nullable Integer id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
avatarUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder avatarUrl(@Nullable URI avatarUrl)
Initializes the value for theavatarUrlattribute.- Parameters:
avatarUrl- The value for avatarUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
gravatarId
@CanIgnoreReturnValue public final ImmutableUser.Builder gravatarId(String gravatarId)
Initializes the optional valuegravatarIdto gravatarId.- Parameters:
gravatarId- The value for gravatarId- Returns:
thisbuilder for chained invocation
-
gravatarId
@CanIgnoreReturnValue public final ImmutableUser.Builder gravatarId(Optional<String> gravatarId)
Initializes the optional valuegravatarIdto gravatarId.- Parameters:
gravatarId- The value for gravatarId- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableUser.Builder url(@Nullable URI url)
Initializes the value for theurlattribute.- Parameters:
url- The value for url (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrlattribute.- Parameters:
htmlUrl- The value for htmlUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
followersUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder followersUrl(@Nullable URI followersUrl)
Initializes the value for thefollowersUrlattribute.- Parameters:
followersUrl- The value for followersUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
followingUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder followingUrl(@Nullable String followingUrl)
Initializes the value for thefollowingUrlattribute.- Parameters:
followingUrl- The value for followingUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
gistsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder gistsUrl(@Nullable String gistsUrl)
Initializes the value for thegistsUrlattribute.- Parameters:
gistsUrl- The value for gistsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
starredUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder starredUrl(@Nullable String starredUrl)
Initializes the value for thestarredUrlattribute.- Parameters:
starredUrl- The value for starredUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
subscriptionsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder subscriptionsUrl(@Nullable URI subscriptionsUrl)
Initializes the value for thesubscriptionsUrlattribute.- Parameters:
subscriptionsUrl- The value for subscriptionsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
organizationsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder organizationsUrl(@Nullable URI organizationsUrl)
Initializes the value for theorganizationsUrlattribute.- Parameters:
organizationsUrl- The value for organizationsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
reposUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder reposUrl(@Nullable URI reposUrl)
Initializes the value for thereposUrlattribute.- Parameters:
reposUrl- The value for reposUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
eventsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder eventsUrl(@Nullable String eventsUrl)
Initializes the value for theeventsUrlattribute.- Parameters:
eventsUrl- The value for eventsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
receivedEventsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder receivedEventsUrl(@Nullable URI receivedEventsUrl)
Initializes the value for thereceivedEventsUrlattribute.- Parameters:
receivedEventsUrl- The value for receivedEventsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
type
@CanIgnoreReturnValue public final ImmutableUser.Builder type(@Nullable String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
siteAdmin
@CanIgnoreReturnValue public final ImmutableUser.Builder siteAdmin(boolean siteAdmin)
Initializes the optional valuesiteAdminto siteAdmin.- Parameters:
siteAdmin- The value for siteAdmin- Returns:
thisbuilder for chained invocation
-
siteAdmin
@CanIgnoreReturnValue public final ImmutableUser.Builder siteAdmin(Optional<Boolean> siteAdmin)
Initializes the optional valuesiteAdminto siteAdmin.- Parameters:
siteAdmin- The value for siteAdmin- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableUser build()
Builds a newImmutableUser.- Returns:
- An immutable instance of User
- Throws:
IllegalStateException- if any required attributes are missing
-
-