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;

import static java.util.Objects.requireNonNull;

public class AbstractCommitDiscussionCommentNotification extends AbstractCommitDiscussionNotification
        implements CommitDiscussionCommentNotification {

    private final Comment comment;

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

    @Nonnull
    @Override
    public Comment getComment() {
        return comment;
    }

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