mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 17:49:40 +00:00
added additional fields to track file import identifier
This commit is contained in:
1 parent
bf8ebdc09a
commit
49ca30c0a1
12 files changed
+117
-50
No files matched your search
+6
-2
@@ -205,14 +205,18 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private TimePoint loadTimePoint(DBObject object, FieldNames field) {
|
||||
public static TimePoint loadTimePoint(DBObject object, String fieldName) {
|
||||
TimePoint result = null;
|
||||
Number timePointAsNumber = (Number) object.get(field.name());
|
||||
Number timePointAsNumber = (Number) object.get(fieldName);
|
||||
if (timePointAsNumber != null) {
|
||||
result = new MillisecondsTimePoint(timePointAsNumber.longValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static TimePoint loadTimePoint(DBObject object, FieldNames field) {
|
||||
return loadTimePoint(object, field.name());
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a {@link TimePoint} on the given object at {@link FieldNames#TIME_AS_MILLIS}.
|
||||
|
||||
+6
-2
@@ -139,11 +139,15 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void storeTimePoint(TimePoint timePoint, DBObject result, FieldNames field) {
|
||||
public static void storeTimePoint(TimePoint timePoint, DBObject result, String fieldName) {
|
||||
if (timePoint != null) {
|
||||
result.put(field.name(), timePoint.asMillis());
|
||||
result.put(fieldName, timePoint.asMillis());
|
||||
}
|
||||
}
|
||||
|
||||
public static void storeTimePoint(TimePoint timePoint, DBObject result, FieldNames field) {
|
||||
storeTimePoint(timePoint, result, field.name());
|
||||
}
|
||||
|
||||
public void storeTimed(Timed timed, DBObject result) {
|
||||
if (timed.getTimePoint() != null) {
|
||||
|
||||
Reference in new issue
Block a user