package com.atlassian.bitbucket.mesh.git.builder.catfile;

import com.atlassian.bitbucket.mesh.git.builder.GitProcessBuilder;

import javax.annotation.Nonnull;

public class DefaultGitCatFile implements GitCatFile {

    private final GitProcessBuilder builder;

    public DefaultGitCatFile(GitProcessBuilder builder) {
        this.builder = builder.command("cat-file");
    }

    @Nonnull
    @Override
    public DefaultGitCatFileBatchBuilder batch() {
        return new DefaultGitCatFileBatchBuilder(builder, CatFileFormat.BATCH);
    }

    @Nonnull
    @Override
    public DefaultGitCatFileBatchBuilder batchCheck() {
        return new DefaultGitCatFileBatchBuilder(builder, CatFileFormat.BATCH_CHECK);
    }

    @Nonnull
    @Override
    public DefaultGitCatFilePrettyBuilder pretty() {
        return new DefaultGitCatFilePrettyBuilder(builder);
    }

    @Nonnull
    @Override
    public DefaultGitCatFileTypeBuilder type() {
        return new DefaultGitCatFileTypeBuilder(builder);
    }
}
