@Override 
    public void enableSupportForSerializationIfApplicable(CancelIndicator cancelIndicator) {
        if (!IterableExtensions.isNullOrEmpty(targetConfig.protoFiles)) {
            // Enable support for proto serialization
            enabledSerializers.add(SupportedSerializers.PROTO);
        }
        for (SupportedSerializers serialization : enabledSerializers) {
            switch (serialization) {
                case NATIVE: {
                    FedNativePythonSerialization pickler = new FedNativePythonSerialization();
                    code.pr(pickler.generatePreambleForSupport().toString());
                }
                case PROTO: {
                    // Handle .proto files.
                    for (String name : targetConfig.protoFiles) {
                        this.processProtoFile(name, cancelIndicator);
                        int dotIndex = name.lastIndexOf(".");
                        String rootFilename = dotIndex > 0 ? name.substring(0, dotIndex) : name;
                        pythonPreamble.pr("import "+rootFilename+"_pb2 as "+rootFilename);
                        protoNames.add(rootFilename);
                    }
                }
                case ROS2: {
                    // FIXME: Not supported yet
                }
            }
        }
    }
@Override 
    public void enableSupportForSerializationIfApplicable(CancelIndicator cancelIndicator) {
        if (!IterableExtensions.isNullOrEmpty(targetConfig.protoFiles)) {
           
            enabledSerializers.add(SupportedSerializers.PROTO);
        }
        for (SupportedSerializers serialization : enabledSerializers) {
            switch (serialization) {
                case NATIVE: {
                    FedNativePythonSerialization pickler = new FedNativePythonSerialization();
                    code.pr(pickler.generatePreambleForSupport().toString());
                }
                case PROTO: {
                   
                    for (String name : targetConfig.protoFiles) {
                        this.processProtoFile(name, cancelIndicator);
                        int dotIndex = name.lastIndexOf(".");
                        String rootFilename = dotIndex > 0 ? name.substring(0, dotIndex) : name;
                        pythonPreamble.pr("import "+rootFilename+"_pb2 as "+rootFilename);
                        protoNames.add(rootFilename);
                    }
                }
                case ROS2: {
                   
                }
            }
        }
    }
@override public void enablesupportforserializationifapplicable(cancelindicator cancelindicator) { if (!iterableextensions.isnullorempty(targetconfig.protofiles)) { enabledserializers.add(supportedserializers.proto); } for (supportedserializers serialization : enabledserializers) { switch (serialization) { case native: { fednativepythonserialization pickler = new fednativepythonserialization(); code.pr(pickler.generatepreambleforsupport().tostring()); } case proto: { for (string name : targetconfig.protofiles) { this.processprotofile(name, cancelindicator); int dotindex = name.lastindexof("."); string rootfilename = dotindex > 0 ? name.substring(0, dotindex) : name; pythonpreamble.pr("import "+rootfilename+"_pb2 as "+rootfilename); protonames.add(rootfilename); } } case ros2: { } } } }