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.Property;

public class PropertyBuilder extends BaseParamBuilder {
    private Long productId;
    private DataType dataType;
    private Property.IoType ioType;
    private String name;

    public static PropertyBuilder builder() {
        return new PropertyBuilder();
    }

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

    public PropertyBuilder setProductId(Long productId) {
        this.productId = productId;
        return this;
    }

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

    public PropertyBuilder setIoType(Property.IoType ioType) {
        this.ioType = ioType;
        return this;
    }

    public Property build() {
        Property property = new Property();
        property.setName(name);
        property.setProductId(productId);
        property.setDataType(dataType);
        property.setIoType(ioType);
        return property;
    }
}
