Skip to content

Commit

Permalink
Add custom types on custom collections
Browse files Browse the repository at this point in the history
  • Loading branch information
thesamet committed Mar 24, 2019
1 parent 3929854 commit f88d2a4
Showing 1 changed file with 103 additions and 96 deletions.
199 changes: 103 additions & 96 deletions e2e/src/main/protobuf/collection_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto2";
package com.thesamet.proto.e2e;

import "scalapb/scalapb.proto";
import "custom_types.proto";

option (scalapb.options) = {
collection_type: "scala.collection.immutable.Seq"
Expand All @@ -25,117 +26,121 @@ message SubMsg {

// These get collection.immutable.Seq from the file-level definition.
message CollectionTypesMessage {
repeated int32 repeated_int32 = 31;
repeated int64 repeated_int64 = 32;
repeated uint32 repeated_uint32 = 33;
repeated uint64 repeated_uint64 = 34;
repeated sint32 repeated_sint32 = 35;
repeated sint64 repeated_sint64 = 36;
repeated fixed32 repeated_fixed32 = 37;
repeated fixed64 repeated_fixed64 = 38;
repeated sfixed32 repeated_sfixed32 = 39;
repeated sfixed64 repeated_sfixed64 = 40;
repeated float repeated_float = 41;
repeated double repeated_double = 42;
repeated bool repeated_bool = 43;
repeated string repeated_string = 44;
repeated bytes repeated_bytes = 45;
repeated Enum repeated_enum = 46;
repeated SubMsg repeated_msg = 47;
repeated int32 repeated_int32 = 31;
repeated int64 repeated_int64 = 32;
repeated uint32 repeated_uint32 = 33;
repeated uint64 repeated_uint64 = 34;
repeated sint32 repeated_sint32 = 35;
repeated sint64 repeated_sint64 = 36;
repeated fixed32 repeated_fixed32 = 37;
repeated fixed64 repeated_fixed64 = 38;
repeated sfixed32 repeated_sfixed32 = 39;
repeated sfixed64 repeated_sfixed64 = 40;
repeated float repeated_float = 41;
repeated double repeated_double = 42;
repeated bool repeated_bool = 43;
repeated string repeated_string = 44;
repeated bytes repeated_bytes = 45;
repeated Enum repeated_enum = 46;
repeated SubMsg repeated_msg = 47;
repeated CustomMessage.Name repeated_fullname = 48 [(scalapb.field).type = "com.thesamet.pb.FullName"];
}

message CollectionTypesVector {
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="Vector"];
repeated int64 repeated_int64 = 32 [(scalapb.field).collection_type="Vector"];
repeated uint32 repeated_uint32 = 33 [(scalapb.field).collection_type="Vector"];
repeated uint64 repeated_uint64 = 34 [(scalapb.field).collection_type="Vector"];
repeated sint32 repeated_sint32 = 35 [(scalapb.field).collection_type="Vector"];
repeated sint64 repeated_sint64 = 36 [(scalapb.field).collection_type="Vector"];
repeated fixed32 repeated_fixed32 = 37 [(scalapb.field).collection_type="Vector"];
repeated fixed64 repeated_fixed64 = 38 [(scalapb.field).collection_type="Vector"];
repeated sfixed32 repeated_sfixed32 = 39 [(scalapb.field).collection_type="Vector"];
repeated sfixed64 repeated_sfixed64 = 40 [(scalapb.field).collection_type="Vector"];
repeated float repeated_float = 41 [(scalapb.field).collection_type="Vector"];
repeated double repeated_double = 42 [(scalapb.field).collection_type="Vector"];
repeated bool repeated_bool = 43 [(scalapb.field).collection_type="Vector"];
repeated string repeated_string = 44 [(scalapb.field).collection_type="Vector"];
repeated bytes repeated_bytes = 45 [(scalapb.field).collection_type="Vector"];
repeated Enum repeated_enum = 46 [(scalapb.field).collection_type="Vector"];
repeated SubMsg repeated_msg = 47 [(scalapb.field).collection_type="Vector"];
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="Vector"];
repeated int64 repeated_int64 = 32 [(scalapb.field).collection_type="Vector"];
repeated uint32 repeated_uint32 = 33 [(scalapb.field).collection_type="Vector"];
repeated uint64 repeated_uint64 = 34 [(scalapb.field).collection_type="Vector"];
repeated sint32 repeated_sint32 = 35 [(scalapb.field).collection_type="Vector"];
repeated sint64 repeated_sint64 = 36 [(scalapb.field).collection_type="Vector"];
repeated fixed32 repeated_fixed32 = 37 [(scalapb.field).collection_type="Vector"];
repeated fixed64 repeated_fixed64 = 38 [(scalapb.field).collection_type="Vector"];
repeated sfixed32 repeated_sfixed32 = 39 [(scalapb.field).collection_type="Vector"];
repeated sfixed64 repeated_sfixed64 = 40 [(scalapb.field).collection_type="Vector"];
repeated float repeated_float = 41 [(scalapb.field).collection_type="Vector"];
repeated double repeated_double = 42 [(scalapb.field).collection_type="Vector"];
repeated bool repeated_bool = 43 [(scalapb.field).collection_type="Vector"];
repeated string repeated_string = 44 [(scalapb.field).collection_type="Vector"];
repeated bytes repeated_bytes = 45 [(scalapb.field).collection_type="Vector"];
repeated Enum repeated_enum = 46 [(scalapb.field).collection_type="Vector"];
repeated SubMsg repeated_msg = 47 [(scalapb.field).collection_type="Vector"];
repeated CustomMessage.Name repeated_fullname = 48 [(scalapb.field).collection_type="Vector", (scalapb.field).type = "com.thesamet.pb.FullName"];
}

