package lc.esp.sdk.telemetry;

import java.io.Serializable;
import java.util.Objects;

public class TelemetrySymbol {
    private final String name;
    private final Serializable value;
    private final String uom;
    private final String uot;
    private final boolean isLos;

    public TelemetrySymbol(String name, Serializable value, String uom, String uot, boolean isLos) {
        this.name = name;
        this.value = value;
        this.uom = uom;
        this.uot = uot;
        this.isLos = isLos;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TelemetrySymbol that = (TelemetrySymbol) o;
        return isLos == that.isLos && Objects.equals(name, that.name) && Objects.equals(value, that.value) && Objects.equals(uom, that.uom) && Objects.equals(uot, that.uot);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, value, uom, uot, isLos);
    }

    @Override
    public String toString() {
        return "TelemetrySymbol{" +
                "name='" + name + '\'' +
                ", value=" + value +
                ", uom='" + uom + '\'' +
                ", uot='" + uot + '\'' +
                ", isLos=" + isLos +
                '}';
    }

    public boolean isLos() {
        return isLos;
    }

    public String getUom() {
        return uom;
    }

    public String getUot() {
        return uot;
    }

    public String getName() {
        return name;
    }

    public Serializable getValue() {
        return value;
    }
}
