package com.atlassian.bitbucket.scm;

import com.atlassian.bitbucket.repository.RefOrder;
import com.atlassian.bitbucket.repository.RepositoryBranchesRequest;

public class BranchesCommandParameters extends AbstractRefsCommandParameters {

    private BranchesCommandParameters(String filterText, RefOrder order) {
        super(order, filterText);
    }

    public static class Builder extends AbstractBuilder<Builder> {

        public Builder() {
        }

        public Builder(RepositoryBranchesRequest request) {
            filterText(request.getFilterText()).order(request.getOrder());
        }

        public BranchesCommandParameters build() {
            return new BranchesCommandParameters(filterText, order);
        }

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