package com.atlassian.bitbucket.notification.commit;

import com.atlassian.bitbucket.comment.Comment;
import com.atlassian.bitbucket.commit.CommitDiscussion;
import com.atlassian.bitbucket.commit.CommitDiscussionCommentAnchor;
import com.atlassian.bitbucket.user.ApplicationUser;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Date;

public class CommitDiscussionCommentAddedNotification extends AbstractCommitDiscussionCommentNotification {
    private final CommitDiscussionCommentAnchor anchor;

    public CommitDiscussionCommentAddedNotification(@Nullable ApplicationUser user,
                                                    @Nonnull Date date,
                                                    @Nonnull CommitDiscussion commitDiscussion,
                                                    @Nonnull Comment comment,
                                                    @Nullable CommitDiscussionCommentAnchor anchor) {
        super(user, date, commitDiscussion, comment);
        this.anchor = anchor;
    }

    @Nullable
    public CommitDiscussionCommentAnchor getAnchor() {
        return anchor;
    }

    @Override
    public String toString() {
        return super.toString() +
                ", anchor=" + anchor;
    }
}
