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.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 ImmutableStatusEvent.Builder
addAllBranches(Iterable<? extends Branch> elements)
Adds elements tobranches
list.ImmutableStatusEvent.Builder
addBranches(Branch element)
Adds one element tobranches
list.ImmutableStatusEvent.Builder
addBranches(Branch... elements)
Adds elements tobranches
list.ImmutableStatusEvent.Builder
branches(Iterable<? extends Branch> elements)
Sets or replaces all elements forbranches
list.ImmutableStatusEvent
build()
Builds a newImmutableStatusEvent
.ImmutableStatusEvent.Builder
commit(CommitItem commit)
Initializes the value for thecommit
attribute.ImmutableStatusEvent.Builder
context(String context)
Initializes the value for thecontext
attribute.ImmutableStatusEvent.Builder
createdAt(GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.ImmutableStatusEvent.Builder
description(Optional<String> description)
Initializes the value for thedescription
attribute.ImmutableStatusEvent.Builder
eventInstallation(EventInstallation eventInstallation)
Initializes the value for theeventInstallation
attribute.ImmutableStatusEvent.Builder
from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTracking
instance.ImmutableStatusEvent.Builder
from(BaseEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.BaseEvent
instance.ImmutableStatusEvent.Builder
from(StatusEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.StatusEvent
instance.ImmutableStatusEvent.Builder
id(Long id)
Initializes the value for theid
attribute.ImmutableStatusEvent.Builder
name(String name)
Initializes the value for thename
attribute.ImmutableStatusEvent.Builder
repository(Repository repository)
Initializes the value for therepository
attribute.ImmutableStatusEvent.Builder
sender(User sender)
Initializes the value for thesender
attribute.ImmutableStatusEvent.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutableStatusEvent.Builder
state(String state)
Initializes the value for thestate
attribute.ImmutableStatusEvent.Builder
targetUrl(URI targetUrl)
Initializes the optional valuetargetUrl
to targetUrl.ImmutableStatusEvent.Builder
targetUrl(Optional<? extends URI> targetUrl)
Initializes the optional valuetargetUrl
to targetUrl.ImmutableStatusEvent.Builder
updatedAt(GitHubInstant updatedAt)
Initializes the value for theupdatedAt
attribute.
-
-
-
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.BaseEvent
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder 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.UpdateTracking
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder 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.StatusEvent
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
repository
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder repository(@Nullable Repository repository)
Initializes the value for therepository
attribute.- Parameters:
repository
- The value for repository (can benull
)- Returns:
this
builder for use in a chained invocation
-
sender
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder sender(@Nullable User sender)
Initializes the value for thesender
attribute.- Parameters:
sender
- The value for sender (can benull
)- Returns:
this
builder for use in a chained invocation
-
eventInstallation
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder eventInstallation(@Nullable EventInstallation eventInstallation)
Initializes the value for theeventInstallation
attribute.- Parameters:
eventInstallation
- The value for eventInstallation (can benull
)- Returns:
this
builder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.- Parameters:
createdAt
- The value for createdAt (can benull
)- Returns:
this
builder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAt
attribute.- Parameters:
updatedAt
- The value for updatedAt (can benull
)- Returns:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder id(@Nullable Long id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder sha(@Nullable String sha)
Initializes the value for thesha
attribute.- Parameters:
sha
- The value for sha (can benull
)- Returns:
this
builder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder name(@Nullable String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name (can benull
)- Returns:
this
builder for use in a chained invocation
-
targetUrl
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder targetUrl(URI targetUrl)
Initializes the optional valuetargetUrl
to targetUrl.- Parameters:
targetUrl
- The value for targetUrl- Returns:
this
builder for chained invocation
-
targetUrl
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder targetUrl(Optional<? extends URI> targetUrl)
Initializes the optional valuetargetUrl
to targetUrl.- Parameters:
targetUrl
- The value for targetUrl- Returns:
this
builder for use in a chained invocation
-
context
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder context(@Nullable String context)
Initializes the value for thecontext
attribute.- Parameters:
context
- The value for context (can benull
)- Returns:
this
builder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder description(@Nullable Optional<String> description)
Initializes the value for thedescription
attribute.- Parameters:
description
- The value for description (can benull
)- Returns:
this
builder for use in a chained invocation
-
state
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder state(@Nullable String state)
Initializes the value for thestate
attribute.- Parameters:
state
- The value for state (can benull
)- Returns:
this
builder for use in a chained invocation
-
commit
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder commit(@Nullable CommitItem commit)
Initializes the value for thecommit
attribute.- Parameters:
commit
- The value for commit (can benull
)- Returns:
this
builder for use in a chained invocation
-
addBranches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder addBranches(Branch element)
Adds one element tobranches
list.- Parameters:
element
- A branches element- Returns:
this
builder for use in a chained invocation
-
addBranches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder addBranches(Branch... elements)
Adds elements tobranches
list.- Parameters:
elements
- An array of branches elements- Returns:
this
builder for use in a chained invocation
-
branches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder branches(@Nullable Iterable<? extends Branch> elements)
Sets or replaces all elements forbranches
list.- Parameters:
elements
- An iterable of branches elements- Returns:
this
builder for use in a chained invocation
-
addAllBranches
@CanIgnoreReturnValue public final ImmutableStatusEvent.Builder addAllBranches(Iterable<? extends Branch> elements)
Adds elements tobranches
list.- Parameters:
elements
- An iterable of branches elements- Returns:
this
builder 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
-
-