package cz.senslog.connector.model.v2;

import java.time.LocalDateTime;

import static cz.senslog.connector.tools.json.BasicJson.objectToJson;

/**
 * The class {@code Observation} represents a record for Senslog V2.
 *
 * @author Lukas Cerny
 * @version 1.0
 * @since 1.0
 */
public class Observation {

    // TODO which value (eur/unitId or sensorId?
    private Long id;

    /** Identifier of specific sensor which measured the value (e.q. temperature, humidity, etc...). */
    private Long sensorId; // TODO this value does not exist

    /** Concrete value of the sensor. */
    private Double value;

    /** Timestamp when the value was measured. */
    private LocalDateTime timestamp; // YYYY-MM-DDTHH:MM:SS

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSensorId() {
        return sensorId;
    }

    public void setSensorId(Long sensorId) {
        this.sensorId = sensorId;
    }

    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(LocalDateTime timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public String toString() {
        return objectToJson(this);
    }
}
