using System;
using InfluxDB.Client.Api.Domain;
using InfluxDB.Client.Core.Flux.Domain;
using InfluxDB.Client.Core.Flux.Internal;
using InfluxDB.Client.Writes;
namespace InfluxDB.Client.Internal
{
///
/// Default implementation of DomainObject mapper.
///
internal class DefaultDomainObjectMapper : IDomainObjectMapper
{
private readonly FluxResultMapper _resultMapper = new FluxResultMapper();
private readonly MeasurementMapper _measurementMapper = new MeasurementMapper();
public T ConvertToEntity(FluxRecord fluxRecord)
{
return _resultMapper.ToPoco(fluxRecord);
}
public object ConvertToEntity(FluxRecord fluxRecord, Type type)
{
return _resultMapper.ToPoco(fluxRecord, type);
}
public PointData ConvertToPointData(T entity, WritePrecision precision)
{
return _measurementMapper.ToPoint(entity, precision);
}
}
}