/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.github.pires.obd.reader.net;

import java.util.HashMap;
import java.util.Map;

/**
 * DTO for OBD readings.
 */
public class ObdReading {
    private double latitude, longitude, altitude;
    private long timestamp;
    private String vehicleid; // vehicle id
    private Map<String, String> readings;

    public ObdReading() {
        readings = new HashMap<>();
    }

    public ObdReading(double latitude, double longitude, double altitude, long timestamp,
                      String vehicleid, Map<String, String> readings) {
        this.latitude = latitude;
        this.longitude = longitude;
        this.altitude = altitude;
        this.timestamp = timestamp;
        this.vehicleid = vehicleid;
        this.readings = readings;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getAltitude() {
        return altitude;
    }

    public void setAltitude(double altitude) {
        this.altitude = altitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getVin() {
        return vehicleid;
    }

    public void setVin(String vehicleid) {
        this.vehicleid = vehicleid;
    }

    public Map<String, String> getReadings() {
        return readings;
    }

    public void setReadings(Map<String, String> readings) {
        this.readings = readings;
    }

    public String toString() {

        return "lat:" + latitude + ";" +
                "long:" + longitude + ";" +
                "alt:" + altitude + ";" +
                "vehicleid:" + vehicleid + ";" +
                "readings:" + readings.toString().substring(10).replace("}", "").replace(",", ";");
    }

}

@@ -801,24 +801,18 @@
 String v
-ehicleid
+in
 ; // veh
@@ -1051,24 +1051,18 @@
 String v
-ehicleid
+in
 , Map%3CSt
@@ -1241,36 +1241,24 @@
   this.v
-ehicleid = vehicleid
+in = vin
 ;%0A      
@@ -1961,24 +1961,18 @@
 return v
-ehicleid
+in
 ;%0A    %7D%0A
@@ -2029,24 +2029,18 @@
   this.v
-ehicleid
+in
  = vehic
@@ -2413,30 +2413,18 @@
   %22v
-ehicleid:%22 + vehicleid
+in:%22 + vin
  + %22

Fix model property name to reflect naming in the server application