0

Java class has a List<Object> Property , how definition List<Object> in protocol buffers proto file,as google protocol buffers no support Object of java world ?


In general, protocol buffer message types exist independently of standard Java value types, or sometimes Java value types are implemented as wrappers around protocol buffers.

In this specific case, however, the protocol buffer compiler compiles repeated fields to Java Lists. Of course, you'll need to figure out how to protobuffify the objects in the list, but your question doesn't give us enough information to help with that.

4

1 回答 1

1

In general, protocol buffer message types exist independently of standard Java value types, or sometimes Java value types are implemented as wrappers around protocol buffers.

In this specific case, however, the protocol buffer compiler compiles repeated fields to Java Lists. Of course, you'll need to figure out how to protobuffify the objects in the list, but your question doesn't give us enough information to help with that.

于 2012-07-30T10:00:55.840 回答