package com.atlassian.stash.internal.repository.sync.command;

import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.user.ApplicationUser;

import javax.annotation.Nonnull;

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

/**
 * @since 2.6
 */
public abstract class AbstractCommandParameters {

    private final Repository repository;
    private final Repository upstream;
    private final ApplicationUser user;

    protected AbstractCommandParameters(@Nonnull Repository repository, @Nonnull Repository upstream,
                                        @Nonnull ApplicationUser user) {
        this.repository = checkNotNull(repository, "repository");
        this.upstream = checkNotNull(upstream, "upstream");
        this.user = checkNotNull(user, "user");
    }

    @Nonnull
    public Repository getRepository() {
        return repository;
    }

    @Nonnull
    public Repository getUpstream() {
        return upstream;
    }

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