[protobuf] Re: Defining wrapper types in proto file

2018-09-13 Thread qplc
Thanks Adam for your valuable response. On Wednesday, September 12, 2018 at 1:30:14 PM UTC+5:30, qplc wrote: > > Hi, > > How do I define wrapper Long value in .proto file. Can anyone help in this? > > > Thanks, > qplc > -- You received this message because you are subscribed to the Google

Re: [protobuf] Re: Defining wrapper types in proto file

2018-09-12 Thread 'Adam Cozzette' via Protocol Buffers
Protocol buffers don't have a specific type for sets. One workaround you could try would be to use something like map, and just ignore the bool values, since that would give you a way of ensuring the int64 keys are unique. But I would guess it would be cleaner to go with Marc's suggestion and use

[protobuf] Re: Defining wrapper types in proto file

2018-09-12 Thread qplc
Hi Marc, Thanks a lot for your reply. But I think the type "repeated .google.protobuf.Int64Value attribute7" can't replace java.Util.Set. As it clearly compile into java.Util.List type. Hence, it will allow duplicate elements. And to find set of unique elements I'll have to convert List to Set

Re: [protobuf] Re: Defining wrapper types in proto file

2018-09-12 Thread Marc Gravell
Are you talking about Java's Long here? If so, frankly I'd say: in your DTO layer, use whatever type protoc wants to use for your data, and just use: syntax = "proto3"; message TestMessage{ string attribute1 = 1; map attribute2 = 2; int64 attribute3 = 3; int32 attribute4 = 4;

[protobuf] Re: Defining wrapper types in proto file

2018-09-12 Thread qplc
Hi Marc, Thanks for you reply. Here, I'm trying to create a user defined message given follow. Class TestMessage{ String attribute1; Map attribute2; long attribute3; int attribute4; Long attribute5; Integer attribute6; Set