package nano;

import nano.SortedListRequest;

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

    private int beginPosition;

    private int bkId;

    private SortedListRequest.SortedList_Request.ClassTypeList classTypeList;

    private int[] fieldIds;

    private int[] goodsIds;

    private SortedListRequest.SortedList_Request.GroupInfo groupInfo;

    private int limitSize;

    private SortedListRequest.SortedList_Request.SortOptions sortOptions;

    public SortedListRequest.SortedList_Request create() {
        SortedListRequest.SortedList_Request sortedList_Request = new SortedListRequest.SortedList_Request();
        SortedListRequest.SortedList_Request.GroupInfo groupInfo2 = this.groupInfo;
        if (groupInfo2 != null) {
            sortedList_Request.setGroup(groupInfo2);
        } else {
            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.goodsIds != null) {
                    SortedListRequest.SortedList_Request.GoodsList goodsList = new SortedListRequest.SortedList_Request.GoodsList();
                    goodsList.goodsId = this.goodsIds;
                    sortedList_Request.setCustom(goodsList);
                }
            }
        }
        sortedList_Request.fieldsId = this.fieldIds;
        SortedListRequest.SortedList_Request.SortOptions sortOptions2 = this.sortOptions;
        if (sortOptions2 != null) {
            sortedList_Request.sortOption = sortOptions2;
        }
        sortedList_Request.setBeginPosition(this.beginPosition);
        sortedList_Request.setLimitSize(this.limitSize);
        return sortedList_Request;
    }

    public SortRequestBuilder setBeginPosition(int i10) {
        this.beginPosition = i10;
        return this;
    }

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

    public SortRequestBuilder 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 SortRequestBuilder setFieldIds(int[] iArr) {
        this.fieldIds = iArr;
        return this;
    }

    public SortRequestBuilder setGoodsIds(int[] iArr) {
        this.goodsIds = iArr;
        return this;
    }

    public SortRequestBuilder setGroupInfo(SortedListRequest.SortedList_Request.GroupInfo groupInfo2) {
        this.groupInfo = groupInfo2;
        return this;
    }

    public SortRequestBuilder setLimitSize(int i10) {
        this.limitSize = i10;
        return this;
    }

    public SortRequestBuilder setSortOptions(int i10, int i11) {
        SortedListRequest.SortedList_Request.SortOptions sortOptions2 = new SortedListRequest.SortedList_Request.SortOptions();
        this.sortOptions = sortOptions2;
        sortOptions2.setSortField(i10);
        if (i11 == 1) {
            this.sortOptions.setSortAsce(true);
        } else if (i11 == 2) {
            this.sortOptions.setSortAsce(false);
        }
        return this;
    }

    public SortRequestBuilder 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;
    }
}
