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

import com.atlassian.bitbucket.user.ApplicationUser;

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

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Update of a "to" branch on a pull request, including the user, date and branch name.
 */
public class ToBranchUpdate {

    private final ApplicationUser user;
    private final String toBranch;
    private final Date date;

    ToBranchUpdate(@Nonnull ApplicationUser user, @Nonnull String toBranch, @Nonnull Date date) {
        this.user = checkNotNull(user, "user");
        this.toBranch = checkNotNull(toBranch, "toBranch");
        this.date = checkNotNull(date, "date)");
    }

    @Nonnull
    public ApplicationUser getUser() {
        return user;
    }

    @Nonnull
    public String getToBranch() {
        return toBranch;
    }

    @Nonnull
    public Date getDate() {
        return date;
    }

}
