package com.atlassian.bitbucket.notification.pull;

import com.atlassian.bitbucket.pull.PullRequest;
import com.atlassian.bitbucket.user.ApplicationUser;

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

import static java.util.Objects.requireNonNull;

public class PullRequestReviewerAddedNotification extends AbstractPullRequestNotification {

    @Nonnull
    private final List<ApplicationUser> addedReviewers;

    public PullRequestReviewerAddedNotification(@Nonnull PullRequest pullRequest,
                                                @Nonnull Date whenActivityPerformed,
                                                @Nullable ApplicationUser activityPerformer,
                                                @Nonnull List<ApplicationUser> addedReviewers) {
        super(pullRequest, whenActivityPerformed, activityPerformer);
        this.addedReviewers = requireNonNull(addedReviewers, "addedReviewers");
    }

    @Nonnull
    public List<ApplicationUser> getAddedReviewers() {
        return addedReviewers;
    }

    @Override
    public String toString() {
        return "ReviewerAddedNotification{" +
                super.toString() +
               ", reviewers=" + addedReviewers +
               '}';
    }

}
