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

import com.zsc.edu.gateway.domain.system.BaseEntityBuilder;
import com.zsc.edu.gateway.modules.iot.device.entity.Device;
import com.zsc.edu.gateway.modules.system.entity.BaseEntity;

public class DeviceBuilder extends BaseEntityBuilder {

    private String name;
    private Device.Status state = Device.Status.UNACTIVATED;
    private Boolean online = false;

    public static DeviceBuilder aDevice() {
        return new DeviceBuilder();
    }

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

    public DeviceBuilder state(Device.Status state) {
        this.state = state;
        return this;
    }

    public DeviceBuilder online(Boolean online) {
        this.online = online;
        return this;
    }

    public Device build() {
        Device device = new Device();
        device.setName(name);
        device.setState(state);
        device.setOnline(online);
        return device;
    }
}
