package easydo.technology.core;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import zmo.technology.lite.core.ZeroCoreStructs;

public class DeviceSensor extends ZeroCoreStructs {

    public static final String DEVICE_UPPER_COMPUTER = "DEVICE_UPPER_COMPUTER";
    public static final String DEVICE_UPPER_COMPLETE = "DEVICE_UPPER_COMPLETE";

    private DeviceStock device;
    private String sensorType;
    private String sensorID;

    private List<DeviceSensorRecord> records;

    public DeviceSensor() {
        super();
    }

    public DeviceSensor(ResultSet set) throws SQLException {
        super(set);

        if (inResultSet(set, "DEVICE_ID")) {
            device = new DeviceStock();
            device.setId(set.getInt("DEVICE_ID"));
        }

        if (inResultSet(set, "SENSOR_TYPE"))
            sensorType = set.getString("SENSOR_TYPE");

        if (inResultSet(set, "SENSOR_ID"))
            sensorID = set.getString("SENSOR_ID");
    }

    public String getSensorType() {
        return sensorType;
    }

    public void setSensorType(String sensorType) {
        this.sensorType = sensorType;
    }

    public DeviceStock getDevice() {
        return device;
    }

    public void setDevice(DeviceStock device) {
        this.device = device;
    }

    public String getSensorID() {
        return sensorID;
    }

    public void setSensorID(String sensorID) {
        this.sensorID = sensorID;
    }

    public List<DeviceSensorRecord> getRecords() {
        return records;
    }

    public void setRecords(List<DeviceSensorRecord> records) {
        this.records = records;
    }

}
