--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/8135f496-9ec3-4e0d-bff2-dd37d85792bc%40googlegroups.com.
"string id = 1[json_name = \"id\", (.javaleo.proto.javatype) = \"uuid\"];\n"
The line in the proto-file looks like this:
string id = 1 [(javaleo.proto.javatype) = "uuid"];
To unsubscribe from this group and stop receiving emails from it, send an email to prot...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/0fe72ed2-c773-4233-9572-0ba2c1ccc657%40googlegroups.com.
field->options().DebugString()
returns
"51234: \"uuid\"\n"
So he even got the ID right that is defined here:
syntax = "proto3";
import "google/protobuf/descriptor.proto";
package javaleo.proto;
extend google.protobuf.FieldOptions {
string javatype = 51234;
}
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/0fe72ed2-c773-4233-9572-0ba2c1ccc657%40googlegroups.com.
string id = 1 [(javaleo.proto.javatype) = "java.util.UUID"];
For example I can shorten my package from "javaleo.proto" to "leo". Or better, is there a way to "statically import" an option, so that I only need to write "(javatype) = ..."?
Also can I generify the "java.util.UUID"-string into a constant that I can reuse? I'm thinking about something like a enum with a value.
Optimally it should something look like this
string id = 1 [javatype = UUID];
with a enum
enum Types {
UUID = 0 [name="java.util.UUID"];
}
If this is not possible, I will simply copy paste the same string everywhere, just wondering if there's a better fay :)