class SiddhiPlan {

    @SuppressWarnings("unchecked")
    public static SiddhiPlan fromMap(Map<String, Object> map) throws ExecutionPlanException {
        String id = getField(map, "id", String.class);
        List<String> inputTopics = getField(map, "input", List.class);
        Map<String, String> outputTopics = getField(map, "output", Map.class);
        Map<String, String> filters = getField(map, "filters", Collections.emptyMap(), Map.class);
        String plan = getField(map, "executionPlan", String.class);
        Integer version = getField(map, "version", 0, Integer.class);

        return new SiddhiPlan(id, version, inputTopics, outputTopics, filters, plan);
    }

    public  SiddhiPlan(String id, int version, List<String> inputTopics,
                      Map<String, String> outputTopics, Map<String, String> filters,
                      String executionPlan);

}