Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | |
| 3 | using pb = global::Google.ProtocolBuffers; |
| 4 | using pbc = global::Google.ProtocolBuffers.Collections; |
| 5 | using pbd = global::Google.ProtocolBuffers.Descriptors; |
| 6 | using scg = global::System.Collections.Generic; |
| 7 | namespace Google.ProtocolBuffers.TestProtos { |
| 8 | |
| 9 | public static partial class UnitTestEmbedOptimizeForProtoFile { |
| 10 | |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 11 | #region Extension registration |
| 12 | public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
| 13 | } |
| 14 | #endregion |
| 15 | #region Static variables |
| 16 | internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; |
| 17 | internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder> internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; |
| 18 | #endregion |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 19 | #region Descriptor |
| 20 | public static pbd::FileDescriptor Descriptor { |
| 21 | get { return descriptor; } |
| 22 | } |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 23 | private static pbd::FileDescriptor descriptor; |
| 24 | |
| 25 | static UnitTestEmbedOptimizeForProtoFile() { |
| 26 | byte[] descriptorData = global::System.Convert.FromBase64String( |
| 27 | "CjFnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZW1iZWRfb3B0aW1pemVfZm9y" + |
| 28 | "LnByb3RvEhFwcm90b2J1Zl91bml0dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2Nz" + |
| 29 | "aGFycF9vcHRpb25zLnByb3RvGitnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rf" + |
| 30 | "b3B0aW1pemVfZm9yLnByb3RvIqEBChlUZXN0RW1iZWRPcHRpbWl6ZWRGb3JT" + |
| 31 | "aXplEkEKEG9wdGlvbmFsX21lc3NhZ2UYASABKAsyJy5wcm90b2J1Zl91bml0" + |
| 32 | "dGVzdC5UZXN0T3B0aW1pemVkRm9yU2l6ZRJBChByZXBlYXRlZF9tZXNzYWdl" + |
| 33 | "GAIgAygLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE9wdGltaXplZEZvclNp" + |
| 34 | "emVCS0gBwj5GCiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MS" + |
| 35 | "IVVuaXRUZXN0RW1iZWRPcHRpbWl6ZUZvclByb3RvRmlsZQ=="); |
| 36 | pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
| 37 | descriptor = root; |
| 38 | internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor = Descriptor.MessageTypes[0]; |
| 39 | internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable = |
| 40 | new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor, |
| 41 | new string[] { "OptionalMessage", "RepeatedMessage", }); |
| 42 | pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
| 43 | RegisterAllExtensions(registry); |
| 44 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); |
| 45 | global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.RegisterAllExtensions(registry); |
| 46 | return registry; |
| 47 | }; |
| 48 | pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
| 49 | new pbd::FileDescriptor[] { |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 50 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 51 | global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 52 | }, assigner); |
| 53 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 54 | #endregion |
| 55 | |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 56 | } |
| 57 | #region Messages |
| 58 | public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> { |
| 59 | private static readonly TestEmbedOptimizedForSize defaultInstance = new Builder().BuildPartial(); |
| 60 | public static TestEmbedOptimizedForSize DefaultInstance { |
| 61 | get { return defaultInstance; } |
| 62 | } |
| 63 | |
| 64 | public override TestEmbedOptimizedForSize DefaultInstanceForType { |
| 65 | get { return defaultInstance; } |
| 66 | } |
| 67 | |
| 68 | protected override TestEmbedOptimizedForSize ThisMessage { |
| 69 | get { return this; } |
| 70 | } |
| 71 | |
| 72 | public static pbd::MessageDescriptor Descriptor { |
| 73 | get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; } |
| 74 | } |
| 75 | |
| 76 | protected override pb::FieldAccess.FieldAccessorTable<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> InternalFieldAccessors { |
| 77 | get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; } |
| 78 | } |
| 79 | |
Jon Skeet | 7ee85c4 | 2009-05-28 21:11:15 +0100 | [diff] [blame] | 80 | public const int OptionalMessageFieldNumber = 1; |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 81 | private bool hasOptionalMessage; |
| 82 | private global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; |
| 83 | public bool HasOptionalMessage { |
| 84 | get { return hasOptionalMessage; } |
| 85 | } |
| 86 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { |
| 87 | get { return optionalMessage_; } |
| 88 | } |
| 89 | |
Jon Skeet | 7ee85c4 | 2009-05-28 21:11:15 +0100 | [diff] [blame] | 90 | public const int RepeatedMessageFieldNumber = 2; |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 91 | private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> repeatedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize>(); |
| 92 | public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList { |
| 93 | get { return repeatedMessage_; } |
| 94 | } |
| 95 | public int RepeatedMessageCount { |
| 96 | get { return repeatedMessage_.Count; } |
| 97 | } |
| 98 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { |
| 99 | return repeatedMessage_[index]; |
| 100 | } |
| 101 | |
| 102 | public override bool IsInitialized { |
| 103 | get { |
| 104 | if (HasOptionalMessage) { |
| 105 | if (!OptionalMessage.IsInitialized) return false; |
| 106 | } |
| 107 | foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
| 108 | if (!element.IsInitialized) return false; |
| 109 | } |
| 110 | return true; |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | public override void WriteTo(pb::CodedOutputStream output) { |
| 115 | if (HasOptionalMessage) { |
| 116 | output.WriteMessage(1, OptionalMessage); |
| 117 | } |
| 118 | foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
| 119 | output.WriteMessage(2, element); |
| 120 | } |
| 121 | UnknownFields.WriteTo(output); |
| 122 | } |
| 123 | |
| 124 | private int memoizedSerializedSize = -1; |
| 125 | public override int SerializedSize { |
| 126 | get { |
| 127 | int size = memoizedSerializedSize; |
| 128 | if (size != -1) return size; |
| 129 | |
| 130 | size = 0; |
| 131 | if (HasOptionalMessage) { |
| 132 | size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); |
| 133 | } |
| 134 | foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
| 135 | size += pb::CodedOutputStream.ComputeMessageSize(2, element); |
| 136 | } |
| 137 | size += UnknownFields.SerializedSize; |
| 138 | memoizedSerializedSize = size; |
| 139 | return size; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) { |
| 144 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| 145 | } |
| 146 | public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
| 147 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| 148 | } |
| 149 | public static TestEmbedOptimizedForSize ParseFrom(byte[] data) { |
| 150 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| 151 | } |
| 152 | public static TestEmbedOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
| 153 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| 154 | } |
| 155 | public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) { |
| 156 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| 157 | } |
| 158 | public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| 159 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| 160 | } |
Jon Skeet | 2e6dc12 | 2009-05-29 06:34:52 +0100 | [diff] [blame] | 161 | public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) { |
| 162 | return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
| 163 | } |
| 164 | public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| 165 | return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
| 166 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 167 | public static TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) { |
| 168 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| 169 | } |
| 170 | public static TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| 171 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| 172 | } |
| 173 | public static Builder CreateBuilder() { return new Builder(); } |
Jon Skeet | e81a9d7 | 2009-02-24 16:50:56 +0000 | [diff] [blame] | 174 | public override Builder ToBuilder() { return CreateBuilder(this); } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 175 | public override Builder CreateBuilderForType() { return new Builder(); } |
| 176 | public static Builder CreateBuilder(TestEmbedOptimizedForSize prototype) { |
| 177 | return (Builder) new Builder().MergeFrom(prototype); |
| 178 | } |
| 179 | |
| 180 | public sealed partial class Builder : pb::GeneratedBuilder<TestEmbedOptimizedForSize, Builder> { |
| 181 | protected override Builder ThisBuilder { |
| 182 | get { return this; } |
| 183 | } |
| 184 | public Builder() {} |
| 185 | |
| 186 | TestEmbedOptimizedForSize result = new TestEmbedOptimizedForSize(); |
| 187 | |
| 188 | protected override TestEmbedOptimizedForSize MessageBeingBuilt { |
| 189 | get { return result; } |
| 190 | } |
| 191 | |
| 192 | public override Builder Clear() { |
| 193 | result = new TestEmbedOptimizedForSize(); |
| 194 | return this; |
| 195 | } |
| 196 | |
| 197 | public override Builder Clone() { |
| 198 | return new Builder().MergeFrom(result); |
| 199 | } |
| 200 | |
| 201 | public override pbd::MessageDescriptor DescriptorForType { |
| 202 | get { return TestEmbedOptimizedForSize.Descriptor; } |
| 203 | } |
| 204 | |
| 205 | public override TestEmbedOptimizedForSize DefaultInstanceForType { |
| 206 | get { return TestEmbedOptimizedForSize.DefaultInstance; } |
| 207 | } |
| 208 | |
| 209 | public override TestEmbedOptimizedForSize BuildPartial() { |
Jon Skeet | 2e6dc12 | 2009-05-29 06:34:52 +0100 | [diff] [blame] | 210 | if (result == null) { |
| 211 | throw new global::System.InvalidOperationException("build() has already been called on this Builder"); |
| 212 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 213 | result.repeatedMessage_.MakeReadOnly(); |
| 214 | TestEmbedOptimizedForSize returnMe = result; |
| 215 | result = null; |
| 216 | return returnMe; |
| 217 | } |
| 218 | |
| 219 | public override Builder MergeFrom(pb::IMessage other) { |
| 220 | if (other is TestEmbedOptimizedForSize) { |
| 221 | return MergeFrom((TestEmbedOptimizedForSize) other); |
| 222 | } else { |
| 223 | base.MergeFrom(other); |
| 224 | return this; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | public override Builder MergeFrom(TestEmbedOptimizedForSize other) { |
| 229 | if (other == TestEmbedOptimizedForSize.DefaultInstance) return this; |
| 230 | if (other.HasOptionalMessage) { |
| 231 | MergeOptionalMessage(other.OptionalMessage); |
| 232 | } |
| 233 | if (other.repeatedMessage_.Count != 0) { |
| 234 | base.AddRange(other.repeatedMessage_, result.repeatedMessage_); |
| 235 | } |
| 236 | this.MergeUnknownFields(other.UnknownFields); |
| 237 | return this; |
| 238 | } |
| 239 | |
| 240 | public override Builder MergeFrom(pb::CodedInputStream input) { |
| 241 | return MergeFrom(input, pb::ExtensionRegistry.Empty); |
| 242 | } |
| 243 | |
| 244 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 245 | pb::UnknownFieldSet.Builder unknownFields = null; |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 246 | while (true) { |
| 247 | uint tag = input.ReadTag(); |
| 248 | switch (tag) { |
| 249 | case 0: { |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 250 | if (unknownFields != null) { |
| 251 | this.UnknownFields = unknownFields.Build(); |
| 252 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 253 | return this; |
| 254 | } |
| 255 | default: { |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 256 | if (pb::WireFormat.IsEndGroupTag(tag)) { |
| 257 | if (unknownFields != null) { |
| 258 | this.UnknownFields = unknownFields.Build(); |
| 259 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 260 | return this; |
| 261 | } |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 262 | if (unknownFields == null) { |
| 263 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| 264 | } |
| 265 | ParseUnknownField(input, unknownFields, extensionRegistry, tag); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 266 | break; |
| 267 | } |
| 268 | case 10: { |
| 269 | global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(); |
| 270 | if (HasOptionalMessage) { |
| 271 | subBuilder.MergeFrom(OptionalMessage); |
| 272 | } |
| 273 | input.ReadMessage(subBuilder, extensionRegistry); |
| 274 | OptionalMessage = subBuilder.BuildPartial(); |
| 275 | break; |
| 276 | } |
| 277 | case 18: { |
| 278 | global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(); |
| 279 | input.ReadMessage(subBuilder, extensionRegistry); |
| 280 | AddRepeatedMessage(subBuilder.BuildPartial()); |
| 281 | break; |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | |
| 288 | public bool HasOptionalMessage { |
| 289 | get { return result.HasOptionalMessage; } |
| 290 | } |
| 291 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { |
| 292 | get { return result.OptionalMessage; } |
| 293 | set { SetOptionalMessage(value); } |
| 294 | } |
| 295 | public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 296 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 297 | result.hasOptionalMessage = true; |
| 298 | result.optionalMessage_ = value; |
| 299 | return this; |
| 300 | } |
| 301 | public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 302 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 303 | result.hasOptionalMessage = true; |
| 304 | result.optionalMessage_ = builderForValue.Build(); |
| 305 | return this; |
| 306 | } |
| 307 | public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 308 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 309 | if (result.HasOptionalMessage && |
| 310 | result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance) { |
| 311 | result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); |
| 312 | } else { |
| 313 | result.optionalMessage_ = value; |
| 314 | } |
| 315 | result.hasOptionalMessage = true; |
| 316 | return this; |
| 317 | } |
| 318 | public Builder ClearOptionalMessage() { |
| 319 | result.hasOptionalMessage = false; |
| 320 | result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; |
| 321 | return this; |
| 322 | } |
| 323 | |
Jon Skeet | 8729cf4 | 2009-06-05 22:49:05 +0100 | [diff] [blame] | 324 | public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList { |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 325 | get { return result.repeatedMessage_; } |
| 326 | } |
| 327 | public int RepeatedMessageCount { |
| 328 | get { return result.RepeatedMessageCount; } |
| 329 | } |
| 330 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { |
| 331 | return result.GetRepeatedMessage(index); |
| 332 | } |
| 333 | public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 334 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 335 | result.repeatedMessage_[index] = value; |
| 336 | return this; |
| 337 | } |
| 338 | public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 339 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 340 | result.repeatedMessage_[index] = builderForValue.Build(); |
| 341 | return this; |
| 342 | } |
| 343 | public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 344 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 345 | result.repeatedMessage_.Add(value); |
| 346 | return this; |
| 347 | } |
| 348 | public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 349 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 350 | result.repeatedMessage_.Add(builderForValue.Build()); |
| 351 | return this; |
| 352 | } |
| 353 | public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> values) { |
| 354 | base.AddRange(values, result.repeatedMessage_); |
| 355 | return this; |
| 356 | } |
| 357 | public Builder ClearRepeatedMessage() { |
| 358 | result.repeatedMessage_.Clear(); |
| 359 | return this; |
| 360 | } |
| 361 | } |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 362 | static TestEmbedOptimizedForSize() { |
Jon Skeet | c784be3 | 2009-06-17 15:47:33 +0100 | [diff] [blame^] | 363 | object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.Descriptor, null); |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 364 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | #endregion |
| 368 | |
| 369 | } |