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<string,string> attribute2 = 2;
    int64 attribute3 = 3;
    int32 attribute4 = 4;
    int64 attribute5 = 5;
    int32 attribute6 = 6;
    repeated int64 attribute7 = 7;
}

However; there *is* also wrappers.proto (
https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/wrappers.proto)
which allows something similar, but that
uses com.google.protobuf.Int64Value, not Java.Lang.Long; but if you want to
try it:

syntax = "proto3";
import "google/protobuf/wrappers.proto";
message TestMessage{
    string attribute1 = 1;
    map<string,string> attribute2 = 2;
    int64 attribute3 = 3;
    int32 attribute4 = 4;
    .google.protobuf.Int64Value attribute5 = 5;
    .google.protobuf.Int32Value attribute6 = 6;
    repeated .google.protobuf.Int64Value attribute7 = 7;
}



On Wed, 12 Sep 2018 at 09:44, qplc <[email protected]> wrote:

> Hi Marc,
>
> Thanks for you reply. Here, I'm trying to create a user defined message
> given follow.
>
> Class TestMessage{
>           String attribute1;
>           Map<String, String> attribute2;
>           long attribute3;
>           int attribute4;
>           Long attribute5;
>           Integer attribute6;
>           Set<Long> attribute7;
> }
>
> I want to define above message format in .proto file. Hence, I've created
> following message.
> message TestMessage{
>           string attribute1 = 1;
>           map<string,string> attribute2 = 2;
>           int64 attribute3 = 3;
> }
>
> But, I'm not sure how do I define attribute5, attribute6 and attribute7 in
> proto file. Please help me on this.
>
>
> 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.
>


-- 
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 [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