// Enable support for proto serialization
@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
                }
            }
        }
    }
public void enableSupportForSerializationIfApplicable(CancelIndicator cancelIndicator) {
if (!IterableExtensions.isNullOrEmpty(targetConfig.protoFiles)) {
// Enable support for proto serialization
enabledSerializers.add(SupportedSerializers.PROTO);
}
@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.
@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