Class ImmutableIssueCommentEvent
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableIssueCommentEvent
-
- All Implemented Interfaces:
BaseEvent,IssueCommentEvent
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableIssueCommentEvent extends Object implements IssueCommentEvent
Immutable implementation ofIssueCommentEvent.Use the builder to create immutable instances:
ImmutableIssueCommentEvent.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableIssueCommentEvent.BuilderBuilds instances of typeImmutableIssueCommentEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringaction()The action that was performed on the comment.static ImmutableIssueCommentEvent.Builderbuilder()Creates a builder forImmutableIssueCommentEvent.Optional<Changes>changes()The changes to the comment if the action was "edited".Commentcomment()TheCommentitself.static ImmutableIssueCommentEventcopyOf(IssueCommentEvent instance)Creates an immutable copy of aIssueCommentEventvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableIssueCommentEventthat 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,changes,issue,comment.Issueissue()TheIssuethe comment belongs to.Repositoryrepository()TheRepositoryUsersender()TheUserthat triggered/sent the event.StringtoString()Prints the immutable valueIssueCommentEventwith attribute values.ImmutableIssueCommentEventwithAction(String value)Copy the current immutable object by setting a value for theactionattribute.ImmutableIssueCommentEventwithChanges(Changes value)Copy the current immutable object by setting a present value for the optionalchangesattribute.ImmutableIssueCommentEventwithChanges(Optional<? extends Changes> optional)Copy the current immutable object by setting an optional value for thechangesattribute.ImmutableIssueCommentEventwithComment(Comment value)Copy the current immutable object by setting a value for thecommentattribute.ImmutableIssueCommentEventwithEventInstallation(EventInstallation value)Copy the current immutable object by setting a value for theeventInstallationattribute.ImmutableIssueCommentEventwithIssue(Issue value)Copy the current immutable object by setting a value for theissueattribute.ImmutableIssueCommentEventwithRepository(Repository value)Copy the current immutable object by setting a value for therepositoryattribute.ImmutableIssueCommentEventwithSender(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 on the comment. Can be one of "created", "edited", or "deleted".- Specified by:
actionin interfaceIssueCommentEvent
-
changes
public Optional<Changes> changes()
The changes to the comment if the action was "edited".The GitHub API does also declare "changes" and "changes[body][from]" but it does not provide any examples of that data.
- Specified by:
changesin interfaceIssueCommentEvent- See Also:
- "https://developer.github.com/v3/activity/events/types/#issuecommentevent"
-
issue
@Nullable public Issue issue()
TheIssuethe comment belongs to.- Specified by:
issuein interfaceIssueCommentEvent
-
comment
@Nullable public Comment comment()
TheCommentitself.- Specified by:
commentin interfaceIssueCommentEvent
-
withRepository
public final ImmutableIssueCommentEvent 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 ImmutableIssueCommentEvent 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 ImmutableIssueCommentEvent 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 ImmutableIssueCommentEvent 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
-
withChanges
public final ImmutableIssueCommentEvent withChanges(Changes value)
Copy the current immutable object by setting a present value for the optionalchangesattribute.- Parameters:
value- The value for changes- Returns:
- A modified copy of
thisobject
-
withChanges
public final ImmutableIssueCommentEvent withChanges(Optional<? extends Changes> optional)
Copy the current immutable object by setting an optional value for thechangesattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for changes- Returns:
- A modified copy of
thisobject
-
withIssue
public final ImmutableIssueCommentEvent withIssue(@Nullable Issue value)
Copy the current immutable object by setting a value for theissueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for issue (can benull)- Returns:
- A modified copy of the
thisobject
-
withComment
public final ImmutableIssueCommentEvent withComment(@Nullable Comment value)
Copy the current immutable object by setting a value for thecommentattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for comment (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableIssueCommentEventthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:repository,sender,eventInstallation,action,changes,issue,comment.
-
toString
public String toString()
Prints the immutable valueIssueCommentEventwith attribute values.
-
copyOf
public static ImmutableIssueCommentEvent copyOf(IssueCommentEvent instance)
Creates an immutable copy of aIssueCommentEventvalue. 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 IssueCommentEvent instance
-
builder
public static ImmutableIssueCommentEvent.Builder builder()
Creates a builder forImmutableIssueCommentEvent.ImmutableIssueCommentEvent.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.changes(com.spotify.github.v3.issues.changes.Changes) // optionalchanges.issue(com.spotify.github.v3.issues.Issue | null) // nullableissue.comment(com.spotify.github.v3.comment.Comment | null) // nullablecomment.build();- Returns:
- A new ImmutableIssueCommentEvent builder
-
-