Class ImmutableStatusEvent.Builder
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableStatusEvent.Builder
-
- Enclosing class:
- ImmutableStatusEvent
@NotThreadSafe public static final class ImmutableStatusEvent.Builder extends Object
Builds instances of typeImmutableStatusEvent. 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 ImmutableStatusEvent.BuilderaddAllBranches(Iterable<? extends Branch> elements)Adds elements tobrancheslist.ImmutableStatusEvent.BuilderaddBranches(Branch element)Adds one element tobrancheslist.ImmutableStatusEvent.BuilderaddBranches(Branch... elements)Adds elements tobrancheslist.ImmutableStatusEvent.Builderbranches(Iterable<? extends Branch> elements)Sets or replaces all elements forbrancheslist.ImmutableStatusEventbuild()Builds a newImmutableStatusEvent.ImmutableStatusEvent.Buildercommit(CommitItem commit)Initializes the value for thecommitattribute.ImmutableStatusEvent.Buildercontext(String context)Initializes the value for thecontextattribute.ImmutableStatusEvent.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutableStatusEvent.Builderdescription(String description)Initializes the optional valuedescriptionto description.ImmutableStatusEvent.Builderdescription(Optional<String> description)Initializes the optional valuedescriptionto description.ImmutableStatusEvent.BuildereventInstallation(EventInstallation eventInstallation)Initializes the value for theeventInstallationattribute.ImmutableStatusEvent.Builderfrom(UpdateTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.ImmutableStatusEvent.Builderfrom(BaseEvent instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.BaseEventinstance.ImmutableStatusEvent.Builderfrom(StatusEvent instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.StatusEventinstance.ImmutableStatusEvent.Builderid(Long id)Initializes the value for theidattribute.ImmutableStatusEvent.Buildername(String name)Initializes the value for thenameattribute.ImmutableStatusEvent.Builderrepository(Repository repository)Initializes the value for therepositoryattribute.ImmutableStatusEvent.Buildersender(User sender)Initializes the value for thesenderattribute.ImmutableStatusEvent.Buildersha(String sha)Initializes the value for theshaattribute.ImmutableStatusEvent.Builderstate(String state)Initializes the value for thestateattribute.ImmutableStatusEvent.BuildertargetUrl(URI targetUrl)Initializes the optional valuetargetUrlto targetUrl.ImmutableStatusEvent.BuildertargetUrl(Optional<? extends URI> targetUrl)Initializes the optional valuetargetUrlto targetUrl.ImmutableStatusEvent.BuilderupdatedAt(GitHubInstant updatedAt)Initializes the value for theupdatedAtattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder from(BaseEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.BaseEventinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder from(StatusEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.StatusEventinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
repository
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder repository(@Nullable Repository repository)
Initializes the value for therepositoryattribute.- Parameters:
repository- The value for repository (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sender
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder sender(@Nullable User sender)
Initializes the value for thesenderattribute.- Parameters:
sender- The value for sender (can benull)- Returns:
thisbuilder for use in a chained invocation
-
eventInstallation
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder eventInstallation(@Nullable EventInstallation eventInstallation)
Initializes the value for theeventInstallationattribute.- Parameters:
eventInstallation- The value for eventInstallation (can benull)- Returns:
thisbuilder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAtattribute.- Parameters:
createdAt- The value for createdAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAtattribute.- Parameters:
updatedAt- The value for updatedAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder id(@Nullable Long id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder sha(@Nullable String sha)
Initializes the value for theshaattribute.- Parameters:
sha- The value for sha (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder name(@Nullable String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
targetUrl
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder targetUrl(URI targetUrl)
Initializes the optional valuetargetUrlto targetUrl.- Parameters:
targetUrl- The value for targetUrl- Returns:
thisbuilder for chained invocation
-
targetUrl
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder targetUrl(Optional<? extends URI> targetUrl)
Initializes the optional valuetargetUrlto targetUrl.- Parameters:
targetUrl- The value for targetUrl- Returns:
thisbuilder for use in a chained invocation
-
context
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder context(@Nullable String context)
Initializes the value for thecontextattribute.- Parameters:
context- The value for context (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder description(String description)
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder description(Optional<String> description)
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
state
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder state(@Nullable String state)
Initializes the value for thestateattribute.- Parameters:
state- The value for state (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commit
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder commit(@Nullable CommitItem commit)
Initializes the value for thecommitattribute.- Parameters:
commit- The value for commit (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addBranches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder addBranches(Branch element)
Adds one element tobrancheslist.- Parameters:
element- A branches element- Returns:
thisbuilder for use in a chained invocation
-
addBranches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder addBranches(Branch... elements)
Adds elements tobrancheslist.- Parameters:
elements- An array of branches elements- Returns:
thisbuilder for use in a chained invocation
-
branches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder branches(@Nullable Iterable<? extends Branch> elements)
Sets or replaces all elements forbrancheslist.- Parameters:
elements- An iterable of branches elements- Returns:
thisbuilder for use in a chained invocation
-
addAllBranches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder addAllBranches(Iterable<? extends Branch> elements)
Adds elements tobrancheslist.- Parameters:
elements- An iterable of branches elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableStatusEvent build()
Builds a newImmutableStatusEvent.- Returns:
- An immutable instance of StatusEvent
- Throws:
IllegalStateException- if any required attributes are missing
-
-