package cz.senslog.analytics.domain;

import java.time.OffsetDateTime;

public class AnalyticObservation implements TimeSeriesDatasource {

    private final Observation observation;
    private final long analyticGroupId;

    public static AnalyticObservation of(Observation observation, long analyticGroup) {
        return new AnalyticObservation(observation, analyticGroup);
    }

    private AnalyticObservation(Observation observation, long analyticGroupId) {
        this.observation = observation;
        this.analyticGroupId = analyticGroupId;
    }

    @Override
    public long datasourceId() {
        return observation.datasourceId();
    }

    @Override
    public OffsetDateTime timestamp() {
        return observation.timestamp();
    }

    public double value() {
        return observation.value();
    }

    public long analyticGroupId() {
        return analyticGroupId;
    }

    public Sensor sensor() {
        return observation.sensor();
    }
}
