OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 18 matching lines...) Expand all Loading... |
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
31 syntax = "proto3"; | 31 syntax = "proto3"; |
32 | 32 |
33 package field_presence_test; | 33 package field_presence_test; |
34 | 34 |
35 import "google/protobuf/unittest.proto"; | 35 import "google/protobuf/unittest.proto"; |
36 | 36 |
37 option java_package = "com.google.protobuf"; | 37 option java_package = "com.google.protobuf"; |
38 option java_outer_classname = "FieldPresenceTestProto"; | 38 option java_outer_classname = "FieldPresenceTestProto"; |
| 39 option java_generate_equals_and_hash = true; |
39 | 40 |
40 message TestAllTypes { | 41 message TestAllTypes { |
41 enum NestedEnum { | 42 enum NestedEnum { |
42 FOO = 0; | 43 FOO = 0; |
43 BAR = 1; | 44 BAR = 1; |
44 BAZ = 2; | 45 BAZ = 2; |
45 } | 46 } |
46 message NestedMessage { | 47 message NestedMessage { |
47 int32 value = 1; | 48 int32 value = 1; |
48 } | 49 } |
49 | 50 |
50 int32 optional_int32 = 1; | 51 int32 optional_int32 = 1; |
51 string optional_string = 2; | 52 string optional_string = 2; |
52 bytes optional_bytes = 3; | 53 bytes optional_bytes = 3; |
53 NestedEnum optional_nested_enum = 4; | 54 NestedEnum optional_nested_enum = 4; |
54 NestedMessage optional_nested_message = 5; | 55 NestedMessage optional_nested_message = 5; |
55 protobuf_unittest.TestRequired optional_proto2_message = 6; | 56 protobuf_unittest.TestRequired optional_proto2_message = 6; |
56 NestedMessage optional_lazy_message = 7 [lazy=true]; | |
57 | 57 |
58 oneof oneof_field { | 58 oneof oneof_field { |
59 int32 oneof_int32 = 11; | 59 int32 oneof_int32 = 11; |
60 uint32 oneof_uint32 = 12; | 60 uint32 oneof_uint32 = 12; |
61 string oneof_string = 13; | 61 string oneof_string = 13; |
62 bytes oneof_bytes = 14; | 62 bytes oneof_bytes = 14; |
63 NestedEnum oneof_nested_enum = 15; | 63 NestedEnum oneof_nested_enum = 15; |
64 NestedMessage oneof_nested_message = 16; | 64 NestedMessage oneof_nested_message = 16; |
65 protobuf_unittest.TestRequired oneof_proto2_message = 17; | 65 protobuf_unittest.TestRequired oneof_proto2_message = 17; |
66 } | 66 } |
67 | 67 |
68 repeated int32 repeated_int32 = 21; | 68 repeated int32 repeated_int32 = 21; |
69 repeated string repeated_string = 22; | 69 repeated string repeated_string = 22; |
70 repeated bytes repeated_bytes = 23; | 70 repeated bytes repeated_bytes = 23; |
71 repeated NestedEnum repeated_nested_enum = 24; | 71 repeated NestedEnum repeated_nested_enum = 24; |
72 repeated NestedMessage repeated_nested_message = 25; | 72 repeated NestedMessage repeated_nested_message = 25; |
73 repeated protobuf_unittest.TestRequired repeated_proto2_message = 26; | 73 repeated protobuf_unittest.TestRequired repeated_proto2_message = 26; |
74 repeated NestedEnum packed_nested_enum = 27 [packed = true]; | 74 repeated NestedEnum packed_nested_enum = 27 [packed = true]; |
75 } | 75 } |
76 | 76 |
77 message TestOptionalFieldsOnly { | 77 message TestOptionalFieldsOnly { |
78 int32 optional_int32 = 1; | 78 int32 optional_int32 = 1; |
79 string optional_string = 2; | 79 string optional_string = 2; |
80 bytes optional_bytes = 3; | 80 bytes optional_bytes = 3; |
81 TestAllTypes.NestedEnum optional_nested_enum = 4; | 81 TestAllTypes.NestedEnum optional_nested_enum = 4; |
82 TestAllTypes.NestedMessage optional_nested_message = 5; | 82 TestAllTypes.NestedMessage optional_nested_message = 5; |
83 protobuf_unittest.TestRequired optional_proto2_message = 6; | 83 protobuf_unittest.TestRequired optional_proto2_message = 6; |
84 TestAllTypes.NestedMessage optional_lazy_message = 7 [lazy=true]; | |
85 } | 84 } |
86 | 85 |
87 message TestRepeatedFieldsOnly { | 86 message TestRepeatedFieldsOnly { |
88 repeated int32 repeated_int32 = 21; | 87 repeated int32 repeated_int32 = 21; |
89 repeated string repeated_string = 22; | 88 repeated string repeated_string = 22; |
90 repeated bytes repeated_bytes = 23; | 89 repeated bytes repeated_bytes = 23; |
91 repeated TestAllTypes.NestedEnum repeated_nested_enum = 24; | 90 repeated TestAllTypes.NestedEnum repeated_nested_enum = 24; |
92 repeated TestAllTypes.NestedMessage repeated_nested_message = 25; | 91 repeated TestAllTypes.NestedMessage repeated_nested_message = 25; |
93 repeated protobuf_unittest.TestRequired repeated_proto2_message = 26; | 92 repeated protobuf_unittest.TestRequired repeated_proto2_message = 26; |
94 } | 93 } |
OLD | NEW |