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

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

import javax.annotation.Nonnull;

public class DeleteBranchParameters extends AbstractDeleteRefParameters {

    private final boolean force;

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

        force = builder.force;
    }

    public boolean isForce() {
        return force;
    }

    public static class Builder extends AbstractDeleteBuilder<Builder, DeleteBranchParameters> {

        private boolean force;

        public Builder(@Nonnull Repository repository, @Nonnull String name) {
            super(repository, name);
        }

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

        @Nonnull
        public Builder force(boolean value) {
            force = value;

            return self();
        }

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