Class ImmutableComment

  • All Implemented Interfaces:
    UpdateTracking, Comment

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

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

    • Method Detail

      • url

        @Nullable
        public URI url()
        Comment API URL.
        Specified by:
        url in interface Comment
      • id

        @Nullable
        public Long id()
        Comment id.
        Specified by:
        id in interface Comment
      • diffHunk

        @Nullable
        public String diffHunk()
        Unified diff.
        Specified by:
        diffHunk in interface Comment
      • path

        @Nullable
        public String path()
        The relative path of the file to comment on.
        Specified by:
        path in interface Comment
      • position

        @Nullable
        public Integer position()
        The line index in the diff to comment on.
        Specified by:
        position in interface Comment
      • commitId

        @Nullable
        public String commitId()
        The SHA of the commit to comment on.
        Specified by:
        commitId in interface Comment
      • user

        @Nullable
        public User user()
        Comment author.
        Specified by:
        user in interface Comment
      • body

        @Nullable
        public String body()
        The text of the comment.
        Specified by:
        body in interface Comment
      • htmlUrl

        @Nullable
        public URI htmlUrl()
        Comment URL.
        Specified by:
        htmlUrl in interface Comment
      • pullRequestUrl

        @Nullable
        public URI pullRequestUrl()
        Pull request API URL.
        Specified by:
        pullRequestUrl in interface Comment
      • withCreatedAt

        public final ImmutableComment withCreatedAt​(@Nullable
                                                    GitHubInstant value)
        Copy the current immutable object by setting a value for the createdAt attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for createdAt (can be null)
        Returns:
        A modified copy of the this object
      • withUpdatedAt

        public final ImmutableComment withUpdatedAt​(@Nullable
                                                    GitHubInstant value)
        Copy the current immutable object by setting a value for the updatedAt attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for updatedAt (can be null)
        Returns:
        A modified copy of the this object
      • withUrl

        public final ImmutableComment withUrl​(@Nullable
                                              URI value)
        Copy the current immutable object by setting a value for the url attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for url (can be null)
        Returns:
        A modified copy of the this object
      • withId

        public final ImmutableComment withId​(@Nullable
                                             Long value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withDiffHunk

        public final ImmutableComment withDiffHunk​(@Nullable
                                                   String value)
        Copy the current immutable object by setting a value for the diffHunk attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for diffHunk (can be null)
        Returns:
        A modified copy of the this object
      • withPath

        public final ImmutableComment withPath​(@Nullable
                                               String value)
        Copy the current immutable object by setting a value for the path attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for path (can be null)
        Returns:
        A modified copy of the this object
      • withPosition

        public final ImmutableComment withPosition​(@Nullable
                                                   Integer value)
        Copy the current immutable object by setting a value for the position attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for position (can be null)
        Returns:
        A modified copy of the this object
      • withOriginalPosition

        public final ImmutableComment withOriginalPosition​(@Nullable
                                                           Integer value)
        Copy the current immutable object by setting a value for the originalPosition attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for originalPosition (can be null)
        Returns:
        A modified copy of the this object
      • withCommitId

        public final ImmutableComment withCommitId​(@Nullable
                                                   String value)
        Copy the current immutable object by setting a value for the commitId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for commitId (can be null)
        Returns:
        A modified copy of the this object
      • withOriginalCommitId

        public final ImmutableComment withOriginalCommitId​(@Nullable
                                                           String value)
        Copy the current immutable object by setting a value for the originalCommitId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for originalCommitId (can be null)
        Returns:
        A modified copy of the this object
      • withUser

        public final ImmutableComment withUser​(@Nullable
                                               User value)
        Copy the current immutable object by setting a value for the user attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for user (can be null)
        Returns:
        A modified copy of the this object
      • withBody

        public final ImmutableComment withBody​(@Nullable
                                               String value)
        Copy the current immutable object by setting a value for the body attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for body (can be null)
        Returns:
        A modified copy of the this object
      • withHtmlUrl

        public final ImmutableComment withHtmlUrl​(@Nullable
                                                  URI value)
        Copy the current immutable object by setting a value for the htmlUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for htmlUrl (can be null)
        Returns:
        A modified copy of the this object
      • withPullRequestUrl

        public final ImmutableComment withPullRequestUrl​(@Nullable
                                                         URI value)
        Copy the current immutable object by setting a value for the pullRequestUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for pullRequestUrl (can be null)
        Returns:
        A modified copy of the this object
      • withLinks

        public final ImmutableComment withLinks​(@Nullable
                                                CommentLinks value)
        Copy the current immutable object by setting a value for the links attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for links (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 ImmutableComment 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: createdAt, updatedAt, url, id, diffHunk, path, position, originalPosition, commitId, originalCommitId, user, body, htmlUrl, pullRequestUrl, links.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableComment copyOf​(Comment instance)
        Creates an immutable copy of a Comment 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 Comment instance
      • builder

        public static ImmutableComment.Builder builder()
        Creates a builder for ImmutableComment.
         ImmutableComment.builder()
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .url(java.net.URI | null) // nullable url
            .id(Long | null) // nullable id
            .diffHunk(String | null) // nullable diffHunk
            .path(String | null) // nullable path
            .position(Integer | null) // nullable position
            .originalPosition(Integer | null) // nullable originalPosition
            .commitId(String | null) // nullable commitId
            .originalCommitId(String | null) // nullable originalCommitId
            .user(com.spotify.github.v3.User | null) // nullable user
            .body(String | null) // nullable body
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .pullRequestUrl(java.net.URI | null) // nullable pullRequestUrl
            .links(com.spotify.github.v3.prs.CommentLinks | null) // nullable links
            .build();
         
        Returns:
        A new ImmutableComment builder