mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
refactored UUID conversion: instead of a string a serializable is
expected for tryUUIDConversion method
This commit is contained in:
1 parent
7bb49f219b
commit
a474942f03
9 files changed
+18
-14
No files matched your search
+3
-1
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.racecommittee.app.deserialization.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.base.CourseArea;
|
||||
@@ -14,7 +16,7 @@ public class CourseAreaJsonDeserializer implements JsonDeserializer<CourseArea>
|
||||
public CourseArea deserialize(JSONObject object)
|
||||
throws JsonDeserializationException {
|
||||
String name = object.get(CourseAreaJsonSerializer.FIELD_NAME).toString();
|
||||
String id = object.get(CourseAreaJsonSerializer.FIELD_ID).toString();
|
||||
Serializable id = (Serializable) object.get(CourseAreaJsonSerializer.FIELD_ID);
|
||||
|
||||
return new CourseAreaImpl(name, Helpers.tryUuidConversion(id));
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.racecommittee.app.deserialization.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.base.EventBase;
|
||||
@@ -18,7 +20,7 @@ public class EventDataJsonDeserializer implements JsonDeserializer<EventBase> {
|
||||
}
|
||||
|
||||
public EventBase deserialize(JSONObject object) throws JsonDeserializationException {
|
||||
String id = object.get(EventDataJsonSerializer.FIELD_ID).toString();
|
||||
Serializable id = (Serializable) object.get(EventDataJsonSerializer.FIELD_ID);
|
||||
String name = object.get(EventDataJsonSerializer.FIELD_NAME).toString();
|
||||
String publicationUrl = object.get(EventDataJsonSerializer.FIELD_PUBLICATION_URL).toString();
|
||||
|
||||
|
||||
Reference in new issue
Block a user