message CollectionTypesList {
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="List"];
repeated int64 repeated_int64 = 32 [(scalapb.field).collection_type="List"];
repeated uint32 repeated_uint32 = 33 [(scalapb.field).collection_type="List"];
repeated uint64 repeated_uint64 = 34 [(scalapb.field).collection_type="List"];
repeated sint32 repeated_sint32 = 35 [(scalapb.field).collection_type="List"];
repeated sint64 repeated_sint64 = 36 [(scalapb.field).collection_type="List"];
repeated fixed32 repeated_fixed32 = 37 [(scalapb.field).collection_type="List"];
repeated fixed64 repeated_fixed64 = 38 [(scalapb.field).collection_type="List"];
repeated sfixed32 repeated_sfixed32 = 39 [(scalapb.field).collection_type="List"];
repeated sfixed64 repeated_sfixed64 = 40 [(scalapb.field).collection_type="List"];
repeated float repeated_float = 41 [(scalapb.field).collection_type="List"];
repeated double repeated_double = 42 [(scalapb.field).collection_type="List"];
repeated bool repeated_bool = 43 [(scalapb.field).collection_type="List"];
repeated string repeated_string = 44 [(scalapb.field).collection_type="List"];
repeated bytes repeated_bytes = 45 [(scalapb.field).collection_type="List"];
repeated Enum repeated_enum = 46 [(scalapb.field).collection_type="List"];
repeated SubMsg repeated_msg = 47 [(scalapb.field).collection_type="List"];
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="List"];
repeated int64 repeated_int64 = 32 [(scalapb.field).collection_type="List"];
repeated uint32 repeated_uint32 = 33 [(scalapb.field).collection_type="List"];
repeated uint64 repeated_uint64 = 34 [(scalapb.field).collection_type="List"];
repeated sint32 repeated_sint32 = 35 [(scalapb.field).collection_type="List"];
repeated sint64 repeated_sint64 = 36 [(scalapb.field).collection_type="List"];
repeated fixed32 repeated_fixed32 = 37 [(scalapb.field).collection_type="List"];
repeated fixed64 repeated_fixed64 = 38 [(scalapb.field).collection_type="List"];
repeated sfixed32 repeated_sfixed32 = 39 [(scalapb.field).collection_type="List"];
repeated sfixed64 repeated_sfixed64 = 40 [(scalapb.field).collection_type="List"];
repeated float repeated_float = 41 [(scalapb.field).collection_type="List"];
repeated double repeated_double = 42 [(scalapb.field).collection_type="List"];
repeated bool repeated_bool = 43 [(scalapb.field).collection_type="List"];
repeated string repeated_string = 44 [(scalapb.field).collection_type="List"];
repeated bytes repeated_bytes = 45 [(scalapb.field).collection_type="List"];
repeated Enum repeated_enum = 46 [(scalapb.field).collection_type="List"];
repeated SubMsg repeated_msg = 47 [(scalapb.field).collection_type="List"];
repeated CustomMessage.Name repeated_fullname = 48 [(scalapb.field).collection_type="List", (scalapb.field).type = "com.thesamet.pb.FullName"];
}

