package cz.senslog.connector.model.converter;

import cz.senslog.connector.model.api.Converter;
import cz.senslog.connector.model.fofr.FofrModel;
import cz.senslog.connector.model.fofr.ParcelUpdate;
import cz.senslog.connector.model.logger.LoggerModel;
import cz.senslog.connector.model.telemetry.TelemetryModel;

import java.util.Arrays;

public class FofrModelTelemetryModelConverter implements Converter<FofrModel, TelemetryModel> {

    @Override
    public TelemetryModel convert(FofrModel model) {
        String body = Arrays.toString(model.getUpdates().toArray(new ParcelUpdate[0]));
        return new TelemetryModel(body, model.getFrom(), model.getTo());
    }
}
