mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-18 11:49:09 +00:00
SettingsToJsonSerializer can now directly (de)serialize from/to Strings
Changed the test accordingly
This commit is contained in:
+2
-5
@@ -1,8 +1,5 @@
|
||||
package com.sap.sse.shared.android.test;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
|
||||
import com.sap.sse.common.settings.generic.GenericSerializableSettings;
|
||||
import com.sap.sse.shared.settings.SettingsToJsonSerializer;
|
||||
|
||||
@@ -14,11 +11,11 @@ public class SettingsToJsonSerializationTest extends AbstractSettingsSerializati
|
||||
protected <T extends GenericSerializableSettings> String serialize(T settings) throws Exception {
|
||||
// Do not change this to return a JSONOBject instance.
|
||||
// JSONOBject is just a HashMap and you only know if it is really JSON serializable if you do it!
|
||||
return serializer.serialize(settings).toJSONString();
|
||||
return serializer.serializeToString(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T extends GenericSerializableSettings> T deserialize(String serializedObject, T settings) throws Exception {
|
||||
return serializer.deserialize(settings, (JSONObject) new JSONParser().parse(serializedObject));
|
||||
return serializer.deserialize(settings, serializedObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user