Source:
public static Flow flowFromObject(final Object object) { final Map<String, Object> flowObject = (Map<String, Object>) object; final String id = (String) flowObject.get("id"); final Boolean layedout = (Boolean) flowObject.get("layedout"); final Boolean isEmbeddedFlow = (Boolean) flowObject.get("embeddedFlow"); final Boolean isAzkabanFlowVersion20 = (Boolean) flowObject.get("azkabanFlowVersion20"); final Flow flow = new Flow(id); if (layedout != null) { flow.setLayedOut(layedout); } if (isEmbeddedFlow != null) { flow.setEmbeddedFlow(isEmbeddedFlow); } if (isAzkabanFlowVersion20 != null) { flow.setAzkabanFlowVersion20(isAzkabanFlowVersion20); } final int projId = (Integer) flowObject.get("project.id"); flow.setProjectId(projId); final int version = (Integer) flowObject.get("version"); flow.setVersion(version); final List<Object> propertiesList = (List<Object>) flowObject.get("props"); final Map<String, FlowProps> properties = loadPropertiesFromObject(propertiesList); flow.addAllFlowProperties(properties.values()); final List<Object> nodeList = (List<Object>) flowObject.get("nodes"); final Map<String, Node> nodes = loadNodesFromObjects(nodeList); flow.addAllNodes(nodes.values()); final List<Object> edgeList = (List<Object>) flowObject.get("edges"); final List<Edge> edges = loadEdgeFromObjects(edgeList, nodes); flow.addAllEdges(edges); final Map<String, Object> metadata = (Map<String, Object>) flowObject.get("metadata"); if (metadata != null) { flow.setMetadata(metadata); } flow.failureEmail = (List<String>) flowObject.get("failure.email"); flow.successEmail = (List<String>) flowObject.get("success.email"); if (flowObject.containsKey("mailCreator")) { flow.mailCreator = flowObject.get("mailCreator").toString(); } return flow; }

Target:
public static Flow flowFromObject(final Object object) { final Map<String, Object> flowObject = (Map<String, Object>) object; final String id = (String) flowObject.get("id"); final Boolean layedout = (Boolean) flowObject.get("layedout"); final Boolean isEmbeddedFlow = (Boolean) flowObject.get("embeddedFlow"); final Double azkabanFlowVersion = (Double) flowObject.get("azkabanFlowVersion"); final Flow flow = new Flow(id); if (layedout != null) { flow.setLayedOut(layedout); } if (isEmbeddedFlow != null) { flow.setEmbeddedFlow(isEmbeddedFlow); } if (azkabanFlowVersion != null) { flow.setAzkabanFlowVersion(azkabanFlowVersion); } final int projId = (Integer) flowObject.get("project.id"); flow.setProjectId(projId); final int version = (Integer) flowObject.get("version"); flow.setVersion(version); final List<Object> propertiesList = (List<Object>) flowObject.get("props"); final Map<String, FlowProps> properties = loadPropertiesFromObject(propertiesList); flow.addAllFlowProperties(properties.values()); final List<Object> nodeList = (List<Object>) flowObject.get("nodes"); final Map<String, Node> nodes = loadNodesFromObjects(nodeList); flow.addAllNodes(nodes.values()); final List<Object> edgeList = (List<Object>) flowObject.get("edges"); final List<Edge> edges = loadEdgeFromObjects(edgeList, nodes); flow.addAllEdges(edges); final Map<String, Object> metadata = (Map<String, Object>) flowObject.get("metadata"); if (metadata != null) { flow.setMetadata(metadata); } flow.failureEmail = (List<String>) flowObject.get("failure.email"); flow.successEmail = (List<String>) flowObject.get("success.email"); if (flowObject.containsKey("mailCreator")) { flow.mailCreator = flowObject.get("mailCreator").toString(); } return flow; }