package com.elab.core.dao.model;



/**
 * 日期范围查询
 * 这里需要注意的是 startData 和 endData 必填其中一个
 *
 * @author ： liukx
 * @time ： 2020/4/16 - 16:32
 */
public class DataRangeSearch {
    /**
     * 字段名称
     */
    private String filed;
    /**
     * 开始对象
     */
    private Object startData;
    /**
     * 结束对象
     */
    private Object endData;

    public DataRangeSearch() {
    }

    private DataRangeSearch(Builder builder) {
        setFiled(builder.filed);
        setStartData(builder.startData);
        setEndData(builder.endData);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getFiled() {
        return filed;
    }

    public void setFiled(String filed) {
        this.filed = filed;
    }

    public Object getStartData() {
        return startData;
    }

    public void setStartData(Object startData) {
        this.startData = startData;
    }

    public Object getEndData() {
        return endData;
    }

    public void setEndData(Object endData) {
        this.endData = endData;
    }


    public static final class Builder {
        private String filed;
        private Object startData;
        private Object endData;

        private Builder() {
        }

        public Builder filed(String val) {
            filed = val;
            return this;
        }

        public Builder startData(Object val) {
            startData = val;
            return this;
        }

        public Builder endData(Object val) {
            endData = val;
            return this;
        }

        public DataRangeSearch build() {
            return new DataRangeSearch(this);
        }
    }
}
