Class ImmutableIssueCommentEvent

  • All Implemented Interfaces:
    BaseEvent, IssueCommentEvent

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableIssueCommentEvent
    extends Object
    implements IssueCommentEvent
    Immutable implementation of IssueCommentEvent.

    Use the builder to create immutable instances: ImmutableIssueCommentEvent.builder().

    • Method Detail

      • sender

        @Nullable
        public User sender()
        The User that triggered/sent the event.
        Specified by:
        sender in interface BaseEvent
      • 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 interface IssueCommentEvent
      • 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 interface IssueCommentEvent
        See Also:
        "https://developer.github.com/v3/activity/events/types/#issuecommentevent"
      • withRepository

        public final ImmutableIssueCommentEvent withRepository​(@Nullable
                                                               Repository value)
        Copy the current immutable object by setting a value for the repository attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for repository (can be null)
        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 the sender attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for sender (can be null)
        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 the eventInstallation attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for eventInstallation (can be null)
        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 the action attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for action (can be null)
        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 optional changes 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 the changes attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        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 the issue attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for issue (can be null)
        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 the comment attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for comment (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableIssueCommentEvent that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: repository, sender, eventInstallation, action, changes, issue, comment.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value IssueCommentEvent with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableIssueCommentEvent copyOf​(IssueCommentEvent instance)
        Creates an immutable copy of a IssueCommentEvent 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 for ImmutableIssueCommentEvent.
         ImmutableIssueCommentEvent.builder()
            .repository(com.spotify.github.v3.repos.Repository | null) // nullable repository
            .sender(com.spotify.github.v3.User | null) // nullable sender
            .eventInstallation(com.spotify.github.v3.activity.events.EventInstallation | null) // nullable eventInstallation
            .action(String | null) // nullable action
            .changes(com.spotify.github.v3.issues.changes.Changes) // optional changes
            .issue(com.spotify.github.v3.issues.Issue | null) // nullable issue
            .comment(com.spotify.github.v3.comment.Comment | null) // nullable comment
            .build();
         
        Returns:
        A new ImmutableIssueCommentEvent builder