package com.atlassian.stash.internal.notification.pull;

import com.atlassian.bitbucket.i18n.I18nKey;
import com.atlassian.bitbucket.pull.PullRequest;
import com.atlassian.bitbucket.repository.Repository;

public final class PullRequestNotificationUtils {

    private PullRequestNotificationUtils() {
        throw new UnsupportedOperationException(getClass().getName() +
                " is a utility class and should not be instantiated");

    }

    public static I18nKey createSubjectKey(PullRequest pullRequest) {
        Repository repository = pullRequest.getToRef().getRepository();
        return new I18nKey("bitbucket.notification.email.pullrequest.title",
                repository.getProject().getKey(),
                repository.getName(),
                String.valueOf(pullRequest.getId()),
                pullRequest.getTitle());
    }

}
