package com.zsc.edu.gateway.domain.iot;

import com.zsc.edu.gateway.modules.iot.tsl.entity.DataType;
import com.zsc.edu.gateway.modules.iot.tsl.entity.Param;

public class ParamBuilder extends BaseParamBuilder {
    public DataType dataType;
    public String name;
    public Param.Type type;
    public Param.ForeignType foreignType;
    public Long foreignId;

    public static ParamBuilder aParam() {
        return new ParamBuilder();
    }

    public ParamBuilder dataType(DataType dataType) {
        this.dataType = dataType;
        return this;
    }

    public ParamBuilder foreignId(Long foreignId) {
        this.foreignId = foreignId;
        return this;
    }

    public ParamBuilder name(String name) {
        this.name = name;
        return this;
    }

    public ParamBuilder type(Param.Type type) {
        this.type = type;
        return this;
    }

    public ParamBuilder foreignType(Param.ForeignType foreignType) {
        this.foreignType = foreignType;
        return this;
    }

    public Param build() {
        Param param = new Param();
        param.setForeignId(foreignId);
        param.setName(name);
        param.setType(type);
        param.setForeignType(foreignType);
        param.setDataType(dataType);
        return param;
    }
}
