package nano;

import nano.RankListRequest;
import nano.SortedListRequest;

/* compiled from: TbsSdkJava */
public class RankRequestBuilder {

    private int beginPosition;

    private int bkId;

    private SortedListRequest.SortedList_Request.ClassTypeList classTypeList;

    private int[] customGoodsIds;

    private int[] fieldsId;

    private int size;

    private SortedListRequest.SortedList_Request.SortOptions sortOptions;

    private String templateName;

    public RankListRequest.RankList_Request.Request create() {
        SortedListRequest.SortedList_Request sortedList_Request = new SortedListRequest.SortedList_Request();
        SortedListRequest.SortedList_Request.ClassTypeList classTypeList2 = this.classTypeList;
        if (classTypeList2 != null) {
            sortedList_Request.setSystem(classTypeList2);
        } else {
            int i10 = this.bkId;
            if (i10 != 0) {
                sortedList_Request.setGoods(i10);
            } else if (this.customGoodsIds != null) {
                SortedListRequest.SortedList_Request.GoodsList goodsList = new SortedListRequest.SortedList_Request.GoodsList();
                goodsList.goodsId = this.customGoodsIds;
                sortedList_Request.setCustom(goodsList);
            }
        }
        sortedList_Request.fieldsId = this.fieldsId;
        SortedListRequest.SortedList_Request.SortOptions sortOptions2 = this.sortOptions;
        if (sortOptions2 != null) {
            sortedList_Request.sortOption = sortOptions2;
        }
        sortedList_Request.setBeginPosition(this.beginPosition);
        sortedList_Request.setLimitSize(this.size);
        RankListRequest.RankList_Request.Request request = new RankListRequest.RankList_Request.Request();
        request.templateRankRequest = sortedList_Request;
        String str = this.templateName;
        if (str != null) {
            request.setTemplateName(str);
        }
        return request;
    }

    public RankRequestBuilder setBeginPositionAndSize(int i10, int i11) {
        this.beginPosition = i10;
        this.size = i11;
        return this;
    }

    public RankRequestBuilder setBkId(int i10) {
        this.bkId = i10;
        return this;
    }

    public RankRequestBuilder setClassType(SortedListRequest.SortedList_Request.ClassTypeList.ClassType[] classTypeArr) {
        SortedListRequest.SortedList_Request.ClassTypeList classTypeList2 = new SortedListRequest.SortedList_Request.ClassTypeList();
        this.classTypeList = classTypeList2;
        classTypeList2.exchangeCategory = classTypeArr;
        return this;
    }

    public RankRequestBuilder setCustomGoodsIds(int[] iArr) {
        this.customGoodsIds = iArr;
        return this;
    }

    public RankRequestBuilder setFieldsId(int[] iArr) {
        this.fieldsId = iArr;
        return this;
    }

    public RankRequestBuilder setSortOptions(int i10, boolean z9) {
        SortedListRequest.SortedList_Request.SortOptions sortOptions2 = new SortedListRequest.SortedList_Request.SortOptions();
        this.sortOptions = sortOptions2;
        sortOptions2.setSortField(i10);
        this.sortOptions.setSortAsce(z9);
        return this;
    }

    public RankRequestBuilder setTemplateName(String str) {
        this.templateName = str;
        return this;
    }
}
