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

import com.zsc.edu.gateway.domain.system.BaseEntityBuilder;
import com.zsc.edu.gateway.modules.iot.product.entity.Product;

public class ProductBuilder extends BaseEntityBuilder {
    public String name;
    public String productType;
    public String model;
    public Long deptId;
    public Product.LinkType link;

    public static ProductBuilder bProduct() {
        return new ProductBuilder();
    }

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

    public ProductBuilder deptId(Long deptId) {
        this.deptId = deptId;
        return this;
    }

    public ProductBuilder createId(Long createId) {
        this.createId = createId;
        return this;
    }

    public ProductBuilder productType(String productType) {
        this.productType = productType;
        return this;
    }

    public ProductBuilder model(String model) {
        this.model = model;
        return this;
    }

    public ProductBuilder link(Product.LinkType link) {
        this.link = link;
        return this;
    }

    public Product build() {
        Product product = new Product();
        product.setName(name);
        product.setProductType(productType);
        product.setModel(model);
        product.setLink(link);
        product.setDeptId(deptId);
        product.setCreateId(createId);
        product.setParams(null);
        return product;
    }

}
