package com.atlassian.bitbucket.notification.commit;

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

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

public class CommitDiscussionCommentRepliedNotification extends AbstractCommitDiscussionCommentNotification {

    private final Comment parent;

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

    @Nullable
    public Comment getParent() {
        return parent;
    }

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