// Copyright (c) 2020 UWB & LESP.
// The UWB & LESP license this file to you under the MIT license.

package cz.senslog.connector.model.v1;

import java.time.OffsetDateTime;
import java.time.ZonedDateTime;

import static java.time.format.DateTimeFormatter.ofPattern;


public abstract class Record {

    /** Identifier of area for sensors */
    private Long unitId;

    /** Timestamp when the value was measured. */
    private OffsetDateTime time;

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public OffsetDateTime getTime() {
        return time;
    }

    public String getFormattedTime() {
        return time != null ? time.format(ofPattern("yyyy-MM-dd HH:mm:ssZ")) : "";
    }

    public void setTime(OffsetDateTime time) {
        this.time = time;
    }

}
