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

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

import javax.annotation.Nonnull;

public class CreateBranchParameters extends AbstractCreateRefParameters {

    private final boolean reflog;

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

        reflog = builder.reflog;
    }

    public boolean isReflog() {
        return reflog;
    }

    public static class Builder extends AbstractCreateBuilder<Builder, CreateBranchParameters> {

        private boolean reflog;

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

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

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

            return self();
        }

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