message CollectionTypesSet {
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="Set"];
repeated int64 repeated_int64 = 32 [(scalapb.field).collection_type="Set"];
repeated uint32 repeated_uint32 = 33 [(scalapb.field).collection_type="Set"];
repeated uint64 repeated_uint64 = 34 [(scalapb.field).collection_type="Set"];
repeated sint32 repeated_sint32 = 35 [(scalapb.field).collection_type="Set"];
repeated sint64 repeated_sint64 = 36 [(scalapb.field).collection_type="Set"];
repeated fixed32 repeated_fixed32 = 37 [(scalapb.field).collection_type="Set"];
repeated fixed64 repeated_fixed64 = 38 [(scalapb.field).collection_type="Set"];
repeated sfixed32 repeated_sfixed32 = 39 [(scalapb.field).collection_type="Set"];
repeated sfixed64 repeated_sfixed64 = 40 [(scalapb.field).collection_type="Set"];
repeated float repeated_float = 41 [(scalapb.field).collection_type="Set"];
repeated double repeated_double = 42 [(scalapb.field).collection_type="Set"];
repeated bool repeated_bool = 43 [(scalapb.field).collection_type="Set"];
repeated string repeated_string = 44 [(scalapb.field).collection_type="Set"];
repeated bytes repeated_bytes = 45 [(scalapb.field).collection_type="Set"];
repeated Enum repeated_enum = 46 [(scalapb.field).collection_type="Set"];
repeated SubMsg repeated_msg = 47 [(scalapb.field).collection_type="Set"];
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="Set"];
repeated int64 repeated_int64 = 32 [(scalapb.field).collection_type="Set"];
repeated uint32 repeated_uint32 = 33 [(scalapb.field).collection_type="Set"];
repeated uint64 repeated_uint64 = 34 [(scalapb.field).collection_type="Set"];
repeated sint32 repeated_sint32 = 35 [(scalapb.field).collection_type="Set"];
repeated sint64 repeated_sint64 = 36 [(scalapb.field).collection_type="Set"];
repeated fixed32 repeated_fixed32 = 37 [(scalapb.field).collection_type="Set"];
repeated fixed64 repeated_fixed64 = 38 [(scalapb.field).collection_type="Set"];
repeated sfixed32 repeated_sfixed32 = 39 [(scalapb.field).collection_type="Set"];
repeated sfixed64 repeated_sfixed64 = 40 [(scalapb.field).collection_type="Set"];
repeated float repeated_float = 41 [(scalapb.field).collection_type="Set"];
repeated double repeated_double = 42 [(scalapb.field).collection_type="Set"];
repeated bool repeated_bool = 43 [(scalapb.field).collection_type="Set"];
repeated string repeated_string = 44 [(scalapb.field).collection_type="Set"];
repeated bytes repeated_bytes = 45 [(scalapb.field).collection_type="Set"];
repeated Enum repeated_enum = 46 [(scalapb.field).collection_type="Set"];
repeated SubMsg repeated_msg = 47 [(scalapb.field).collection_type="Set"];
repeated CustomMessage.Name repeated_fullname = 48 [(scalapb.field).collection_type="Set", (scalapb.field).type = "com.thesamet.pb.FullName"];
}

message CollectionTypesPackedVector {
repeated int32 repeated_int32 = 31 [packed=true, (scalapb.field).collection_type="Vector"];
repeated int64 repeated_int64 = 32 [packed=true, (scalapb.field).collection_type="Vector"];
repeated uint32 repeated_uint32 = 33 [packed=true, (scalapb.field).collection_type="Vector"];
repeated uint64 repeated_uint64 = 34 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sint32 repeated_sint32 = 35 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sint64 repeated_sint64 = 36 [packed=true, (scalapb.field).collection_type="Vector"];
repeated fixed32 repeated_fixed32 = 37 [packed=true, (scalapb.field).collection_type="Vector"];
repeated fixed64 repeated_fixed64 = 38 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sfixed32 repeated_sfixed32 = 39 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sfixed64 repeated_sfixed64 = 40 [packed=true, (scalapb.field).collection_type="Vector"];
repeated float repeated_float = 41 [packed=true, (scalapb.field).collection_type="Vector"];
repeated double repeated_double = 42 [packed=true, (scalapb.field).collection_type="Vector"];
repeated bool repeated_bool = 43 [packed=true, (scalapb.field).collection_type="Vector"];
repeated Enum repeated_enum = 46 [packed=true, (scalapb.field).collection_type="Vector"];
repeated int32 repeated_int32 = 31 [packed=true, (scalapb.field).collection_type="Vector"];
repeated int64 repeated_int64 = 32 [packed=true, (scalapb.field).collection_type="Vector"];
repeated uint32 repeated_uint32 = 33 [packed=true, (scalapb.field).collection_type="Vector"];
repeated uint64 repeated_uint64 = 34 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sint32 repeated_sint32 = 35 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sint64 repeated_sint64 = 36 [packed=true, (scalapb.field).collection_type="Vector"];
repeated fixed32 repeated_fixed32 = 37 [packed=true, (scalapb.field).collection_type="Vector"];
repeated fixed64 repeated_fixed64 = 38 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sfixed32 repeated_sfixed32 = 39 [packed=true, (scalapb.field).collection_type="Vector"];
repeated sfixed64 repeated_sfixed64 = 40 [packed=true, (scalapb.field).collection_type="Vector"];
repeated float repeated_float = 41 [packed=true, (scalapb.field).collection_type="Vector"];
repeated double repeated_double = 42 [packed=true, (scalapb.field).collection_type="Vector"];
repeated bool repeated_bool = 43 [packed=true, (scalapb.field).collection_type="Vector"];
repeated Enum repeated_enum = 46 [packed=true, (scalapb.field).collection_type="Vector"];
}

