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.Builder
is 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.Builder
avatarUrl(URI avatarUrl)
Initializes the value for theavatarUrl
attribute.ImmutableUser
build()
Builds a newImmutableUser
.ImmutableUser.Builder
eventsUrl(String eventsUrl)
Initializes the value for theeventsUrl
attribute.ImmutableUser.Builder
followersUrl(URI followersUrl)
Initializes the value for thefollowersUrl
attribute.ImmutableUser.Builder
followingUrl(String followingUrl)
Initializes the value for thefollowingUrl
attribute.ImmutableUser.Builder
from(User instance)
Fill a builder with attribute values from the providedUser
instance.ImmutableUser.Builder
gistsUrl(String gistsUrl)
Initializes the value for thegistsUrl
attribute.ImmutableUser.Builder
gravatarId(String gravatarId)
Initializes the optional valuegravatarId
to gravatarId.ImmutableUser.Builder
gravatarId(Optional<String> gravatarId)
Initializes the optional valuegravatarId
to gravatarId.ImmutableUser.Builder
htmlUrl(URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.ImmutableUser.Builder
id(Integer id)
Initializes the value for theid
attribute.ImmutableUser.Builder
login(String login)
Initializes the value for thelogin
attribute.ImmutableUser.Builder
organizationsUrl(URI organizationsUrl)
Initializes the value for theorganizationsUrl
attribute.ImmutableUser.Builder
receivedEventsUrl(URI receivedEventsUrl)
Initializes the value for thereceivedEventsUrl
attribute.ImmutableUser.Builder
reposUrl(URI reposUrl)
Initializes the value for thereposUrl
attribute.ImmutableUser.Builder
siteAdmin(boolean siteAdmin)
Initializes the optional valuesiteAdmin
to siteAdmin.ImmutableUser.Builder
siteAdmin(Optional<Boolean> siteAdmin)
Initializes the optional valuesiteAdmin
to siteAdmin.ImmutableUser.Builder
starredUrl(String starredUrl)
Initializes the value for thestarredUrl
attribute.ImmutableUser.Builder
subscriptionsUrl(URI subscriptionsUrl)
Initializes the value for thesubscriptionsUrl
attribute.ImmutableUser.Builder
type(String type)
Initializes the value for thetype
attribute.ImmutableUser.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableUser.Builder from(User instance)
Fill a builder with attribute values from the providedUser
instance. 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:
this
builder for use in a chained invocation
-
login
@CanIgnoreReturnValue public final ImmutableUser.Builder login(@Nullable String login)
Initializes the value for thelogin
attribute.- Parameters:
login
- The value for login (can benull
)- Returns:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableUser.Builder id(@Nullable Integer id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
avatarUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder avatarUrl(@Nullable URI avatarUrl)
Initializes the value for theavatarUrl
attribute.- Parameters:
avatarUrl
- The value for avatarUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
gravatarId
@CanIgnoreReturnValue public final ImmutableUser.Builder gravatarId(String gravatarId)
Initializes the optional valuegravatarId
to gravatarId.- Parameters:
gravatarId
- The value for gravatarId- Returns:
this
builder for chained invocation
-
gravatarId
@CanIgnoreReturnValue public final ImmutableUser.Builder gravatarId(Optional<String> gravatarId)
Initializes the optional valuegravatarId
to gravatarId.- Parameters:
gravatarId
- The value for gravatarId- Returns:
this
builder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableUser.Builder url(@Nullable URI url)
Initializes the value for theurl
attribute.- Parameters:
url
- The value for url (can benull
)- Returns:
this
builder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.- Parameters:
htmlUrl
- The value for htmlUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
followersUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder followersUrl(@Nullable URI followersUrl)
Initializes the value for thefollowersUrl
attribute.- Parameters:
followersUrl
- The value for followersUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
followingUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder followingUrl(@Nullable String followingUrl)
Initializes the value for thefollowingUrl
attribute.- Parameters:
followingUrl
- The value for followingUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
gistsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder gistsUrl(@Nullable String gistsUrl)
Initializes the value for thegistsUrl
attribute.- Parameters:
gistsUrl
- The value for gistsUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
starredUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder starredUrl(@Nullable String starredUrl)
Initializes the value for thestarredUrl
attribute.- Parameters:
starredUrl
- The value for starredUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
subscriptionsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder subscriptionsUrl(@Nullable URI subscriptionsUrl)
Initializes the value for thesubscriptionsUrl
attribute.- Parameters:
subscriptionsUrl
- The value for subscriptionsUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
organizationsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder organizationsUrl(@Nullable URI organizationsUrl)
Initializes the value for theorganizationsUrl
attribute.- Parameters:
organizationsUrl
- The value for organizationsUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
reposUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder reposUrl(@Nullable URI reposUrl)
Initializes the value for thereposUrl
attribute.- Parameters:
reposUrl
- The value for reposUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
eventsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder eventsUrl(@Nullable String eventsUrl)
Initializes the value for theeventsUrl
attribute.- Parameters:
eventsUrl
- The value for eventsUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
receivedEventsUrl
@CanIgnoreReturnValue public final ImmutableUser.Builder receivedEventsUrl(@Nullable URI receivedEventsUrl)
Initializes the value for thereceivedEventsUrl
attribute.- Parameters:
receivedEventsUrl
- The value for receivedEventsUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
type
@CanIgnoreReturnValue public final ImmutableUser.Builder type(@Nullable String type)
Initializes the value for thetype
attribute.- Parameters:
type
- The value for type (can benull
)- Returns:
this
builder for use in a chained invocation
-
siteAdmin
@CanIgnoreReturnValue public final ImmutableUser.Builder siteAdmin(boolean siteAdmin)
Initializes the optional valuesiteAdmin
to siteAdmin.- Parameters:
siteAdmin
- The value for siteAdmin- Returns:
this
builder for chained invocation
-
siteAdmin
@CanIgnoreReturnValue public final ImmutableUser.Builder siteAdmin(Optional<Boolean> siteAdmin)
Initializes the optional valuesiteAdmin
to siteAdmin.- Parameters:
siteAdmin
- The value for siteAdmin- Returns:
this
builder 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
-
-