Class ImmutablePullRequestEvent.Builder
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutablePullRequestEvent.Builder
-
- Enclosing class:
- ImmutablePullRequestEvent
@NotThreadSafe public static final class ImmutablePullRequestEvent.Builder extends Object
Builds instances of typeImmutablePullRequestEvent. 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 ImmutablePullRequestEvent.Builderaction(String action)Initializes the value for theactionattribute.ImmutablePullRequestEventbuild()Builds a newImmutablePullRequestEvent.ImmutablePullRequestEvent.BuildereventInstallation(EventInstallation eventInstallation)Initializes the value for theeventInstallationattribute.ImmutablePullRequestEvent.Builderfrom(BaseEvent instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.BaseEventinstance.ImmutablePullRequestEvent.Builderfrom(PullRequestEvent instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.PullRequestEventinstance.ImmutablePullRequestEvent.Buildernumber(Integer number)Initializes the value for thenumberattribute.ImmutablePullRequestEvent.BuilderpullRequest(PullRequest pullRequest)Initializes the value for thepullRequestattribute.ImmutablePullRequestEvent.Builderrepository(Repository repository)Initializes the value for therepositoryattribute.ImmutablePullRequestEvent.Buildersender(User sender)Initializes the value for thesenderattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestEvent.Builder from(PullRequestEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.PullRequestEventinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestEvent.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
-
repository
@CanIgnoreReturnValue public final ImmutablePullRequestEvent.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 ImmutablePullRequestEvent.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 ImmutablePullRequestEvent.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
-
action
@CanIgnoreReturnValue public final ImmutablePullRequestEvent.Builder action(@Nullable String action)
Initializes the value for theactionattribute.- Parameters:
action- The value for action (can benull)- Returns:
thisbuilder for use in a chained invocation
-
number
@CanIgnoreReturnValue public final ImmutablePullRequestEvent.Builder number(@Nullable Integer number)
Initializes the value for thenumberattribute.- Parameters:
number- The value for number (can benull)- Returns:
thisbuilder for use in a chained invocation
-
pullRequest
@CanIgnoreReturnValue public final ImmutablePullRequestEvent.Builder pullRequest(@Nullable PullRequest pullRequest)
Initializes the value for thepullRequestattribute.- Parameters:
pullRequest- The value for pullRequest (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutablePullRequestEvent build()
Builds a newImmutablePullRequestEvent.- Returns:
- An immutable instance of PullRequestEvent
- Throws:
IllegalStateException- if any required attributes are missing
-
-