Discussion:
[protobuf] define Set<Map<String,Object>> message ,what should I do?
w***@gmail.com
2018-11-23 08:31:16 UTC
Permalink
I want define a message. Example: Set<Map<String,Object>> please help me.
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Marc Gravell
2018-11-23 08:35:27 UTC
Permalink
"set" isn't a protobuf concept - the closest that exists is "repeated";
likewise "object" - ideally using some defined message type. Putting those
together, that gives you:

syntax = "proto3";

message SomeRoot {
repeated SomeLeaf items = 1;
}
message SomeLeaf {
map<string,SomeVal> values = 1;
}
message SomeVal {
// ...
}
Post by w***@gmail.com
I want define a message. Example: Set<Map<String,Object>> please help me.
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
--
Regards,

Marc
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
w***@gmail.com
2018-11-23 08:49:56 UTC
Permalink
thank you very much!

圚 2018幎11月23日星期五 UTC+8䞋午4:35:43Marc Gravell写道
Post by Marc Gravell
"set" isn't a protobuf concept - the closest that exists is "repeated";
likewise "object" - ideally using some defined message type. Putting those
syntax = "proto3";
message SomeRoot {
repeated SomeLeaf items = 1;
}
message SomeLeaf {
map<string,SomeVal> values = 1;
}
message SomeVal {
// ...
}
Post by w***@gmail.com
I want define a message. Example: Set<Map<String,Object>> please help me.
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
--
Regards,
Marc
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Loading...