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 class
ImmutablePullRequestEvent.Builder
Builds instances of typeImmutablePullRequestEvent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
action()
The action that was performed.static ImmutablePullRequestEvent.Builder
builder()
Creates a builder forImmutablePullRequestEvent
.static ImmutablePullRequestEvent
copyOf(PullRequestEvent instance)
Creates an immutable copy of aPullRequestEvent
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutablePullRequestEvent
that have equal attribute values.EventInstallation
eventInstallation()
TheEventInstallation
, if the event comes from a Github App.int
hashCode()
Computes a hash code from attributes:repository
,sender
,eventInstallation
,action
,number
,pullRequest
.Integer
number()
The pull request number.PullRequest
pullRequest()
The pull requestRepository
repository()
TheRepository
User
sender()
TheUser
that triggered/sent the event.String
toString()
Prints the immutable valuePullRequestEvent
with attribute values.ImmutablePullRequestEvent
withAction(String value)
Copy the current immutable object by setting a value for theaction
attribute.ImmutablePullRequestEvent
withEventInstallation(EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallation
attribute.ImmutablePullRequestEvent
withNumber(Integer value)
Copy the current immutable object by setting a value for thenumber
attribute.ImmutablePullRequestEvent
withPullRequest(PullRequest value)
Copy the current immutable object by setting a value for thepullRequest
attribute.ImmutablePullRequestEvent
withRepository(Repository value)
Copy the current immutable object by setting a value for therepository
attribute.ImmutablePullRequestEvent
withSender(User value)
Copy the current immutable object by setting a value for thesender
attribute.
-
-
-
Method Detail
-
repository
@Nullable public Repository repository()
TheRepository
- Specified by:
repository
in interfaceBaseEvent
-
eventInstallation
@Nullable public EventInstallation eventInstallation()
TheEventInstallation
, if the event comes from a Github App.- Specified by:
eventInstallation
in 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:
action
in interfacePullRequestEvent
-
number
@Nullable public Integer number()
The pull request number.- Specified by:
number
in interfacePullRequestEvent
-
pullRequest
@Nullable public PullRequest pullRequest()
The pull request- Specified by:
pullRequest
in interfacePullRequestEvent
-
withRepository
public final ImmutablePullRequestEvent withRepository(@Nullable Repository value)
Copy the current immutable object by setting a value for therepository
attribute. 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
this
object
-
withSender
public final ImmutablePullRequestEvent withSender(@Nullable User value)
Copy the current immutable object by setting a value for thesender
attribute. 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
this
object
-
withEventInstallation
public final ImmutablePullRequestEvent withEventInstallation(@Nullable EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallation
attribute. 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
this
object
-
withAction
public final ImmutablePullRequestEvent withAction(@Nullable String value)
Copy the current immutable object by setting a value for theaction
attribute. 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
this
object
-
withNumber
public final ImmutablePullRequestEvent withNumber(@Nullable Integer value)
Copy the current immutable object by setting a value for thenumber
attribute. 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
this
object
-
withPullRequest
public final ImmutablePullRequestEvent withPullRequest(@Nullable PullRequest value)
Copy the current immutable object by setting a value for thepullRequest
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePullRequestEvent
that 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 valuePullRequestEvent
with attribute values.
-
copyOf
public static ImmutablePullRequestEvent copyOf(PullRequestEvent instance)
Creates an immutable copy of aPullRequestEvent
value. 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) // nullable
repository
.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
-
-