mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 17:49:40 +00:00
changed serialization type of GPSFixes for MongoDB to DBObject instead of Object
This commit is contained in:
1 parent
4dae5ea4c8
commit
7e9274d35a
4 files changed
+7
-7
No files matched your search
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.sap.sailing.domain.persistence.racelog.tracking;
|
||||
|
||||
import com.mongodb.DBObject;
|
||||
import com.sap.sailing.domain.common.racelog.tracking.TransformationHandler;
|
||||
import com.sap.sailing.domain.tracking.GPSFix;
|
||||
|
||||
@@ -11,5 +12,5 @@ import com.sap.sailing.domain.tracking.GPSFix;
|
||||
* @author Fredrik Teschke
|
||||
*
|
||||
*/
|
||||
public interface GPSFixMongoHandler extends TransformationHandler<GPSFix, Object> {
|
||||
public interface GPSFixMongoHandler extends TransformationHandler<GPSFix, DBObject> {
|
||||
}
|
||||
+2
-2
@@ -22,7 +22,7 @@ public class GPSFixMongoHandlerImpl implements GPSFixMongoHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object transformForth(GPSFix fix) throws IllegalArgumentException {
|
||||
public DBObject transformForth(GPSFix fix) throws IllegalArgumentException {
|
||||
DBObject result = new BasicDBObject();
|
||||
mof.storeTimed(fix, result);
|
||||
mof.storePositioned(fix, result);
|
||||
@@ -30,7 +30,7 @@ public class GPSFixMongoHandlerImpl implements GPSFixMongoHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GPSFix transformBack(Object object) {
|
||||
public GPSFix transformBack(DBObject object) {
|
||||
DBObject dbObject = (DBObject) object;
|
||||
TimePoint timePoint = dof.loadTimePoint(dbObject);
|
||||
Position position = dof.loadPosition(dbObject);
|
||||
|
||||
+2
-3
@@ -24,7 +24,7 @@ public class GPSFixMovingMongoHandlerImpl implements GPSFixMongoHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object transformForth(GPSFix fix) throws IllegalArgumentException {
|
||||
public DBObject transformForth(GPSFix fix) throws IllegalArgumentException {
|
||||
DBObject result = new BasicDBObject();
|
||||
mof.storeTimed(fix, result);
|
||||
mof.storePositioned(fix, result);
|
||||
@@ -33,8 +33,7 @@ public class GPSFixMovingMongoHandlerImpl implements GPSFixMongoHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GPSFix transformBack(Object object) {
|
||||
DBObject dbObject = (DBObject) object;
|
||||
public GPSFix transformBack(DBObject dbObject) {
|
||||
TimePoint timePoint = dof.loadTimePoint(dbObject);
|
||||
Position position = dof.loadPosition(dbObject);
|
||||
SpeedWithBearing speed = dof.loadSpeedWithBearing(dbObject);
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class MongoGPSFixStoreImpl implements MongoGPSFixStore {
|
||||
|
||||
private GPSFix loadGPSFix(DBObject object) throws TransformationException, NoCorrespondingServiceRegisteredException {
|
||||
String type = (String) object.get(FieldNames.GPSFIX_TYPE.name());
|
||||
Object fixObject = object.get(FieldNames.GPSFIX.name());
|
||||
DBObject fixObject = (DBObject) object.get(FieldNames.GPSFIX.name());
|
||||
return fixServiceFinder.findService(type).transformBack(fixObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user