class ResourceGeneratorFactory {

    public Optional<AbstractResourceGenerator> create(GeneratorContext context,
                                                      WorkflowProcess process,
                                                      String modelfqcn,
                                                      String processfqcn,
                                                      String appCanonicalName) {

        return GeneratorType
                .from(context)
                .map(type -> {
                    switch (type) {
                        case SPRING:
                            return new SpringResourceGenerator(context,
                                                               process,
                                                               modelfqcn,
                                                               processfqcn,
                                                               appCanonicalName);
                        case QUARKUS:
                            return new ResourceGenerator(context,
                                                         process,
                                                         modelfqcn,
                                                         processfqcn,
                                                         appCanonicalName);
                        case QUARKUS_REACTIVE:
                            return new ReactiveResourceGenerator(context,
                                                                 process,
                                                                 modelfqcn,
                                                                 processfqcn,
                                                                 appCanonicalName);
                        default:
                            throw new NoSuchElementException("No Resource Generator for: " + type);
                    }
                });
    }

}