Commit 834bb17a authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade comprobación de type nulo

En caso de llegar de ais un type a null, se añade type por defecto
parent f1087c23
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -141,6 +141,10 @@ public class AISTrackingDTO extends org.apache.avro.specific.SpecificRecordBase
	}

	public void setType(Integer type) {

		if (type == null)
			this.type = 0;
		else
			this.type = type;
	}

@@ -236,7 +240,7 @@ public class AISTrackingDTO extends org.apache.avro.specific.SpecificRecordBase
	public void buildFromMap(Map<String, String> row) {

		this.setMmsi(parseInteger(row.get("MMSI")));
		this.setTstamp(DateTime.parse(row.get("TSTAMP"), DateTimeFormat.forPattern("yyy-MM-dd HH:mm:ss zzz")));
		this.setTstamp(DateTime.parse(row.get("TSTAMP"), DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss zzz")));
		this.setLatitude(parseDouble(row.get("LATITUDE")));
		this.setLongitude(parseDouble(row.get("LONGITUDE")));
		this.setCog(parseDouble(row.get("COG")));