Search in sources :

Example 1 with DefaultFlowSpecification

use of co.cask.cdap.internal.flow.DefaultFlowSpecification in project cdap by caskdata.

the class FlowSpecificationCodec method deserialize.

@Override
public FlowSpecification 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, FlowletDefinition> flowlets = deserializeMap(jsonObj.get("flowlets"), context, FlowletDefinition.class);
    List<FlowletConnection> connections = deserializeList(jsonObj.get("connections"), context, FlowletConnection.class);
    return new DefaultFlowSpecification(className, name, description, flowlets, connections);
}
Also used : FlowletDefinition(co.cask.cdap.api.flow.FlowletDefinition) FlowletConnection(co.cask.cdap.api.flow.FlowletConnection) JsonObject(com.google.gson.JsonObject) DefaultFlowSpecification(co.cask.cdap.internal.flow.DefaultFlowSpecification)

Aggregations

FlowletConnection (co.cask.cdap.api.flow.FlowletConnection)1 FlowletDefinition (co.cask.cdap.api.flow.FlowletDefinition)1 DefaultFlowSpecification (co.cask.cdap.internal.flow.DefaultFlowSpecification)1 JsonObject (com.google.gson.JsonObject)1