com.geotab.model.entity.diagnostic.DataDiagnostic Maven / Gradle / Ivy
/*
*
* 2020 Copyright (C) Geotab Inc. All rights reserved.
*/
package com.geotab.model.entity.diagnostic;
import com.geotab.model.entity.controller.Controller;
import com.geotab.model.entity.enginetype.EngineType;
import com.geotab.model.entity.source.Source;
import com.geotab.model.entity.unitofmeasure.UnitOfMeasure;
import com.geotab.model.enumeration.DiagnosticType;
import com.geotab.model.enumeration.FaultResetMode;
import com.geotab.model.enumeration.ValidLoggingPeriod;
import java.util.Optional;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* A {@link Diagnostic} that represents measurement data from the vehicle (as opposed to fault
* codes).
*/
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class DataDiagnostic extends Diagnostic {
private Double conversion;
private Integer dataLength;
private Double offset;
@Builder(builderMethodName = "dataDiagnosticBuilder")
public DataDiagnostic(String id, String name, Long version, Integer code, Controller controller,
DiagnosticType diagnosticType, EngineType engineType, FaultResetMode faultResetMode,
Source source, UnitOfMeasure unitOfMeasure, ValidLoggingPeriod validLoggingPeriod,
Boolean isLogGuaranteedOnEstimateError, Double conversion, Integer dataLength,
Double offset) {
super(id, name, version, code, controller,
Optional.ofNullable(diagnosticType).orElse(DiagnosticType.DATA_DIAGNOSTIC),
engineType, faultResetMode, source, unitOfMeasure, validLoggingPeriod,
isLogGuaranteedOnEstimateError);
this.conversion = conversion;
this.dataLength = dataLength;
this.offset = offset;
}
}