@Override public WorkflowSpecification deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObj = json.getAsJsonObject(); String className = jsonObj.get("className").getAsString(); String name = jsonObj.get("name").getAsString(); String description = jsonObj.get("description").getAsString(); Map<String, Plugin> plugins = deserializeMap(jsonObj.get("plugins"), context, Plugin.class); Map<String, String> properties = deserializeMap(jsonObj.get("properties"), context, String.class); List<WorkflowNode> nodes = deserializeList(jsonObj.get("nodes"), context, WorkflowNode.class); Map<String, DatasetCreationSpec> localDatasetSpec = deserializeMap(jsonObj.get("localDatasetSpecs"), context, DatasetCreationSpec.class); return new WorkflowSpecification(className, name, description, properties, nodes, localDatasetSpec, plugins); } }
@Override public WorkflowSpecification deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObj = json.getAsJsonObject(); String className = jsonObj.get("className").getAsString(); String name = jsonObj.get("name").getAsString(); String description = jsonObj.get("description").getAsString(); Map<String, Plugin> plugins = deserializeMap(jsonObj.get("plugins"), context, Plugin.class); Map<String, String> properties = deserializeMap(jsonObj.get("properties"), context, String.class); List<WorkflowNode> nodes = deserializeList(jsonObj.get("nodes"), context, WorkflowNode.class); Map<String, DatasetCreationSpec> localDatasetSpec = deserializeMap(jsonObj.get("localDatasetSpecs"), context, DatasetCreationSpec.class); return new WorkflowSpecification(className, name, description, properties, nodes, localDatasetSpec, plugins); } }