package com.sdtool.common.entity.base;

import com.sdtool.common.entity.site.ERPTokenUser;
import com.sweetfish.source.PageFlipper;
import org.rex.RMap;

@SuppressWarnings("rawtypes")
public class ProcessSearchOptionsItem<T> extends BaseEntity {

    private RMap searchData;

    private int exportFlag;

    private ERPTokenUser currentUser;

    private PageFlipper pageFlipper;

    private String orderBy;

    private String dataSourceId;

    private long supplierCode;

    private T[] options;

    public ProcessSearchOptionsItem() {
    }

    private ProcessSearchOptionsItem(Builder<T> builder) {
        setSearchData(builder.searchData);
        setExportFlag(builder.exportFlag);
        setCurrentUser(builder.currentUser);
        setPageFlipper(builder.pageFlipper);
        setOrderBy(builder.orderBy);
        setDataSourceId(builder.dataSourceId);
        setSupplierCode(builder.supplierCode);
        setOptions(builder.options);
    }

    public static <T> Builder<T> newBuilder() {
        return new Builder<>();
    }


    public RMap getSearchData() {
        return searchData;
    }

    public void setSearchData(RMap searchData) {
        this.searchData = searchData;
    }

    public int getExportFlag() {
        return exportFlag;
    }

    public void setExportFlag(int exportFlag) {
        this.exportFlag = exportFlag;
    }

    public ERPTokenUser getCurrentUser() {
        return currentUser;
    }

    public void setCurrentUser(ERPTokenUser currentUser) {
        this.currentUser = currentUser;
    }

    public PageFlipper getPageFlipper() {
        return pageFlipper;
    }

    public void setPageFlipper(PageFlipper pageFlipper) {
        this.pageFlipper = pageFlipper;
    }

    public String getDataSourceId() {
        return dataSourceId;
    }

    public void setDataSourceId(String dataSourceId) {
        this.dataSourceId = dataSourceId;
    }

    public long getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(long supplierCode) {
        this.supplierCode = supplierCode;
    }

    public T[] getOptions() {
        return options;
    }

    public void setOptions(T[] options) {
        this.options = options;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public static final class Builder<T> {
        private RMap searchData;
        private int exportFlag;
        private ERPTokenUser currentUser;
        private PageFlipper pageFlipper;
        private String dataSourceId;
        private String orderBy;
        private long supplierCode;
        private T[] options;

        private Builder() {
        }

        public Builder<T> searchData(RMap val) {
            searchData = val;
            return this;
        }

        public Builder<T> exportFlag(int val) {
            exportFlag = val;
            return this;
        }

        public Builder<T> currentUser(ERPTokenUser val) {
            currentUser = val;
            return this;
        }

        public Builder<T> pageFlipper(PageFlipper val) {
            pageFlipper = val;
            return this;
        }

        public Builder<T> orderBy(String val) {
            orderBy = val;
            return this;
        }

        public Builder<T> dataSourceId(String val) {
            dataSourceId = val;
            return this;
        }

        public Builder<T> supplierCode(long val) {
            supplierCode = val;
            return this;
        }

        public Builder<T> options(T[] val) {
            options = val;
            return this;
        }

        public ProcessSearchOptionsItem<T> build() {
            return new ProcessSearchOptionsItem<>(this);
        }
    }
}
