mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 14:20:55 +00:00
# resource handling and loading for events
This commit is contained in:
1 parent
3de188f98b
commit
594acb1743
13 files changed
+175
-133
No files matched your search
+9
@@ -7,6 +7,15 @@ import com.sap.sailing.server.gateway.deserialization.JsonDeserializationExcepti
|
||||
|
||||
public class Helpers {
|
||||
|
||||
public static JSONArray toJSONArraySafe(Object object)
|
||||
throws JsonDeserializationException {
|
||||
if (object instanceof JSONArray) {
|
||||
return (JSONArray) object;
|
||||
}
|
||||
throw new JsonDeserializationException(
|
||||
String.format("Expected a JSONArray, got %s.", object.getClass().getName()));
|
||||
}
|
||||
|
||||
public static JSONObject toJSONObjectSafe(Object object)
|
||||
throws JsonDeserializationException {
|
||||
if (object instanceof JSONObject) {
|
||||
|
||||
Reference in new issue
Block a user