class FlowElementConverter extends AbstractConverter {

    public Result<BpmnNode> convertNode(FlowElement flowElement) {
        return Match.<FlowElement, Result<BpmnNode>>of()
                .<StartEvent>when(e -> e instanceof StartEvent,
                                  converterFactory.startEventConverter()::convert)
                .<EndEvent>when(e -> e instanceof EndEvent,
                                converterFactory.endEventConverter()::convert)
                .<BoundaryEvent>when(e -> e instanceof BoundaryEvent,
                                     converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent)
                .<IntermediateCatchEvent>when(e -> e instanceof IntermediateCatchEvent,
                                              converterFactory.intermediateCatchEventConverter()::convert)
                .<IntermediateThrowEvent>when(e -> e instanceof IntermediateThrowEvent,
                                              converterFactory.intermediateThrowEventConverter()::convert)
                .<Task>when(e -> e instanceof Task,
                            converterFactory.taskConverter()::convert)
                .<Gateway>when(e -> e instanceof Gateway,
                               converterFactory.gatewayConverter()::convert)
                .<SubProcess>when(e -> e instanceof SubProcess,
                                  converterFactory.subProcessConverter()::convertSubProcess)
                .<CallActivity>when(e -> e instanceof CallActivity,
                                    converterFactory.callActivityConverter()::convert)
                .<TextAnnotation>when(e -> e instanceof TextAnnotation,
                                      converterFactory.textAnnotationConverter()::convert)
                .<DataObjectReference>when(e -> e instanceof DataObjectReference,
                                  converterFactory.dataObjectConverter()::convert)
                .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class)
                .ignore(e -> e instanceof DataObject, DataObject.class)
                .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement)))
                .inputDecorator(BPMNElementDecorators.flowElementDecorator())
                .outputDecorator(BPMNElementDecorators.resultBpmnDecorator())
                .mode(getMode())
                .apply(flowElement)
                .value();
    }

    public  FlowElementConverter(BaseConverterFactory converterFactory);

}