Class ImmutablePullRequestEvent
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutablePullRequestEvent
-
- All Implemented Interfaces:
BaseEvent,PullRequestEvent
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePullRequestEvent extends Object implements PullRequestEvent
Immutable implementation ofPullRequestEvent.Use the builder to create immutable instances:
ImmutablePullRequestEvent.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePullRequestEvent.BuilderBuilds instances of typeImmutablePullRequestEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringaction()The action that was performed.static ImmutablePullRequestEvent.Builderbuilder()Creates a builder forImmutablePullRequestEvent.static ImmutablePullRequestEventcopyOf(PullRequestEvent instance)Creates an immutable copy of aPullRequestEventvalue.booleanequals(Object another)This instance is equal to all instances ofImmutablePullRequestEventthat have equal attribute values.EventInstallationeventInstallation()TheEventInstallation, if the event comes from a Github App.inthashCode()Computes a hash code from attributes:repository,sender,eventInstallation,action,number,pullRequest.Integernumber()The pull request number.PullRequestpullRequest()The pull requestRepositoryrepository()TheRepositoryUsersender()TheUserthat triggered/sent the event.StringtoString()Prints the immutable valuePullRequestEventwith attribute values.ImmutablePullRequestEventwithAction(String value)Copy the current immutable object by setting a value for theactionattribute.ImmutablePullRequestEventwithEventInstallation(EventInstallation value)Copy the current immutable object by setting a value for theeventInstallationattribute.ImmutablePullRequestEventwithNumber(Integer value)Copy the current immutable object by setting a value for thenumberattribute.ImmutablePullRequestEventwithPullRequest(PullRequest value)Copy the current immutable object by setting a value for thepullRequestattribute.ImmutablePullRequestEventwithRepository(Repository value)Copy the current immutable object by setting a value for therepositoryattribute.ImmutablePullRequestEventwithSender(User value)Copy the current immutable object by setting a value for thesenderattribute.
-
-
-
Method Detail
-
repository
@Nullable public Repository repository()
TheRepository- Specified by:
repositoryin interfaceBaseEvent
-
eventInstallation
@Nullable public EventInstallation eventInstallation()
TheEventInstallation, if the event comes from a Github App.- Specified by:
eventInstallationin interfaceBaseEvent
-
action
@Nullable public String action()
The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", or "reopened", or "synchronize". If the action is "closed" and the merged key is false, the pull request was closed with unmerged commits. If the action is "closed" and the merged key is true, the pull request was merged.- Specified by:
actionin interfacePullRequestEvent
-
number
@Nullable public Integer number()
The pull request number.- Specified by:
numberin interfacePullRequestEvent
-
pullRequest
@Nullable public PullRequest pullRequest()
The pull request- Specified by:
pullRequestin interfacePullRequestEvent
-
withRepository
public final ImmutablePullRequestEvent withRepository(@Nullable Repository value)
Copy the current immutable object by setting a value for therepositoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for repository (can benull)- Returns:
- A modified copy of the
thisobject
-
withSender
public final ImmutablePullRequestEvent withSender(@Nullable User value)
Copy the current immutable object by setting a value for thesenderattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sender (can benull)- Returns:
- A modified copy of the
thisobject
-
withEventInstallation
public final ImmutablePullRequestEvent withEventInstallation(@Nullable EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for eventInstallation (can benull)- Returns:
- A modified copy of the
thisobject
-
withAction
public final ImmutablePullRequestEvent withAction(@Nullable String value)
Copy the current immutable object by setting a value for theactionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for action (can benull)- Returns:
- A modified copy of the
thisobject
-
withNumber
public final ImmutablePullRequestEvent withNumber(@Nullable Integer value)
Copy the current immutable object by setting a value for thenumberattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for number (can benull)- Returns:
- A modified copy of the
thisobject
-
withPullRequest
public final ImmutablePullRequestEvent withPullRequest(@Nullable PullRequest value)
Copy the current immutable object by setting a value for thepullRequestattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for pullRequest (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePullRequestEventthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:repository,sender,eventInstallation,action,number,pullRequest.
-
toString
public String toString()
Prints the immutable valuePullRequestEventwith attribute values.
-
copyOf
public static ImmutablePullRequestEvent copyOf(PullRequestEvent instance)
Creates an immutable copy of aPullRequestEventvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable PullRequestEvent instance
-
builder
public static ImmutablePullRequestEvent.Builder builder()
Creates a builder forImmutablePullRequestEvent.ImmutablePullRequestEvent.builder() .repository(com.spotify.github.v3.repos.Repository | null) // nullablerepository.sender(com.spotify.github.v3.User | null) // nullablesender.eventInstallation(com.spotify.github.v3.activity.events.EventInstallation | null) // nullableeventInstallation.action(String | null) // nullableaction.number(Integer | null) // nullablenumber.pullRequest(com.spotify.github.v3.prs.PullRequest | null) // nullablepullRequest.build();- Returns:
- A new ImmutablePullRequestEvent builder
-
-