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
      • htmlUrl

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

        public int id()
        Comment ID.
        Specified by:
        id in interface Comment
      • user

        @Nullable
        public User user()
        The User that made the comment.
        Specified by:
        user in interface Comment
      • body

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

        public Optional<URI> issueUrl()
        The issueURL which the comment belongs to.
        Specified by:
        issueUrl 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
      • 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
      • withId

        public final ImmutableComment withId​(int value)
        Copy the current immutable object by setting a value for the id attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id
        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
      • withPosition

        public final ImmutableComment withPosition​(int value)
        Copy the current immutable object by setting a present value for the optional position attribute.
        Parameters:
        value - The value for position
        Returns:
        A modified copy of this object
      • withPosition

        public final ImmutableComment withPosition​(Optional<Integer> optional)
        Copy the current immutable object by setting an optional value for the position attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for position
        Returns:
        A modified copy of this object
      • withLine

        @Deprecated
        public final ImmutableComment withLine​(int value)
        Deprecated.
        Copy the current immutable object by setting a present value for the optional line attribute.
        Parameters:
        value - The value for line
        Returns:
        A modified copy of this object
      • withLine

        @Deprecated
        public final ImmutableComment withLine​(Optional<Integer> optional)
        Deprecated.
        Copy the current immutable object by setting an optional value for the line attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for line
        Returns:
        A modified copy of this object
      • withPath

        public final ImmutableComment withPath​(String value)
        Copy the current immutable object by setting a present value for the optional path attribute.
        Parameters:
        value - The value for path
        Returns:
        A modified copy of this object
      • withPath

        public final ImmutableComment withPath​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the path attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for path
        Returns:
        A modified copy of this object
      • withCommitId

        public final ImmutableComment withCommitId​(String value)
        Copy the current immutable object by setting a present value for the optional commitId attribute.
        Parameters:
        value - The value for commitId
        Returns:
        A modified copy of this object
      • withCommitId

        public final ImmutableComment withCommitId​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the commitId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for commitId
        Returns:
        A modified copy of 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
      • withIssueUrl

        public final ImmutableComment withIssueUrl​(URI value)
        Copy the current immutable object by setting a present value for the optional issueUrl attribute.
        Parameters:
        value - The value for issueUrl
        Returns:
        A modified copy of this object
      • withIssueUrl

        public final ImmutableComment withIssueUrl​(Optional<? extends URI> optional)
        Copy the current immutable object by setting an optional value for the issueUrl 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 issueUrl
        Returns:
        A modified copy of 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, htmlUrl, id, user, position, line, path, commitId, body, issueUrl.
        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
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .id(int) // required id
            .user(com.spotify.github.v3.User | null) // nullable user
            .position(Integer) // optional position
            .line(Integer) // optional line
            .path(String) // optional path
            .commitId(String) // optional commitId
            .body(String | null) // nullable body
            .issueUrl(java.net.URI) // optional issueUrl
            .build();
         
        Returns:
        A new ImmutableComment builder