message CollectionTypesPackedSet {
repeated int32 repeated_int32 = 31 [packed=true, (scalapb.field).collection_type="Set"];
repeated int64 repeated_int64 = 32 [packed=true, (scalapb.field).collection_type="Set"];
repeated uint32 repeated_uint32 = 33 [packed=true, (scalapb.field).collection_type="Set"];
repeated uint64 repeated_uint64 = 34 [packed=true, (scalapb.field).collection_type="Set"];
repeated sint32 repeated_sint32 = 35 [packed=true, (scalapb.field).collection_type="Set"];
repeated sint64 repeated_sint64 = 36 [packed=true, (scalapb.field).collection_type="Set"];
repeated fixed32 repeated_fixed32 = 37 [packed=true, (scalapb.field).collection_type="Set"];
repeated fixed64 repeated_fixed64 = 38 [packed=true, (scalapb.field).collection_type="Set"];
repeated sfixed32 repeated_sfixed32 = 39 [packed=true, (scalapb.field).collection_type="Set"];
repeated sfixed64 repeated_sfixed64 = 40 [packed=true, (scalapb.field).collection_type="Set"];
repeated float repeated_float = 41 [packed=true, (scalapb.field).collection_type="Set"];
repeated double repeated_double = 42 [packed=true, (scalapb.field).collection_type="Set"];
repeated bool repeated_bool = 43 [packed=true, (scalapb.field).collection_type="Set"];
repeated Enum repeated_enum = 46 [packed=true, (scalapb.field).collection_type="Set"];
repeated int32 repeated_int32 = 31 [packed=true, (scalapb.field).collection_type="Set"];
repeated int64 repeated_int64 = 32 [packed=true, (scalapb.field).collection_type="Set"];
repeated uint32 repeated_uint32 = 33 [packed=true, (scalapb.field).collection_type="Set"];
repeated uint64 repeated_uint64 = 34 [packed=true, (scalapb.field).collection_type="Set"];
repeated sint32 repeated_sint32 = 35 [packed=true, (scalapb.field).collection_type="Set"];
repeated sint64 repeated_sint64 = 36 [packed=true, (scalapb.field).collection_type="Set"];
repeated fixed32 repeated_fixed32 = 37 [packed=true, (scalapb.field).collection_type="Set"];
repeated fixed64 repeated_fixed64 = 38 [packed=true, (scalapb.field).collection_type="Set"];
repeated sfixed32 repeated_sfixed32 = 39 [packed=true, (scalapb.field).collection_type="Set"];
repeated sfixed64 repeated_sfixed64 = 40 [packed=true, (scalapb.field).collection_type="Set"];
repeated float repeated_float = 41 [packed=true, (scalapb.field).collection_type="Set"];
repeated double repeated_double = 42 [packed=true, (scalapb.field).collection_type="Set"];
repeated bool repeated_bool = 43 [packed=true, (scalapb.field).collection_type="Set"];
repeated Enum repeated_enum = 46 [packed=true, (scalapb.field).collection_type="Set"];
}

message CollectionTypesMap {
Expand All @@ -145,8 +150,10 @@ message CollectionTypesMap {
map<int32, bool> mymap_int32_bool = 4 [(scalapb.field).map_type="com.thesamet.pb.MyMap"];
map<int32, Enum0> mymap_int32_enum = 5 [(scalapb.field).map_type="com.thesamet.pb.MyMap"];
map<int32, SubMsg> mymap_int32_submsg = 6 [(scalapb.field).map_type="com.thesamet.pb.MyMap"];
map<int32, CustomMessage.Name> repeated_fullname = 7 [(scalapb.field).map_type="com.thesamet.pb.MyMap", (scalapb.field).value_type="com.thesamet.pb.FullName"];
}

message CustomCollection {
repeated int32 repeated_int32 = 31 [(scalapb.field).collection_type="com.thesamet.pb.MyVector"];
repeated CustomMessage.Name repeated_fullname = 32 [(scalapb.field).type="com.thesamet.pb.FullName", (scalapb.field).collection_type="com.thesamet.pb.MyVector"];
}

0 comments on commit f88d2a4

Please sign in to comment.