package com.atlassian.bitbucket.mesh.git.porcelain;

import com.atlassian.bitbucket.mesh.git.AbstractParameters;
import com.atlassian.bitbucket.mesh.repository.Repository;

import javax.annotation.Nonnull;

import static java.util.Objects.requireNonNull;

public class CountObjectsParameters extends AbstractParameters {

    private final Repository repository;

    private CountObjectsParameters(Builder builder) {
        super(builder);

        repository = builder.repository;
    }

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

    public static class Builder extends AbstractBuilder<Builder, CountObjectsParameters> {

        private final Repository repository;

        public Builder(@Nonnull Repository repository) {
            this.repository = requireNonNull(repository, "repository");
        }

        @Nonnull
        @Override
        public CountObjectsParameters build() {
            return new CountObjectsParameters(this);
        }

        @Nonnull
        @Override
        protected Builder self() {
            return this;
        }
    }
}
