Protocol buffers don't have a specific type for sets. One workaround you
could try would be to use something like map<int64, bool>, 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 a repeated field, and convert that to a Java Set when
you need it.

On Wed, Sep 12, 2018 at 4:42 AM qplc <[email protected]> wrote:

> 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 in
> java if I use above data type. Is there a specific data type that I can
> provide in my proto file to avoid List to Set conversion.
>
> 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 Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to