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 class
ImmutableIssueCommentEvent.Builder
Builds instances of typeImmutableIssueCommentEvent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
action()
The action that was performed on the comment.static ImmutableIssueCommentEvent.Builder
builder()
Creates a builder forImmutableIssueCommentEvent
.Optional<Changes>
changes()
The changes to the comment if the action was "edited".Comment
comment()
TheComment
itself.static ImmutableIssueCommentEvent
copyOf(IssueCommentEvent instance)
Creates an immutable copy of aIssueCommentEvent
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableIssueCommentEvent
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
,changes
,issue
,comment
.Issue
issue()
TheIssue
the comment belongs to.Repository
repository()
TheRepository
User
sender()
TheUser
that triggered/sent the event.String
toString()
Prints the immutable valueIssueCommentEvent
with attribute values.ImmutableIssueCommentEvent
withAction(String value)
Copy the current immutable object by setting a value for theaction
attribute.ImmutableIssueCommentEvent
withChanges(Changes value)
Copy the current immutable object by setting a present value for the optionalchanges
attribute.ImmutableIssueCommentEvent
withChanges(Optional<? extends Changes> optional)
Copy the current immutable object by setting an optional value for thechanges
attribute.ImmutableIssueCommentEvent
withComment(Comment value)
Copy the current immutable object by setting a value for thecomment
attribute.ImmutableIssueCommentEvent
withEventInstallation(EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallation
attribute.ImmutableIssueCommentEvent
withIssue(Issue value)
Copy the current immutable object by setting a value for theissue
attribute.ImmutableIssueCommentEvent
withRepository(Repository value)
Copy the current immutable object by setting a value for therepository
attribute.ImmutableIssueCommentEvent
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 on the comment. Can be one of "created", "edited", or "deleted".- Specified by:
action
in 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:
changes
in interfaceIssueCommentEvent
- See Also:
- "https://developer.github.com/v3/activity/events/types/#issuecommentevent"
-
issue
@Nullable public Issue issue()
TheIssue
the comment belongs to.- Specified by:
issue
in interfaceIssueCommentEvent
-
comment
@Nullable public Comment comment()
TheComment
itself.- Specified by:
comment
in interfaceIssueCommentEvent
-
withRepository
public final ImmutableIssueCommentEvent 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 ImmutableIssueCommentEvent 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 ImmutableIssueCommentEvent 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 ImmutableIssueCommentEvent 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
-
withChanges
public final ImmutableIssueCommentEvent withChanges(Changes value)
Copy the current immutable object by setting a present value for the optionalchanges
attribute.- Parameters:
value
- The value for changes- Returns:
- A modified copy of
this
object
-
withChanges
public final ImmutableIssueCommentEvent withChanges(Optional<? extends Changes> optional)
Copy the current immutable object by setting an optional value for thechanges
attribute. 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
this
object
-
withIssue
public final ImmutableIssueCommentEvent withIssue(@Nullable Issue value)
Copy the current immutable object by setting a value for theissue
attribute. 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
this
object
-
withComment
public final ImmutableIssueCommentEvent withComment(@Nullable Comment value)
Copy the current immutable object by setting a value for thecomment
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableIssueCommentEvent
that 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 valueIssueCommentEvent
with attribute values.
-
copyOf
public static ImmutableIssueCommentEvent copyOf(IssueCommentEvent instance)
Creates an immutable copy of aIssueCommentEvent
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 IssueCommentEvent instance
-
builder
public static ImmutableIssueCommentEvent.Builder builder()
Creates a builder forImmutableIssueCommentEvent
.ImmutableIssueCommentEvent.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
.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
-
-