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

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

import javax.annotation.Nonnull;

public class DefaultGitUpdateRef implements GitUpdateRef {

    private final GitProcessBuilder builder;

    public DefaultGitUpdateRef(GitProcessBuilder builder) {
        this.builder = builder.command("update-ref");
    }

    @Nonnull
    @Override
    public GitUpdateRefDeleteBuilder delete(@Nonnull String ref) {
        return new DefaultGitUpdateRefDeleteBuilder(builder, ref);
    }

    @Nonnull
    @Override
    public GitUpdateRefSetBuilder set(@Nonnull String ref, @Nonnull String newValue) {
        return new DefaultGitUpdateRefSetBuilder(builder, ref, newValue);
    }

    @Nonnull
    @Override
    public GitUpdateRefStdinBuilder stdin() {
        return new DefaultGitUpdateRefStdinBuilder(builder);
    }
}
