aboutsummaryrefslogtreecommitdiff
path: root/csharp/ProtocolBuffers.Test
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/ProtocolBuffers.Test')
-rw-r--r--csharp/ProtocolBuffers.Test/AbstractMessageTest.cs364
-rw-r--r--csharp/ProtocolBuffers.Test/ByteStringTest.cs98
-rw-r--r--csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs376
-rw-r--r--csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs239
-rw-r--r--csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs64
-rw-r--r--csharp/ProtocolBuffers.Test/DescriptorsTest.cs273
-rw-r--r--csharp/ProtocolBuffers.Test/DynamicMessageTest.cs114
-rw-r--r--csharp/ProtocolBuffers.Test/GeneratedMessageTest.cs290
-rw-r--r--csharp/ProtocolBuffers.Test/MessageStreamIteratorTest.cs23
-rw-r--r--csharp/ProtocolBuffers.Test/MessageStreamWriterTest.cs36
-rw-r--r--csharp/ProtocolBuffers.Test/MessageTest.cs299
-rw-r--r--csharp/ProtocolBuffers.Test/Properties/AssemblyInfo.cs36
-rw-r--r--csharp/ProtocolBuffers.Test/Properties/Google.ProtocolBuffers.Test.snkbin596 -> 0 bytes
-rw-r--r--csharp/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj92
-rw-r--r--csharp/ProtocolBuffers.Test/ReflectionTester.cs796
-rw-r--r--csharp/ProtocolBuffers.Test/ServiceTest.cs178
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/EnumWithNoOuter.cs14
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/MessageWithNoOuter.cs398
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/MultiFileProto.cs79
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/ServiceWithNoOuter.cs101
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs358
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs242
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs1416
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs538
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs12930
-rw-r--r--csharp/ProtocolBuffers.Test/TestUtil.cs1371
-rw-r--r--csharp/ProtocolBuffers.Test/TextFormatTest.cs487
-rw-r--r--csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs314
-rw-r--r--csharp/ProtocolBuffers.Test/WireFormatTest.cs228
29 files changed, 0 insertions, 21754 deletions
diff --git a/csharp/ProtocolBuffers.Test/AbstractMessageTest.cs b/csharp/ProtocolBuffers.Test/AbstractMessageTest.cs
deleted file mode 100644
index 38cc8636..00000000
--- a/csharp/ProtocolBuffers.Test/AbstractMessageTest.cs
+++ /dev/null
@@ -1,364 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.Collections.Generic;
-using Google.ProtocolBuffers.Descriptors;
-using NUnit.Framework;
-using Google.ProtocolBuffers.TestProtos;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class AbstractMessageTest {
-
- [Test]
- public void Clear() {
- AbstractMessageWrapper message = new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder(TestUtil.GetAllSet())).Clear().Build();
- TestUtil.AssertClear((TestAllTypes) message.WrappedMessage);
- }
-
- [Test]
- public void Copy() {
- AbstractMessageWrapper message = new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder()).MergeFrom(TestUtil.GetAllSet()).Build();
- TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage);
- }
-
- [Test]
- public void SerializedSize() {
- TestAllTypes message = TestUtil.GetAllSet();
- IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet());
-
- Assert.AreEqual(message.SerializedSize, abstractMessage.SerializedSize);
- }
-
- [Test]
- public void Serialization() {
- IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet());
- TestUtil.AssertAllFieldsSet(TestAllTypes.ParseFrom(abstractMessage.ToByteString()));
- Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), abstractMessage.ToByteString());
- }
-
- [Test]
- public void Parsing() {
- IBuilder builder = new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder());
- AbstractMessageWrapper message = (AbstractMessageWrapper) builder.WeakMergeFrom(TestUtil.GetAllSet().ToByteString()).WeakBuild();
- TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage);
- }
-
- [Test]
- public void OptimizedForSize() {
- // We're mostly only Checking that this class was compiled successfully.
- TestOptimizedForSize message = TestOptimizedForSize.CreateBuilder().SetI(1).Build();
- message = TestOptimizedForSize.ParseFrom(message.ToByteString());
- Assert.AreEqual(2, message.SerializedSize);
- }
-
- // -----------------------------------------------------------------
- // Tests for isInitialized().
-
- private static readonly TestRequired TestRequiredUninitialized = TestRequired.DefaultInstance;
- private static readonly TestRequired TestRequiredInitialized = TestRequired.CreateBuilder().SetA(1).SetB(2).SetC(3).Build();
-
- [Test]
- public void IsInitialized() {
- TestRequired.Builder builder = TestRequired.CreateBuilder();
- AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder);
-
- Assert.IsFalse(abstractBuilder.IsInitialized);
- builder.A = 1;
- Assert.IsFalse(abstractBuilder.IsInitialized);
- builder.B = 1;
- Assert.IsFalse(abstractBuilder.IsInitialized);
- builder.C = 1;
- Assert.IsTrue(abstractBuilder.IsInitialized);
- }
-
- [Test]
- public void ForeignIsInitialized() {
- TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder();
- AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder);
-
- Assert.IsTrue(abstractBuilder.IsInitialized);
-
- builder.SetOptionalMessage(TestRequiredUninitialized);
- Assert.IsFalse(abstractBuilder.IsInitialized);
-
- builder.SetOptionalMessage(TestRequiredInitialized);
- Assert.IsTrue(abstractBuilder.IsInitialized);
-
- builder.AddRepeatedMessage(TestRequiredUninitialized);
- Assert.IsFalse(abstractBuilder.IsInitialized);
-
- builder.SetRepeatedMessage(0, TestRequiredInitialized);
- Assert.IsTrue(abstractBuilder.IsInitialized);
- }
-
- // -----------------------------------------------------------------
- // Tests for mergeFrom
-
- static readonly TestAllTypes MergeSource = TestAllTypes.CreateBuilder()
- .SetOptionalInt32(1)
- .SetOptionalString("foo")
- .SetOptionalForeignMessage(ForeignMessage.DefaultInstance)
- .AddRepeatedString("bar")
- .Build();
-
- static readonly TestAllTypes MergeDest = TestAllTypes.CreateBuilder()
- .SetOptionalInt64(2)
- .SetOptionalString("baz")
- .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(3).Build())
- .AddRepeatedString("qux")
- .Build();
-
- const string MergeResultText = "optional_int32: 1\n" +
- "optional_int64: 2\n" +
- "optional_string: \"foo\"\n" +
- "optional_foreign_message {\n" +
- " c: 3\n" +
- "}\n" +
- "repeated_string: \"qux\"\n" +
- "repeated_string: \"bar\"\n";
-
- [Test]
- public void MergeFrom() {
- AbstractMessageWrapper result = (AbstractMessageWrapper)
- new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder(MergeDest))
- .MergeFrom(MergeSource)
- .Build();
-
- Assert.AreEqual(MergeResultText, result.ToString());
- }
-
- // -----------------------------------------------------------------
- // Tests for equals and hashCode
-
- [Test]
- public void EqualsAndHashCode() {
- TestAllTypes a = TestUtil.GetAllSet();
- TestAllTypes b = TestAllTypes.CreateBuilder().Build();
- TestAllTypes c = TestAllTypes.CreateBuilder(b).AddRepeatedString("x").Build();
- TestAllTypes d = TestAllTypes.CreateBuilder(c).AddRepeatedString("y").Build();
- TestAllExtensions e = TestUtil.GetAllExtensionsSet();
- TestAllExtensions f = TestAllExtensions.CreateBuilder(e)
- .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 999).Build();
-
- CheckEqualsIsConsistent(a);
- CheckEqualsIsConsistent(b);
- CheckEqualsIsConsistent(c);
- CheckEqualsIsConsistent(d);
- CheckEqualsIsConsistent(e);
- CheckEqualsIsConsistent(f);
-
- CheckNotEqual(a, b);
- CheckNotEqual(a, c);
- CheckNotEqual(a, d);
- CheckNotEqual(a, e);
- CheckNotEqual(a, f);
-
- CheckNotEqual(b, c);
- CheckNotEqual(b, d);
- CheckNotEqual(b, e);
- CheckNotEqual(b, f);
-
- CheckNotEqual(c, d);
- CheckNotEqual(c, e);
- CheckNotEqual(c, f);
-
- CheckNotEqual(d, e);
- CheckNotEqual(d, f);
-
- CheckNotEqual(e, f);
- }
-
- /// <summary>
- /// Asserts that the given protos are equal and have the same hash code.
- /// </summary>
- private static void CheckEqualsIsConsistent(IMessage message) {
- // Object should be equal to itself.
- Assert.AreEqual(message, message);
-
- // Object should be equal to a dynamic copy of itself.
- DynamicMessage dynamic = DynamicMessage.CreateBuilder(message).Build();
- Assert.AreEqual(message, dynamic);
- Assert.AreEqual(dynamic, message);
- Assert.AreEqual(dynamic.GetHashCode(), message.GetHashCode());
- }
-
- /// <summary>
- /// Asserts that the given protos are not equal and have different hash codes.
- /// </summary>
- /// <remarks>
- /// It's valid for non-equal objects to have the same hash code, so
- /// this test is stricter than it needs to be. However, this should happen
- /// relatively rarely. (If this test fails, it's probably still due to a bug.)
- /// </remarks>
- private static void CheckNotEqual(IMessage m1, IMessage m2) {
- String equalsError = string.Format("{0} should not be equal to {1}", m1, m2);
- Assert.IsFalse(m1.Equals(m2), equalsError);
- Assert.IsFalse(m2.Equals(m1), equalsError);
-
- Assert.IsFalse(m1.GetHashCode() == m2.GetHashCode(),
- string.Format("{0} should have a different hash code from {1}", m1, m2));
- }
-
- /// <summary>
- /// Extends AbstractMessage and wraps some other message object. The methods
- /// of the Message interface which aren't explicitly implemented by
- /// AbstractMessage are forwarded to the wrapped object. This allows us to
- /// test that AbstractMessage's implementations work even if the wrapped
- /// object does not use them.
- /// </summary>
- private class AbstractMessageWrapper : AbstractMessage<AbstractMessageWrapper, AbstractMessageWrapper.Builder> {
- private readonly IMessage wrappedMessage;
-
- public IMessage WrappedMessage {
- get { return wrappedMessage; }
- }
-
- public AbstractMessageWrapper(IMessage wrappedMessage) {
- this.wrappedMessage = wrappedMessage;
- }
-
- public override MessageDescriptor DescriptorForType {
- get { return wrappedMessage.DescriptorForType; }
- }
-
- public override AbstractMessageWrapper DefaultInstanceForType {
- get { return new AbstractMessageWrapper(wrappedMessage.WeakDefaultInstanceForType); }
- }
-
- public override IDictionary<FieldDescriptor, object> AllFields {
- get { return wrappedMessage.AllFields; }
- }
-
- public override bool HasField(FieldDescriptor field) {
- return wrappedMessage.HasField(field);
- }
-
- public override object this[FieldDescriptor field] {
- get { return wrappedMessage[field]; }
- }
-
- public override object this[FieldDescriptor field, int index] {
- get { return wrappedMessage[field, index]; }
- }
-
- public override int GetRepeatedFieldCount(FieldDescriptor field) {
- return wrappedMessage.GetRepeatedFieldCount(field);
- }
-
- public override UnknownFieldSet UnknownFields {
- get { return wrappedMessage.UnknownFields; }
- }
-
- public override Builder CreateBuilderForType() {
- return new Builder(wrappedMessage.WeakCreateBuilderForType());
- }
-
- internal class Builder : AbstractBuilder<AbstractMessageWrapper, Builder> {
- private readonly IBuilder wrappedBuilder;
-
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- internal Builder(IBuilder wrappedBuilder) {
- this.wrappedBuilder = wrappedBuilder;
- }
-
- public override Builder MergeFrom(AbstractMessageWrapper other) {
- wrappedBuilder.WeakMergeFrom(other.wrappedMessage);
- return this;
- }
-
- public override bool IsInitialized {
- get { return wrappedBuilder.IsInitialized; }
- }
-
- public override IDictionary<FieldDescriptor, object> AllFields {
- get { return wrappedBuilder.AllFields; }
- }
-
- public override object this[FieldDescriptor field] {
- get { return wrappedBuilder[field]; }
- set { wrappedBuilder[field] = value; }
- }
-
- public override MessageDescriptor DescriptorForType {
- get { return wrappedBuilder.DescriptorForType; }
- }
-
- public override int GetRepeatedFieldCount(FieldDescriptor field) {
- return wrappedBuilder.GetRepeatedFieldCount(field);
- }
-
- public override object this[FieldDescriptor field, int index] {
- get { return wrappedBuilder[field, index]; }
- set { wrappedBuilder[field, index] = value; }
- }
-
- public override bool HasField(FieldDescriptor field) {
- return wrappedBuilder.HasField(field);
- }
-
- public override UnknownFieldSet UnknownFields {
- get { return wrappedBuilder.UnknownFields; }
- set { wrappedBuilder.UnknownFields = value; }
- }
-
- public override AbstractMessageWrapper Build() {
- return new AbstractMessageWrapper(wrappedBuilder.WeakBuild());
- }
-
- public override AbstractMessageWrapper BuildPartial() {
- return new AbstractMessageWrapper(wrappedBuilder.WeakBuildPartial());
- }
-
- public override Builder Clone() {
- return new Builder(wrappedBuilder.WeakClone());
- }
-
- public override AbstractMessageWrapper DefaultInstanceForType {
- get { return new AbstractMessageWrapper(wrappedBuilder.WeakDefaultInstanceForType); }
- }
-
- public override Builder ClearField(FieldDescriptor field) {
- wrappedBuilder.WeakClearField(field);
- return this;
- }
-
- public override Builder AddRepeatedField(FieldDescriptor field, object value) {
- wrappedBuilder.WeakAddRepeatedField(field, value);
- return this;
- }
-
- public override IBuilder CreateBuilderForField(FieldDescriptor field) {
- wrappedBuilder.CreateBuilderForField(field);
- return this;
- }
-
- public override Builder MergeFrom(IMessage other) {
- wrappedBuilder.WeakMergeFrom(other);
- return this;
- }
-
- public override Builder MergeFrom(CodedInputStream input, ExtensionRegistry extensionRegistry) {
- wrappedBuilder.WeakMergeFrom(input, extensionRegistry);
- return this;
- }
- }
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/ByteStringTest.cs b/csharp/ProtocolBuffers.Test/ByteStringTest.cs
deleted file mode 100644
index 768d74fe..00000000
--- a/csharp/ProtocolBuffers.Test/ByteStringTest.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System.Text;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class ByteStringTest {
- [Test]
- public void EmptyByteStringHasZeroSize() {
- Assert.AreEqual(0, ByteString.Empty.Length);
- }
-
- [Test]
- public void CopyFromStringWithExplicitEncoding() {
- ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode);
- Assert.AreEqual(4, bs.Length);
- Assert.AreEqual(65, bs[0]);
- Assert.AreEqual(0, bs[1]);
- Assert.AreEqual(66, bs[2]);
- Assert.AreEqual(0, bs[3]);
- }
-
- [Test]
- public void IsEmptyWhenEmpty() {
- Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty);
- }
-
- [Test]
- public void IsEmptyWhenNotEmpty() {
- Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty);
- }
-
- [Test]
- public void CopyFromByteArrayCopiesContents() {
- byte[] data = new byte[1];
- data[0] = 10;
- ByteString bs = ByteString.CopyFrom(data);
- Assert.AreEqual(10, bs[0]);
- data[0] = 5;
- Assert.AreEqual(10, bs[0]);
- }
-
- [Test]
- public void ToByteArrayCopiesContents() {
- ByteString bs = ByteString.CopyFromUtf8("Hello");
- byte[] data = bs.ToByteArray();
- Assert.AreEqual('H', data[0]);
- Assert.AreEqual('H', bs[0]);
- data[0] = 0;
- Assert.AreEqual(0, data[0]);
- Assert.AreEqual('H', bs[0]);
- }
-
- [Test]
- public void CopyFromUtf8UsesUtf8() {
- ByteString bs = ByteString.CopyFromUtf8("\u20ac");
- Assert.AreEqual(3, bs.Length);
- Assert.AreEqual(0xe2, bs[0]);
- Assert.AreEqual(0x82, bs[1]);
- Assert.AreEqual(0xac, bs[2]);
- }
-
- [Test]
- public void CopyFromPortion() {
- byte[] data = new byte[]{0, 1, 2, 3, 4, 5, 6};
- ByteString bs = ByteString.CopyFrom(data, 2, 3);
- Assert.AreEqual(3, bs.Length);
- Assert.AreEqual(2, bs[0]);
- Assert.AreEqual(3, bs[1]);
- }
-
- [Test]
- public void ToStringUtf8() {
- ByteString bs = ByteString.CopyFromUtf8("\u20ac");
- Assert.AreEqual("\u20ac", bs.ToStringUtf8());
- }
-
- [Test]
- public void ToStringWithExplicitEncoding() {
- ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode);
- Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode));
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs b/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs
deleted file mode 100644
index 24b3a732..00000000
--- a/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs
+++ /dev/null
@@ -1,376 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.IO;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-using System.Diagnostics;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class CodedInputStreamTest {
-
- /// <summary>
- /// Helper to construct a byte array from a bunch of bytes. The inputs are
- /// actually ints so that I can use hex notation and not get stupid errors
- /// about precision.
- /// </summary>
- private static byte[] Bytes(params int[] bytesAsInts) {
- byte[] bytes = new byte[bytesAsInts.Length];
- for (int i = 0; i < bytesAsInts.Length; i++) {
- bytes[i] = (byte)bytesAsInts[i];
- }
- return bytes;
- }
-
- /// <summary>
- /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and
- /// </summary>
- private static void AssertReadVarint(byte[] data, ulong value) {
- CodedInputStream input = CodedInputStream.CreateInstance(data);
- Assert.AreEqual((uint)value, input.ReadRawVarint32());
-
- input = CodedInputStream.CreateInstance(data);
- Assert.AreEqual(value, input.ReadRawVarint64());
-
- // Try different block sizes.
- for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) {
- input = CodedInputStream.CreateInstance(new SmallBlockInputStream(data, bufferSize));
- Assert.AreEqual((uint)value, input.ReadRawVarint32());
-
- input = CodedInputStream.CreateInstance(new SmallBlockInputStream(data, bufferSize));
- Assert.AreEqual(value, input.ReadRawVarint64());
- }
- }
-
- /// <summary>
- /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and
- /// expects them to fail with an InvalidProtocolBufferException whose
- /// description matches the given one.
- /// </summary>
- private void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data) {
- CodedInputStream input = CodedInputStream.CreateInstance(data);
- try {
- input.ReadRawVarint32();
- Assert.Fail("Should have thrown an exception.");
- } catch (InvalidProtocolBufferException e) {
- Assert.AreEqual(expected.Message, e.Message);
- }
-
- input = CodedInputStream.CreateInstance(data);
- try {
- input.ReadRawVarint64();
- Assert.Fail("Should have thrown an exception.");
- } catch (InvalidProtocolBufferException e) {
- Assert.AreEqual(expected.Message, e.Message);
- }
- }
-
- [Test]
- public void ReadVarint() {
- AssertReadVarint(Bytes(0x00), 0);
- AssertReadVarint(Bytes(0x01), 1);
- AssertReadVarint(Bytes(0x7f), 127);
- // 14882
- AssertReadVarint(Bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7));
- // 2961488830
- AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b),
- (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) |
- (0x0bL << 28));
-
- // 64-bit
- // 7256456126
- AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b),
- (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) |
- (0x1bL << 28));
- // 41256202580718336
- AssertReadVarint(Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49),
- (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) |
- (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49));
- // 11964378330978735131
- AssertReadVarint(Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01),
- (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) |
- (0x3bUL << 28) | (0x56UL << 35) | (0x00UL << 42) |
- (0x05UL << 49) | (0x26UL << 56) | (0x01UL << 63));
-
- // Failures
- AssertReadVarintFailure(
- InvalidProtocolBufferException.MalformedVarint(),
- Bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x00));
- AssertReadVarintFailure(
- InvalidProtocolBufferException.TruncatedMessage(),
- Bytes(0x80));
- }
-
- /// <summary>
- /// Parses the given bytes using ReadRawLittleEndian32() and checks
- /// that the result matches the given value.
- /// </summary>
- private static void AssertReadLittleEndian32(byte[] data, uint value) {
- CodedInputStream input = CodedInputStream.CreateInstance(data);
- Assert.AreEqual(value, input.ReadRawLittleEndian32());
-
- // Try different block sizes.
- for (int blockSize = 1; blockSize <= 16; blockSize *= 2) {
- input = CodedInputStream.CreateInstance(
- new SmallBlockInputStream(data, blockSize));
- Assert.AreEqual(value, input.ReadRawLittleEndian32());
- }
- }
-
- /// <summary>
- /// Parses the given bytes using ReadRawLittleEndian64() and checks
- /// that the result matches the given value.
- /// </summary>
- private static void AssertReadLittleEndian64(byte[] data, ulong value) {
- CodedInputStream input = CodedInputStream.CreateInstance(data);
- Assert.AreEqual(value, input.ReadRawLittleEndian64());
-
- // Try different block sizes.
- for (int blockSize = 1; blockSize <= 16; blockSize *= 2) {
- input = CodedInputStream.CreateInstance(
- new SmallBlockInputStream(data, blockSize));
- Assert.AreEqual(value, input.ReadRawLittleEndian64());
- }
- }
-
- [Test]
- public void ReadLittleEndian() {
- AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678);
- AssertReadLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0);
-
- AssertReadLittleEndian64(Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12),
- 0x123456789abcdef0L);
- AssertReadLittleEndian64(
- Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL);
- }
-
- [Test]
- public void DecodeZigZag32() {
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2));
- Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3));
- Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE));
- Assert.AreEqual(unchecked((int)0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF));
- Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE));
- Assert.AreEqual(unchecked((int)0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF));
- }
-
- [Test]
- public void DecodeZigZag64() {
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2));
- Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3));
- Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL));
- Assert.AreEqual(unchecked((long)0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL));
- Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL));
- Assert.AreEqual(unchecked((long)0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL));
- Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL));
- Assert.AreEqual(unchecked((long)0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL));
- }
-
- [Test]
- public void ReadWholeMessage() {
- TestAllTypes message = TestUtil.GetAllSet();
-
- byte[] rawBytes = message.ToByteArray();
- Assert.AreEqual(rawBytes.Length, message.SerializedSize);
- TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes);
- TestUtil.AssertAllFieldsSet(message2);
-
- // Try different block sizes.
- for (int blockSize = 1; blockSize < 256; blockSize *= 2) {
- message2 = TestAllTypes.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize));
- TestUtil.AssertAllFieldsSet(message2);
- }
- }
-
- [Test]
- public void SkipWholeMessage() {
- TestAllTypes message = TestUtil.GetAllSet();
- byte[] rawBytes = message.ToByteArray();
-
- // Create two parallel inputs. Parse one as unknown fields while using
- // skipField() to skip each field on the other. Expect the same tags.
- CodedInputStream input1 = CodedInputStream.CreateInstance(rawBytes);
- CodedInputStream input2 = CodedInputStream.CreateInstance(rawBytes);
- UnknownFieldSet.Builder unknownFields = UnknownFieldSet.CreateBuilder();
-
- while (true) {
- uint tag = input1.ReadTag();
- Assert.AreEqual(tag, input2.ReadTag());
- if (tag == 0) {
- break;
- }
- unknownFields.MergeFieldFrom(tag, input1);
- input2.SkipField(tag);
- }
- }
-
- public void ReadHugeBlob() {
- // Allocate and initialize a 1MB blob.
- byte[] blob = new byte[1 << 20];
- for (int i = 0; i < blob.Length; i++) {
- blob[i] = (byte)i;
- }
-
- // Make a message containing it.
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TestUtil.SetAllFields(builder);
- builder.SetOptionalBytes(ByteString.CopyFrom(blob));
- TestAllTypes message = builder.Build();
-
- // Serialize and parse it. Make sure to parse from an InputStream, not
- // directly from a ByteString, so that CodedInputStream uses buffered
- // reading.
- TestAllTypes message2 = TestAllTypes.ParseFrom(message.ToByteString().CreateCodedInput());
-
- Assert.AreEqual(message.OptionalBytes, message2.OptionalBytes);
-
- // Make sure all the other fields were parsed correctly.
- TestAllTypes message3 = TestAllTypes.CreateBuilder(message2)
- .SetOptionalBytes(TestUtil.GetAllSet().OptionalBytes)
- .Build();
- TestUtil.AssertAllFieldsSet(message3);
- }
-
- [Test]
- public void ReadMaliciouslyLargeBlob() {
- MemoryStream ms = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(ms);
-
- uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited);
- output.WriteRawVarint32(tag);
- output.WriteRawVarint32(0x7FFFFFFF);
- output.WriteRawBytes(new byte[32]); // Pad with a few random bytes.
- output.Flush();
- ms.Position = 0;
-
- CodedInputStream input = CodedInputStream.CreateInstance(ms);
- Assert.AreEqual(tag, input.ReadTag());
-
- try {
- input.ReadBytes();
- Assert.Fail("Should have thrown an exception!");
- } catch (InvalidProtocolBufferException) {
- // success.
- }
- }
-
- private static TestRecursiveMessage MakeRecursiveMessage(int depth) {
- if (depth == 0) {
- return TestRecursiveMessage.CreateBuilder().SetI(5).Build();
- } else {
- return TestRecursiveMessage.CreateBuilder()
- .SetA(MakeRecursiveMessage(depth - 1)).Build();
- }
- }
-
- private static void AssertMessageDepth(TestRecursiveMessage message, int depth) {
- if (depth == 0) {
- Assert.IsFalse(message.HasA);
- Assert.AreEqual(5, message.I);
- } else {
- Assert.IsTrue(message.HasA);
- AssertMessageDepth(message.A, depth - 1);
- }
- }
-
- [Test]
- public void MaliciousRecursion() {
- ByteString data64 = MakeRecursiveMessage(64).ToByteString();
- ByteString data65 = MakeRecursiveMessage(65).ToByteString();
-
- AssertMessageDepth(TestRecursiveMessage.ParseFrom(data64), 64);
-
- try {
- TestRecursiveMessage.ParseFrom(data65);
- Assert.Fail("Should have thrown an exception!");
- } catch (InvalidProtocolBufferException) {
- // success.
- }
-
- CodedInputStream input = data64.CreateCodedInput();
- input.SetRecursionLimit(8);
- try {
- TestRecursiveMessage.ParseFrom(input);
- Assert.Fail("Should have thrown an exception!");
- } catch (InvalidProtocolBufferException) {
- // success.
- }
- }
-
- [Test]
- public void SizeLimit() {
- // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't
- // apply to the latter case.
- MemoryStream ms = new MemoryStream(TestUtil.GetAllSet().ToByteString().ToByteArray());
- CodedInputStream input = CodedInputStream.CreateInstance(ms);
- input.SetSizeLimit(16);
-
- try {
- TestAllTypes.ParseFrom(input);
- Assert.Fail("Should have thrown an exception!");
- } catch (InvalidProtocolBufferException) {
- // success.
- }
- }
-
- /// <summary>
- /// Tests that if we read an string that contains invalid UTF-8, no exception
- /// is thrown. Instead, the invalid bytes are replaced with the Unicode
- /// "replacement character" U+FFFD.
- /// </summary>
- [Test]
- public void ReadInvalidUtf8() {
- MemoryStream ms = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(ms);
-
- uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited);
- output.WriteRawVarint32(tag);
- output.WriteRawVarint32(1);
- output.WriteRawBytes(new byte[] { 0x80 });
- output.Flush();
- ms.Position = 0;
-
- CodedInputStream input = CodedInputStream.CreateInstance(ms);
- Assert.AreEqual(tag, input.ReadTag());
- string text = input.ReadString();
- Assert.AreEqual('\ufffd', text[0]);
- }
-
- /// <summary>
- /// A stream which limits the number of bytes it reads at a time.
- /// We use this to make sure that CodedInputStream doesn't screw up when
- /// reading in small blocks.
- /// </summary>
- private sealed class SmallBlockInputStream : MemoryStream {
- private readonly int blockSize;
-
- public SmallBlockInputStream(byte[] data, int blockSize)
- : base(data) {
- this.blockSize = blockSize;
- }
-
- public override int Read(byte[] buffer, int offset, int count) {
- return base.Read(buffer, offset, Math.Min(count, blockSize));
- }
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs b/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs
deleted file mode 100644
index d6a4e672..00000000
--- a/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System.IO;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class CodedOutputStreamTest {
-
- /// <summary>
- /// Writes the given value using WriteRawVarint32() and WriteRawVarint64() and
- /// checks that the result matches the given bytes
- /// </summary>
- private static void AssertWriteVarint(byte[] data, ulong value) {
- // Only do 32-bit write if the value fits in 32 bits.
- if ((value >> 32) == 0) {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
- output.WriteRawVarint32((uint) value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
- // Also try computing size.
- Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value));
- }
-
- {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
- output.WriteRawVarint64(value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
-
- // Also try computing size.
- Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value));
- }
-
- // Try different buffer sizes.
- for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) {
- // Only do 32-bit write if the value fits in 32 bits.
- if ((value >> 32) == 0) {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output =
- CodedOutputStream.CreateInstance(rawOutput, bufferSize);
- output.WriteRawVarint32((uint) value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
- }
-
- {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput, bufferSize);
- output.WriteRawVarint64(value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
- }
- }
- }
-
- /// <summary>
- /// Tests WriteRawVarint32() and WriteRawVarint64()
- /// </summary>
- [Test]
- public void WriteVarint() {
- AssertWriteVarint(new byte[] {0x00}, 0);
- AssertWriteVarint(new byte[] {0x01}, 1);
- AssertWriteVarint(new byte[] {0x7f}, 127);
- // 14882
- AssertWriteVarint(new byte[] {0xa2, 0x74}, (0x22 << 0) | (0x74 << 7));
- // 2961488830
- AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x0b},
- (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) |
- (0x0bL << 28));
-
- // 64-bit
- // 7256456126
- AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x1b},
- (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) |
- (0x1bL << 28));
- // 41256202580718336
- AssertWriteVarint(
- new byte[] {0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49},
- (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) |
- (0x43UL << 28) | (0x49L << 35) | (0x24UL << 42) | (0x49UL << 49));
- // 11964378330978735131
- AssertWriteVarint(
- new byte[] {0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01},
- unchecked((ulong)
- ((0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) |
- (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) |
- (0x05L << 49) | (0x26L << 56) | (0x01L << 63))));
- }
-
- /// <summary>
- /// Parses the given bytes using WriteRawLittleEndian32() and checks
- /// that the result matches the given value.
- /// </summary>
- private static void AssertWriteLittleEndian32(byte[] data, uint value) {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
- output.WriteRawLittleEndian32(value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
-
- // Try different buffer sizes.
- for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) {
- rawOutput = new MemoryStream();
- output = CodedOutputStream.CreateInstance(rawOutput, bufferSize);
- output.WriteRawLittleEndian32(value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
- }
- }
-
- /// <summary>
- /// Parses the given bytes using WriteRawLittleEndian64() and checks
- /// that the result matches the given value.
- /// </summary>
- private static void AssertWriteLittleEndian64(byte[] data, ulong value) {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
- output.WriteRawLittleEndian64(value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
-
- // Try different block sizes.
- for (int blockSize = 1; blockSize <= 16; blockSize *= 2) {
- rawOutput = new MemoryStream();
- output = CodedOutputStream.CreateInstance(rawOutput, blockSize);
- output.WriteRawLittleEndian64(value);
- output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
- }
- }
-
- /// <summary>
- /// Tests writeRawLittleEndian32() and writeRawLittleEndian64().
- /// </summary>
- [Test]
- public void WriteLittleEndian() {
- AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678);
- AssertWriteLittleEndian32(new byte[] {0xf0, 0xde, 0xbc, 0x9a}, 0x9abcdef0);
-
- AssertWriteLittleEndian64(
- new byte[]{0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12},
- 0x123456789abcdef0L);
- AssertWriteLittleEndian64(
- new byte[]{0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a},
- 0x9abcdef012345678UL);
- }
-
- [Test]
- public void WriteWholeMessage() {
- TestAllTypes message = TestUtil.GetAllSet();
-
- byte[] rawBytes = message.ToByteArray();
- TestUtil.AssertEqualBytes(TestUtil.GoldenMessage.ToByteArray(), rawBytes);
-
- // Try different block sizes.
- for (int blockSize = 1; blockSize < 256; blockSize *= 2) {
- MemoryStream rawOutput = new MemoryStream();
- CodedOutputStream output =
- CodedOutputStream.CreateInstance(rawOutput, blockSize);
- message.WriteTo(output);
- output.Flush();
- TestUtil.AssertEqualBytes(rawBytes, rawOutput.ToArray());
- }
- }
-
-
- [Test]
- public void EncodeZigZag32() {
- Assert.AreEqual(0, CodedOutputStream.EncodeZigZag32( 0));
- Assert.AreEqual(1, CodedOutputStream.EncodeZigZag32(-1));
- Assert.AreEqual(2, CodedOutputStream.EncodeZigZag32( 1));
- Assert.AreEqual(3, CodedOutputStream.EncodeZigZag32(-2));
- Assert.AreEqual(0x7FFFFFFE, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF));
- Assert.AreEqual(0x7FFFFFFF, CodedOutputStream.EncodeZigZag32(unchecked((int)0xC0000000)));
- Assert.AreEqual(0xFFFFFFFE, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF));
- Assert.AreEqual(0xFFFFFFFF, CodedOutputStream.EncodeZigZag32(unchecked((int)0x80000000)));
- }
-
- [Test]
- public void EncodeZigZag64() {
- Assert.AreEqual(0, CodedOutputStream.EncodeZigZag64( 0));
- Assert.AreEqual(1, CodedOutputStream.EncodeZigZag64(-1));
- Assert.AreEqual(2, CodedOutputStream.EncodeZigZag64( 1));
- Assert.AreEqual(3, CodedOutputStream.EncodeZigZag64(-2));
- Assert.AreEqual(0x000000007FFFFFFEL,
- CodedOutputStream.EncodeZigZag64(unchecked((long)0x000000003FFFFFFFUL)));
- Assert.AreEqual(0x000000007FFFFFFFL,
- CodedOutputStream.EncodeZigZag64(unchecked((long)0xFFFFFFFFC0000000UL)));
- Assert.AreEqual(0x00000000FFFFFFFEL,
- CodedOutputStream.EncodeZigZag64(unchecked((long)0x000000007FFFFFFFUL)));
- Assert.AreEqual(0x00000000FFFFFFFFL,
- CodedOutputStream.EncodeZigZag64(unchecked((long)0xFFFFFFFF80000000UL)));
- Assert.AreEqual(0xFFFFFFFFFFFFFFFEL,
- CodedOutputStream.EncodeZigZag64(unchecked((long)0x7FFFFFFFFFFFFFFFUL)));
- Assert.AreEqual(0xFFFFFFFFFFFFFFFFL,
- CodedOutputStream.EncodeZigZag64(unchecked((long)0x8000000000000000UL)));
- }
-
- [Test]
- public void RoundTripZigZag32() {
- // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1)
- // were chosen semi-randomly via keyboard bashing.
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0)));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1)));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1)));
- Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927)));
- Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612)));
- }
-
- [Test]
- public void RoundTripZigZag64() {
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0)));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1)));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1)));
- Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927)));
- Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612)));
-
- Assert.AreEqual(856912304801416L, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L)));
- Assert.AreEqual(-75123905439571256L, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L)));
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
deleted file mode 100644
index 6943672d..00000000
--- a/csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers.Collections {
- [TestFixture]
- public class PopsicleListTest {
-
- [Test]
- public void MutatingOperationsOnFrozenList() {
- PopsicleList<string> list = new PopsicleList<string>();
- list.MakeReadOnly();
- AssertNotSupported(() => list.Add(""));
- AssertNotSupported(() => list.Clear());
- AssertNotSupported(() => list.Insert(0, ""));
- AssertNotSupported(() => list.Remove(""));
- AssertNotSupported(() => list.RemoveAt(0));
- }
-
- [Test]
- public void NonMutatingOperationsOnFrozenList() {
- PopsicleList<string> list = new PopsicleList<string>();
- list.MakeReadOnly();
- Assert.IsFalse(list.Contains(""));
- Assert.AreEqual(0, list.Count);
- list.CopyTo(new string[5], 0);
- list.GetEnumerator();
- Assert.AreEqual(-1, list.IndexOf(""));
- Assert.IsTrue(list.IsReadOnly);
- }
-
- [Test]
- public void MutatingOperationsOnFluidList() {
- PopsicleList<string> list = new PopsicleList<string>();
- list.Add("");
- list.Clear();
- list.Insert(0, "");
- list.Remove("");
- list.Add("x"); // Just to make the next call valid
- list.RemoveAt(0);
- }
-
- [Test]
- public void NonMutatingOperationsOnFluidList() {
- PopsicleList<string> list = new PopsicleList<string>();
- Assert.IsFalse(list.Contains(""));
- Assert.AreEqual(0, list.Count);
- list.CopyTo(new string[5], 0);
- list.GetEnumerator();
- Assert.AreEqual(-1, list.IndexOf(""));
- Assert.IsFalse(list.IsReadOnly);
- }
-
- private static void AssertNotSupported(Action action) {
- try {
- action();
- Assert.Fail("Expected NotSupportedException");
- } catch (NotSupportedException) {
- // Expected
- }
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/DescriptorsTest.cs b/csharp/ProtocolBuffers.Test/DescriptorsTest.cs
deleted file mode 100644
index c00d413e..00000000
--- a/csharp/ProtocolBuffers.Test/DescriptorsTest.cs
+++ /dev/null
@@ -1,273 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.Collections.Generic;
-using System.Text;
-using NUnit.Framework;
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-
-namespace Google.ProtocolBuffers {
- /// <summary>
- /// Tests for descriptors. (Not in its own namespace or broken up into individual classes as the
- /// size doesn't warrant it. On the other hand, this makes me feel a bit dirty...)
- /// </summary>
- [TestFixture]
- public class DescriptorsTest {
-
- [Test]
- public void FileDescriptor() {
- FileDescriptor file = UnitTestProtoFile.Descriptor;
-
- Assert.AreEqual("google/protobuf/unittest.proto", file.Name);
- Assert.AreEqual("protobuf_unittest", file.Package);
-
- Assert.AreEqual("UnittestProto", file.Options.JavaOuterClassname);
- Assert.AreEqual("google/protobuf/unittest.proto", file.Proto.Name);
-
- Assert.AreEqual(1, file.Dependencies.Count);
- Assert.AreEqual(UnitTestImportProtoFile.Descriptor, file.Dependencies[0]);
-
- MessageDescriptor messageType = TestAllTypes.Descriptor;
- Assert.AreEqual(messageType, file.MessageTypes[0]);
- Assert.AreEqual(messageType, file.FindTypeByName<MessageDescriptor>("TestAllTypes"));
- Assert.IsNull(file.FindTypeByName<MessageDescriptor>("NoSuchType"));
- Assert.IsNull(file.FindTypeByName<MessageDescriptor>("protobuf_unittest.TestAllTypes"));
- for (int i = 0; i < file.MessageTypes.Count; i++) {
- Assert.AreEqual(i, file.MessageTypes[i].Index);
- }
-
- Assert.AreEqual(file.EnumTypes[0], file.FindTypeByName<EnumDescriptor>("ForeignEnum"));
- Assert.IsNull(file.FindTypeByName<EnumDescriptor>("NoSuchType"));
- Assert.IsNull(file.FindTypeByName<EnumDescriptor>("protobuf_unittest.ForeignEnum"));
- Assert.AreEqual(1, UnitTestImportProtoFile.Descriptor.EnumTypes.Count);
- Assert.AreEqual("ImportEnum", UnitTestImportProtoFile.Descriptor.EnumTypes[0].Name);
- for (int i = 0; i < file.EnumTypes.Count; i++) {
- Assert.AreEqual(i, file.EnumTypes[i].Index);
- }
-
- ServiceDescriptor service = TestService.Descriptor;
- Assert.AreEqual(service, file.Services[0]);
- Assert.AreEqual(service, file.FindTypeByName<ServiceDescriptor>("TestService"));
- Assert.IsNull(file.FindTypeByName<ServiceDescriptor>("NoSuchType"));
- Assert.IsNull(file.FindTypeByName<ServiceDescriptor>("protobuf_unittest.TestService"));
- Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Services.Count);
- for (int i = 0; i < file.Services.Count; i++) {
- Assert.AreEqual(i, file.Services[i].Index);
- }
-
- FieldDescriptor extension = UnitTestProtoFile.OptionalInt32Extension.Descriptor;
- Assert.AreEqual(extension, file.Extensions[0]);
- Assert.AreEqual(extension, file.FindTypeByName<FieldDescriptor>("optional_int32_extension"));
- Assert.IsNull(file.FindTypeByName<FieldDescriptor>("no_such_ext"));
- Assert.IsNull(file.FindTypeByName<FieldDescriptor>("protobuf_unittest.optional_int32_extension"));
- Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Extensions.Count);
- for (int i = 0; i < file.Extensions.Count; i++) {
- Assert.AreEqual(i, file.Extensions[i].Index);
- }
- }
-
- [Test]
- public void MessageDescriptor() {
- MessageDescriptor messageType = TestAllTypes.Descriptor;
- MessageDescriptor nestedType = TestAllTypes.Types.NestedMessage.Descriptor;
-
- Assert.AreEqual("TestAllTypes", messageType.Name);
- Assert.AreEqual("protobuf_unittest.TestAllTypes", messageType.FullName);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, messageType.File);
- Assert.IsNull(messageType.ContainingType);
- Assert.AreEqual(DescriptorProtos.MessageOptions.DefaultInstance, messageType.Options);
- Assert.AreEqual("TestAllTypes", messageType.Proto.Name);
-
- Assert.AreEqual("NestedMessage", nestedType.Name);
- Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.FullName);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, nestedType.File);
- Assert.AreEqual(messageType, nestedType.ContainingType);
-
- FieldDescriptor field = messageType.Fields[0];
- Assert.AreEqual("optional_int32", field.Name);
- Assert.AreEqual(field, messageType.FindDescriptor<FieldDescriptor>("optional_int32"));
- Assert.IsNull(messageType.FindDescriptor<FieldDescriptor>("no_such_field"));
- Assert.AreEqual(field, messageType.FindFieldByNumber(1));
- Assert.IsNull(messageType.FindFieldByNumber(571283));
- for (int i = 0; i < messageType.Fields.Count; i++) {
- Assert.AreEqual(i, messageType.Fields[i].Index);
- }
-
- Assert.AreEqual(nestedType, messageType.NestedTypes[0]);
- Assert.AreEqual(nestedType, messageType.FindDescriptor<MessageDescriptor>("NestedMessage"));
- Assert.IsNull(messageType.FindDescriptor<MessageDescriptor>("NoSuchType"));
- for (int i = 0; i < messageType.NestedTypes.Count; i++) {
- Assert.AreEqual(i, messageType.NestedTypes[i].Index);
- }
-
- Assert.AreEqual(messageType.EnumTypes[0], messageType.FindDescriptor<EnumDescriptor>("NestedEnum"));
- Assert.IsNull(messageType.FindDescriptor<EnumDescriptor>("NoSuchType"));
- for (int i = 0; i < messageType.EnumTypes.Count; i++) {
- Assert.AreEqual(i, messageType.EnumTypes[i].Index);
- }
- }
-
- [Test]
- public void FieldDescriptor() {
- MessageDescriptor messageType = TestAllTypes.Descriptor;
- FieldDescriptor primitiveField = messageType.FindDescriptor<FieldDescriptor>("optional_int32");
- FieldDescriptor enumField = messageType.FindDescriptor<FieldDescriptor>("optional_nested_enum");
- FieldDescriptor messageField = messageType.FindDescriptor<FieldDescriptor>("optional_foreign_message");
- FieldDescriptor cordField = messageType.FindDescriptor<FieldDescriptor>("optional_cord");
- FieldDescriptor extension = UnitTestProtoFile.OptionalInt32Extension.Descriptor;
- FieldDescriptor nestedExtension = TestRequired.Single.Descriptor;
-
- Assert.AreEqual("optional_int32", primitiveField.Name);
- Assert.AreEqual("protobuf_unittest.TestAllTypes.optional_int32",
- primitiveField.FullName);
- Assert.AreEqual(1, primitiveField.FieldNumber);
- Assert.AreEqual(messageType, primitiveField.ContainingType);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, primitiveField.File);
- Assert.AreEqual(FieldType.Int32, primitiveField.FieldType);
- Assert.AreEqual(MappedType.Int32, primitiveField.MappedType);
- Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, primitiveField.Options);
- Assert.IsFalse(primitiveField.IsExtension);
- Assert.AreEqual("optional_int32", primitiveField.Proto.Name);
-
- Assert.AreEqual("optional_nested_enum", enumField.Name);
- Assert.AreEqual(FieldType.Enum, enumField.FieldType);
- Assert.AreEqual(MappedType.Enum, enumField.MappedType);
- // Assert.AreEqual(TestAllTypes.Types.NestedEnum.Descriptor, enumField.EnumType);
-
- Assert.AreEqual("optional_foreign_message", messageField.Name);
- Assert.AreEqual(FieldType.Message, messageField.FieldType);
- Assert.AreEqual(MappedType.Message, messageField.MappedType);
- Assert.AreEqual(ForeignMessage.Descriptor, messageField.MessageType);
-
- Assert.AreEqual("optional_cord", cordField.Name);
- Assert.AreEqual(FieldType.String, cordField.FieldType);
- Assert.AreEqual(MappedType.String, cordField.MappedType);
- Assert.AreEqual(DescriptorProtos.FieldOptions.Types.CType.CORD, cordField.Options.Ctype);
-
- Assert.AreEqual("optional_int32_extension", extension.Name);
- Assert.AreEqual("protobuf_unittest.optional_int32_extension", extension.FullName);
- Assert.AreEqual(1, extension.FieldNumber);
- Assert.AreEqual(TestAllExtensions.Descriptor, extension.ContainingType);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, extension.File);
- Assert.AreEqual(FieldType.Int32, extension.FieldType);
- Assert.AreEqual(MappedType.Int32, extension.MappedType);
- Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance,
- extension.Options);
- Assert.IsTrue(extension.IsExtension);
- Assert.AreEqual(null, extension.ExtensionScope);
- Assert.AreEqual("optional_int32_extension", extension.Proto.Name);
-
- Assert.AreEqual("single", nestedExtension.Name);
- Assert.AreEqual("protobuf_unittest.TestRequired.single",
- nestedExtension.FullName);
- Assert.AreEqual(TestRequired.Descriptor,
- nestedExtension.ExtensionScope);
- }
-
- [Test]
- public void FieldDescriptorLabel() {
- FieldDescriptor requiredField =
- TestRequired.Descriptor.FindDescriptor<FieldDescriptor>("a");
- FieldDescriptor optionalField =
- TestAllTypes.Descriptor.FindDescriptor<FieldDescriptor>("optional_int32");
- FieldDescriptor repeatedField =
- TestAllTypes.Descriptor.FindDescriptor<FieldDescriptor>("repeated_int32");
-
- Assert.IsTrue(requiredField.IsRequired);
- Assert.IsFalse(requiredField.IsRepeated);
- Assert.IsFalse(optionalField.IsRequired);
- Assert.IsFalse(optionalField.IsRepeated);
- Assert.IsFalse(repeatedField.IsRequired);
- Assert.IsTrue(repeatedField.IsRepeated);
- }
-
- [Test]
- public void FieldDescriptorDefault() {
- MessageDescriptor d = TestAllTypes.Descriptor;
- Assert.IsFalse(d.FindDescriptor<FieldDescriptor>("optional_int32").HasDefaultValue);
- Assert.AreEqual(0, d.FindDescriptor<FieldDescriptor>("optional_int32").DefaultValue);
- Assert.IsTrue(d.FindDescriptor<FieldDescriptor>("default_int32").HasDefaultValue);
- Assert.AreEqual(41, d.FindDescriptor<FieldDescriptor>("default_int32").DefaultValue);
-
- d = TestExtremeDefaultValues.Descriptor;
- Assert.AreEqual(ByteString.CopyFrom("\u0000\u0001\u0007\b\f\n\r\t\u000b\\\'\"\u00fe", Encoding.GetEncoding(28591)),
- d.FindDescriptor<FieldDescriptor>("escaped_bytes").DefaultValue);
- Assert.AreEqual(uint.MaxValue, d.FindDescriptor<FieldDescriptor>("large_uint32").DefaultValue);
- Assert.AreEqual(ulong.MaxValue, d.FindDescriptor<FieldDescriptor>("large_uint64").DefaultValue);
- }
-
- [Test]
- public void EnumDescriptor() {
- // Note: this test is a bit different to the Java version because there's no static way of getting to the descriptor
- EnumDescriptor enumType = UnitTestProtoFile.Descriptor.FindTypeByName<EnumDescriptor>("ForeignEnum");
- EnumDescriptor nestedType = TestAllTypes.Descriptor.FindDescriptor<EnumDescriptor>("NestedEnum");
-
- Assert.AreEqual("ForeignEnum", enumType.Name);
- Assert.AreEqual("protobuf_unittest.ForeignEnum", enumType.FullName);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, enumType.File);
- Assert.IsNull(enumType.ContainingType);
- Assert.AreEqual(DescriptorProtos.EnumOptions.DefaultInstance,
- enumType.Options);
-
- Assert.AreEqual("NestedEnum", nestedType.Name);
- Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedEnum",
- nestedType.FullName);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, nestedType.File);
- Assert.AreEqual(TestAllTypes.Descriptor, nestedType.ContainingType);
-
- EnumValueDescriptor value = enumType.FindValueByName("FOREIGN_FOO");
- Assert.AreEqual(value, enumType.Values[0]);
- Assert.AreEqual("FOREIGN_FOO", value.Name);
- Assert.AreEqual(4, value.Number);
- Assert.AreEqual((int) ForeignEnum.FOREIGN_FOO, value.Number);
- Assert.AreEqual(value, enumType.FindValueByNumber(4));
- Assert.IsNull(enumType.FindValueByName("NO_SUCH_VALUE"));
- for (int i = 0; i < enumType.Values.Count; i++) {
- Assert.AreEqual(i, enumType.Values[i].Index);
- }
- }
-
- [Test]
- public void ServiceDescriptor() {
- ServiceDescriptor service = TestService.Descriptor;
-
- Assert.AreEqual("TestService", service.Name);
- Assert.AreEqual("protobuf_unittest.TestService", service.FullName);
- Assert.AreEqual(UnitTestProtoFile.Descriptor, service.File);
-
- Assert.AreEqual(2, service.Methods.Count);
-
- MethodDescriptor fooMethod = service.Methods[0];
- Assert.AreEqual("Foo", fooMethod.Name);
- Assert.AreEqual(FooRequest.Descriptor, fooMethod.InputType);
- Assert.AreEqual(FooResponse.Descriptor, fooMethod.OutputType);
- Assert.AreEqual(fooMethod, service.FindMethodByName("Foo"));
-
- MethodDescriptor barMethod = service.Methods[1];
- Assert.AreEqual("Bar", barMethod.Name);
- Assert.AreEqual(BarRequest.Descriptor, barMethod.InputType);
- Assert.AreEqual(BarResponse.Descriptor, barMethod.OutputType);
- Assert.AreEqual(barMethod, service.FindMethodByName("Bar"));
-
- Assert.IsNull(service.FindMethodByName("NoSuchMethod"));
-
- for (int i = 0; i < service.Methods.Count; i++) {
- Assert.AreEqual(i, service.Methods[i].Index);
- }
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/DynamicMessageTest.cs b/csharp/ProtocolBuffers.Test/DynamicMessageTest.cs
deleted file mode 100644
index 11fc2d82..00000000
--- a/csharp/ProtocolBuffers.Test/DynamicMessageTest.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-using Google.ProtocolBuffers.TestProtos;
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class DynamicMessageTest {
-
- private ReflectionTester reflectionTester;
- private ReflectionTester extensionsReflectionTester;
-
- [SetUp]
- public void SetUp() {
- reflectionTester = ReflectionTester.CreateTestAllTypesInstance();
- extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance();
- }
-
- [Test]
- public void DynamicMessageAccessors() {
- IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
- reflectionTester.SetAllFieldsViaReflection(builder);
- IMessage message = builder.WeakBuild();
- reflectionTester.AssertAllFieldsSetViaReflection(message);
- }
-
- [Test]
- public void DynamicMessageExtensionAccessors() {
- // We don't need to extensively test DynamicMessage's handling of
- // extensions because, frankly, it doesn't do anything special with them.
- // It treats them just like any other fields.
- IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor);
- extensionsReflectionTester.SetAllFieldsViaReflection(builder);
- IMessage message = builder.WeakBuild();
- extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
- }
-
- [Test]
- public void DynamicMessageRepeatedSetters() {
- IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
- reflectionTester.SetAllFieldsViaReflection(builder);
- reflectionTester.ModifyRepeatedFieldsViaReflection(builder);
- IMessage message = builder.WeakBuild();
- reflectionTester.AssertRepeatedFieldsModifiedViaReflection(message);
- }
-
- [Test]
- public void DynamicMessageDefaults() {
- reflectionTester.AssertClearViaReflection(DynamicMessage.GetDefaultInstance(TestAllTypes.Descriptor));
- reflectionTester.AssertClearViaReflection(DynamicMessage.CreateBuilder(TestAllTypes.Descriptor).Build());
- }
-
- [Test]
- public void DynamicMessageSerializedSize() {
- TestAllTypes message = TestUtil.GetAllSet();
-
- IBuilder dynamicBuilder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
- reflectionTester.SetAllFieldsViaReflection(dynamicBuilder);
- IMessage dynamicMessage = dynamicBuilder.WeakBuild();
-
- Assert.AreEqual(message.SerializedSize, dynamicMessage.SerializedSize);
- }
-
- [Test]
- public void DynamicMessageSerialization() {
- IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
- reflectionTester.SetAllFieldsViaReflection(builder);
- IMessage message = builder.WeakBuild();
-
- ByteString rawBytes = message.ToByteString();
- TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes);
-
- TestUtil.AssertAllFieldsSet(message2);
-
- // In fact, the serialized forms should be exactly the same, byte-for-byte.
- Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), rawBytes);
- }
-
- [Test]
- public void DynamicMessageParsing() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TestUtil.SetAllFields(builder);
- TestAllTypes message = builder.Build();
-
- ByteString rawBytes = message.ToByteString();
-
- IMessage message2 = DynamicMessage.ParseFrom(TestAllTypes.Descriptor, rawBytes);
- reflectionTester.AssertAllFieldsSetViaReflection(message2);
- }
-
- [Test]
- public void DynamicMessageCopy() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TestUtil.SetAllFields(builder);
- TestAllTypes message = builder.Build();
-
- DynamicMessage copy = DynamicMessage.CreateBuilder(message).Build();
- reflectionTester.AssertAllFieldsSetViaReflection(copy);
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/GeneratedMessageTest.cs b/csharp/ProtocolBuffers.Test/GeneratedMessageTest.cs
deleted file mode 100644
index c820b582..00000000
--- a/csharp/ProtocolBuffers.Test/GeneratedMessageTest.cs
+++ /dev/null
@@ -1,290 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.Collections.Generic;
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class GeneratedMessageTest {
- ReflectionTester reflectionTester;
- ReflectionTester extensionsReflectionTester;
-
- [SetUp]
- public void SetUp() {
- reflectionTester = ReflectionTester.CreateTestAllTypesInstance();
- extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance();
- }
-
- [Test]
- public void RepeatedAddPrimitiveBeforeBuild() {
- TestAllTypes message = new TestAllTypes.Builder { RepeatedInt32List = { 1, 2, 3 } }.Build();
- TestUtil.AssertEqual(new int[]{1, 2, 3}, message.RepeatedInt32List);
- }
-
- [Test]
- public void AddPrimitiveFailsAfterBuild() {
- TestAllTypes.Builder builder = new TestAllTypes.Builder();
- IList<int> list = builder.RepeatedInt32List;
- list.Add(1); // Fine
- builder.Build();
-
- try {
- list.Add(2);
- Assert.Fail("List should be frozen");
- } catch (NotSupportedException) {
- // Expected
- }
- }
-
- [Test]
- public void RepeatedAddMessageBeforeBuild() {
- TestAllTypes message = new TestAllTypes.Builder {
- RepeatedNestedMessageList = { new TestAllTypes.Types.NestedMessage.Builder { Bb = 10 }.Build() } }.Build();
- Assert.AreEqual(1, message.RepeatedNestedMessageCount);
- Assert.AreEqual(10, message.RepeatedNestedMessageList[0].Bb);
- }
-
- [Test]
- public void AddMessageFailsAfterBuild() {
- TestAllTypes.Builder builder = new TestAllTypes.Builder();
- IList<TestAllTypes.Types.NestedMessage> list = builder.RepeatedNestedMessageList;
- builder.Build();
-
- try {
- list.Add(new TestAllTypes.Types.NestedMessage.Builder { Bb = 10 }.Build());
- Assert.Fail("List should be frozen");
- } catch (NotSupportedException) {
- // Expected
- }
- }
-
- [Test]
- public void DefaultInstance() {
- Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.DefaultInstance.DefaultInstanceForType);
- Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().DefaultInstanceForType);
- }
-
- [Test]
- public void Accessors() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TestUtil.SetAllFields(builder);
- TestAllTypes message = builder.Build();
- TestUtil.AssertAllFieldsSet(message);
- }
-
- [Test]
- public void RepeatedSetters() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TestUtil.SetAllFields(builder);
- TestUtil.ModifyRepeatedFields(builder);
- TestAllTypes message = builder.Build();
- TestUtil.AssertRepeatedFieldsModified(message);
- }
-
- [Test]
- public void RepeatedAppend() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
-
- builder.AddRangeRepeatedInt32(new int[]{1, 2, 3, 4});
- builder.AddRangeRepeatedForeignEnum((new ForeignEnum[] { ForeignEnum.FOREIGN_BAZ }));
-
- ForeignMessage foreignMessage = ForeignMessage.CreateBuilder().SetC(12).Build();
- builder.AddRangeRepeatedForeignMessage(new ForeignMessage[] {foreignMessage});
-
- TestAllTypes message = builder.Build();
- TestUtil.AssertEqual(message.RepeatedInt32List, new int[]{1, 2, 3, 4});
- TestUtil.AssertEqual(message.RepeatedForeignEnumList, new ForeignEnum[] {ForeignEnum.FOREIGN_BAZ});
- Assert.AreEqual(1, message.RepeatedForeignMessageCount);
- Assert.AreEqual(12, message.GetRepeatedForeignMessage(0).C);
- }
-
- [Test]
- public void SettingForeignMessageUsingBuilder() {
- TestAllTypes message = TestAllTypes.CreateBuilder()
- // Pass builder for foreign message instance.
- .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(123))
- .Build();
- TestAllTypes expectedMessage = TestAllTypes.CreateBuilder()
- // Create expected version passing foreign message instance explicitly.
- .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(123).Build())
- .Build();
- Assert.AreEqual(expectedMessage, message);
- }
-
- [Test]
- public void SettingRepeatedForeignMessageUsingBuilder() {
- TestAllTypes message = TestAllTypes.CreateBuilder()
- // Pass builder for foreign message instance.
- .AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(456))
- .Build();
- TestAllTypes expectedMessage = TestAllTypes.CreateBuilder()
- // Create expected version passing foreign message instance explicitly.
- .AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(456).Build())
- .Build();
- Assert.AreEqual(expectedMessage, message);
- }
-
-
- [Test]
- public void Defaults() {
- TestUtil.AssertClear(TestAllTypes.DefaultInstance);
- TestUtil.AssertClear(TestAllTypes.CreateBuilder().Build());
-
- Assert.AreEqual("\u1234", TestExtremeDefaultValues.DefaultInstance.Utf8String);
- }
-
- [Test]
- public void ReflectionGetters() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TestUtil.SetAllFields(builder);
- TestAllTypes message = builder.Build();
- reflectionTester.AssertAllFieldsSetViaReflection(message);
- }
-
- [Test]
- public void ReflectionSetters() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- reflectionTester.SetAllFieldsViaReflection(builder);
- TestAllTypes message = builder.Build();
- TestUtil.AssertAllFieldsSet(message);
- }
-
- [Test]
- public void ReflectionRepeatedSetters() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- reflectionTester.SetAllFieldsViaReflection(builder);
- reflectionTester.ModifyRepeatedFieldsViaReflection(builder);
- TestAllTypes message = builder.Build();
- TestUtil.AssertRepeatedFieldsModified(message);
- }
-
- [Test]
- public void ReflectionDefaults() {
- reflectionTester.AssertClearViaReflection(TestAllTypes.DefaultInstance);
- reflectionTester.AssertClearViaReflection(TestAllTypes.CreateBuilder().Build());
- }
- // =================================================================
- // Extensions.
-
- [Test]
- public void ExtensionAccessors() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- TestUtil.SetAllExtensions(builder);
- TestAllExtensions message = builder.Build();
- TestUtil.AssertAllExtensionsSet(message);
- }
-
- [Test]
- public void ExtensionRepeatedSetters() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- TestUtil.SetAllExtensions(builder);
- TestUtil.ModifyRepeatedExtensions(builder);
- TestAllExtensions message = builder.Build();
- TestUtil.AssertRepeatedExtensionsModified(message);
- }
-
- [Test]
- public void ExtensionDefaults() {
- TestUtil.AssertExtensionsClear(TestAllExtensions.DefaultInstance);
- TestUtil.AssertExtensionsClear(TestAllExtensions.CreateBuilder().Build());
- }
-
- [Test]
- public void ExtensionReflectionGetters() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- TestUtil.SetAllExtensions(builder);
- TestAllExtensions message = builder.Build();
- extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
- }
-
- [Test]
- public void ExtensionReflectionSetters() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- extensionsReflectionTester.SetAllFieldsViaReflection(builder);
- TestAllExtensions message = builder.Build();
- TestUtil.AssertAllExtensionsSet(message);
- }
-
- [Test]
- public void ExtensionReflectionRepeatedSetters() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- extensionsReflectionTester.SetAllFieldsViaReflection(builder);
- extensionsReflectionTester.ModifyRepeatedFieldsViaReflection(builder);
- TestAllExtensions message = builder.Build();
- TestUtil.AssertRepeatedExtensionsModified(message);
- }
-
- [Test]
- public void ExtensionReflectionDefaults() {
- extensionsReflectionTester.AssertClearViaReflection(TestAllExtensions.DefaultInstance);
- extensionsReflectionTester.AssertClearViaReflection(TestAllExtensions.CreateBuilder().Build());
- }
-
- [Test]
- public void ClearExtension() {
- // ClearExtension() is not actually used in TestUtil, so try it manually.
- Assert.IsFalse(TestAllExtensions.CreateBuilder()
- .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 1)
- .ClearExtension(UnitTestProtoFile.OptionalInt32Extension)
- .HasExtension(UnitTestProtoFile.OptionalInt32Extension));
- Assert.AreEqual(0, TestAllExtensions.CreateBuilder()
- .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 1)
- .ClearExtension(UnitTestProtoFile.RepeatedInt32Extension)
- .GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension));
- }
-
- [Test]
- public void MultipleFilesOption() {
- // We mostly just want to check that things compile.
- MessageWithNoOuter message = MessageWithNoOuter.CreateBuilder()
- .SetNested(MessageWithNoOuter.Types.NestedMessage.CreateBuilder().SetI(1))
- .AddForeign(TestAllTypes.CreateBuilder().SetOptionalInt32(1))
- .SetNestedEnum(MessageWithNoOuter.Types.NestedEnum.BAZ)
- .SetForeignEnum(EnumWithNoOuter.BAR)
- .Build();
- Assert.AreEqual(message, MessageWithNoOuter.ParseFrom(message.ToByteString()));
-
- Assert.AreEqual(MultiFileProto.Descriptor, MessageWithNoOuter.Descriptor.File);
-
- FieldDescriptor field = MessageWithNoOuter.Descriptor.FindDescriptor<FieldDescriptor>("foreign_enum");
- Assert.AreEqual(MultiFileProto.Descriptor.FindTypeByName<EnumDescriptor>("EnumWithNoOuter")
- .FindValueByNumber((int)EnumWithNoOuter.BAR), message[field]);
-
- Assert.AreEqual(MultiFileProto.Descriptor, ServiceWithNoOuter.Descriptor.File);
-
- Assert.IsFalse(TestAllExtensions.DefaultInstance.HasExtension(MultiFileProto.ExtensionWithOuter));
- }
-
- [Test]
- public void OptionalFieldWithRequiredSubfieldsOptimizedForSize() {
- TestOptionalOptimizedForSize message = TestOptionalOptimizedForSize.DefaultInstance;
- Assert.IsTrue(message.IsInitialized);
-
- message = TestOptionalOptimizedForSize.CreateBuilder().SetO(
- TestRequiredOptimizedForSize.CreateBuilder().BuildPartial()
- ).BuildPartial();
- Assert.IsFalse(message.IsInitialized);
-
- message = TestOptionalOptimizedForSize.CreateBuilder().SetO(
- TestRequiredOptimizedForSize.CreateBuilder().SetX(5).BuildPartial()
- ).BuildPartial();
- Assert.IsTrue(message.IsInitialized);
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/MessageStreamIteratorTest.cs b/csharp/ProtocolBuffers.Test/MessageStreamIteratorTest.cs
deleted file mode 100644
index 0cccd4a7..00000000
--- a/csharp/ProtocolBuffers.Test/MessageStreamIteratorTest.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using NUnit.Framework;
-using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class MessageStreamIteratorTest {
-
- [Test]
- public void ThreeMessagesInMemory() {
- MemoryStream stream = new MemoryStream(MessageStreamWriterTest.ThreeMessageData);
- IEnumerable<NestedMessage> iterator = MessageStreamIterator<NestedMessage>.FromStreamProvider(() => stream);
- List<NestedMessage> messages = new List<NestedMessage>(iterator);
-
- Assert.AreEqual(3, messages.Count);
- Assert.AreEqual(5, messages[0].Bb);
- Assert.AreEqual(1500, messages[1].Bb);
- Assert.IsFalse(messages[2].HasBb);
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/MessageStreamWriterTest.cs b/csharp/ProtocolBuffers.Test/MessageStreamWriterTest.cs
deleted file mode 100644
index 9cbe2b33..00000000
--- a/csharp/ProtocolBuffers.Test/MessageStreamWriterTest.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.IO;
-using NUnit.Framework;
-using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class MessageStreamWriterTest {
-
- internal static readonly byte[] ThreeMessageData = new byte[] {
- (1 << 3) | 2, 2, // Field 1, 2 bytes long (first message)
- (1 << 3) | 0, 5, // Field 1, value 5
- (1 << 3) | 2, 3, // Field 1, 3 bytes long (second message)
- (1 << 3) | 0, (1500 & 0x7f) | 0x80, 1500 >> 7, // Field 1, value 1500
- (1 << 3) | 2, 0, // Field 1, no data (third message)
- };
-
- [Test]
- public void ThreeMessages() {
- NestedMessage message1 = new NestedMessage.Builder { Bb = 5 }.Build();
- NestedMessage message2 = new NestedMessage.Builder { Bb = 1500 }.Build();
- NestedMessage message3 = new NestedMessage.Builder().Build();
-
- byte[] data;
- using (MemoryStream stream = new MemoryStream()) {
- MessageStreamWriter<NestedMessage> writer = new MessageStreamWriter<NestedMessage>(stream);
- writer.Write(message1);
- writer.Write(message2);
- writer.Write(message3);
- writer.Flush();
- data = stream.ToArray();
- }
-
- TestUtil.AssertEqualBytes(ThreeMessageData, data);
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/MessageTest.cs b/csharp/ProtocolBuffers.Test/MessageTest.cs
deleted file mode 100644
index d206e78f..00000000
--- a/csharp/ProtocolBuffers.Test/MessageTest.cs
+++ /dev/null
@@ -1,299 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- /// <summary>
- /// Miscellaneous tests for message operations that apply to both
- /// generated and dynamic messages.
- /// </summary>
- [TestFixture]
- public class MessageTest {
- // =================================================================
- // Message-merging tests.
-
- private static readonly TestAllTypes MergeSource = new TestAllTypes.Builder {
- OptionalInt32 = 1,
- OptionalString = "foo",
- OptionalForeignMessage = ForeignMessage.DefaultInstance,
- }.AddRepeatedString("bar").Build();
-
- private static readonly TestAllTypes MergeDest = new TestAllTypes.Builder {
- OptionalInt64 = 2,
- OptionalString = "baz",
- OptionalForeignMessage = new ForeignMessage.Builder { C=3 }.Build(),
- }.AddRepeatedString("qux").Build();
-
- private const string MergeResultText =
- "optional_int32: 1\n" +
- "optional_int64: 2\n" +
- "optional_string: \"foo\"\n" +
- "optional_foreign_message {\n" +
- " c: 3\n" +
- "}\n" +
- "repeated_string: \"qux\"\n" +
- "repeated_string: \"bar\"\n";
-
- [Test]
- public void MergeFrom() {
- TestAllTypes result = TestAllTypes.CreateBuilder(MergeDest).MergeFrom(MergeSource).Build();
-
- Assert.AreEqual(MergeResultText, result.ToString());
- }
-
- /// <summary>
- /// Test merging a DynamicMessage into a GeneratedMessage.
- /// As long as they have the same descriptor, this should work, but it is an
- /// entirely different code path.
- /// </summary>
- [Test]
- public void MergeFromDynamic() {
- TestAllTypes result = (TestAllTypes) TestAllTypes.CreateBuilder(MergeDest)
- .MergeFrom(DynamicMessage.CreateBuilder(MergeSource).Build())
- .Build();
-
- Assert.AreEqual(MergeResultText, result.ToString());
- }
-
- /// <summary>
- /// Test merging two DynamicMessages.
- /// </summary>
- [Test]
- public void DynamicMergeFrom() {
- DynamicMessage result = (DynamicMessage) DynamicMessage.CreateBuilder(MergeDest)
- .MergeFrom((DynamicMessage) DynamicMessage.CreateBuilder(MergeSource).Build())
- .Build();
-
- Assert.AreEqual(MergeResultText, result.ToString());
- }
-
- // =================================================================
- // Required-field-related tests.
-
- private static readonly TestRequired TestRequiredUninitialized = TestRequired.DefaultInstance;
- private static readonly TestRequired TestRequiredInitialized = new TestRequired.Builder {
- A = 1, B = 2, C = 3
- }.Build();
-
- [Test]
- public void Initialization() {
- TestRequired.Builder builder = TestRequired.CreateBuilder();
-
- Assert.IsFalse(builder.IsInitialized);
- builder.A = 1;
- Assert.IsFalse(builder.IsInitialized);
- builder.B = 1;
- Assert.IsFalse(builder.IsInitialized);
- builder.C = 1;
- Assert.IsTrue(builder.IsInitialized);
- }
-
- [Test]
- public void RequiredForeign() {
- TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder();
-
- Assert.IsTrue(builder.IsInitialized);
-
- builder.SetOptionalMessage(TestRequiredUninitialized);
- Assert.IsFalse(builder.IsInitialized);
-
- builder.SetOptionalMessage(TestRequiredInitialized);
- Assert.IsTrue(builder.IsInitialized);
-
- builder.AddRepeatedMessage(TestRequiredUninitialized);
- Assert.IsFalse(builder.IsInitialized);
-
- builder.SetRepeatedMessage(0, TestRequiredInitialized);
- Assert.IsTrue(builder.IsInitialized);
- }
-
- [Test]
- public void RequiredExtension() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
-
- Assert.IsTrue(builder.IsInitialized);
-
- builder.SetExtension(TestRequired.Single, TestRequiredUninitialized);
- Assert.IsFalse(builder.IsInitialized);
-
- builder.SetExtension(TestRequired.Single, TestRequiredInitialized);
- Assert.IsTrue(builder.IsInitialized);
-
- builder.AddExtension(TestRequired.Multi, TestRequiredUninitialized);
- Assert.IsFalse(builder.IsInitialized);
-
- builder.SetExtension(TestRequired.Multi, 0, TestRequiredInitialized);
- Assert.IsTrue(builder.IsInitialized);
- }
-
- [Test]
- public void RequiredDynamic() {
- MessageDescriptor descriptor = TestRequired.Descriptor;
- DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(descriptor);
-
- Assert.IsFalse(builder.IsInitialized);
- builder[descriptor.FindDescriptor<FieldDescriptor>("a")] = 1;
- Assert.IsFalse(builder.IsInitialized);
- builder[descriptor.FindDescriptor<FieldDescriptor>("b")] = 1;
- Assert.IsFalse(builder.IsInitialized);
- builder[descriptor.FindDescriptor<FieldDescriptor>("c")] = 1;
- Assert.IsTrue(builder.IsInitialized);
- }
-
- [Test]
- public void RequiredDynamicForeign() {
- MessageDescriptor descriptor = TestRequiredForeign.Descriptor;
- DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(descriptor);
-
- Assert.IsTrue(builder.IsInitialized);
-
- builder[descriptor.FindDescriptor<FieldDescriptor>("optional_message")] = TestRequiredUninitialized;
- Assert.IsFalse(builder.IsInitialized);
-
- builder[descriptor.FindDescriptor<FieldDescriptor>("optional_message")] = TestRequiredInitialized;
- Assert.IsTrue(builder.IsInitialized);
-
- builder.AddRepeatedField(descriptor.FindDescriptor<FieldDescriptor>("repeated_message"), TestRequiredUninitialized);
- Assert.IsFalse(builder.IsInitialized);
-
- builder.SetRepeatedField(descriptor.FindDescriptor<FieldDescriptor>("repeated_message"), 0, TestRequiredInitialized);
- Assert.IsTrue(builder.IsInitialized);
- }
-
- [Test]
- public void UninitializedException() {
- try {
- TestRequired.CreateBuilder().Build();
- Assert.Fail("Should have thrown an exception.");
- } catch (UninitializedMessageException e) {
- Assert.AreEqual("Message missing required fields: a, b, c", e.Message);
- }
- }
-
- [Test]
- public void BuildPartial() {
- // We're mostly testing that no exception is thrown.
- TestRequired message = TestRequired.CreateBuilder().BuildPartial();
- Assert.IsFalse(message.IsInitialized);
- }
-
- [Test]
- public void NestedUninitializedException() {
- try {
- TestRequiredForeign.CreateBuilder()
- .SetOptionalMessage(TestRequiredUninitialized)
- .AddRepeatedMessage(TestRequiredUninitialized)
- .AddRepeatedMessage(TestRequiredUninitialized)
- .Build();
- Assert.Fail("Should have thrown an exception.");
- } catch (UninitializedMessageException e) {
- Assert.AreEqual(
- "Message missing required fields: " +
- "optional_message.a, " +
- "optional_message.b, " +
- "optional_message.c, " +
- "repeated_message[0].a, " +
- "repeated_message[0].b, " +
- "repeated_message[0].c, " +
- "repeated_message[1].a, " +
- "repeated_message[1].b, " +
- "repeated_message[1].c",
- e.Message);
- }
- }
-
- [Test]
- public void BuildNestedPartial() {
- // We're mostly testing that no exception is thrown.
- TestRequiredForeign message =
- TestRequiredForeign.CreateBuilder()
- .SetOptionalMessage(TestRequiredUninitialized)
- .AddRepeatedMessage(TestRequiredUninitialized)
- .AddRepeatedMessage(TestRequiredUninitialized)
- .BuildPartial();
- Assert.IsFalse(message.IsInitialized);
- }
-
- [Test]
- public void ParseUnititialized() {
- try {
- TestRequired.ParseFrom(ByteString.Empty);
- Assert.Fail("Should have thrown an exception.");
- } catch (InvalidProtocolBufferException e) {
- Assert.AreEqual("Message missing required fields: a, b, c", e.Message);
- }
- }
-
- [Test]
- public void ParseNestedUnititialized() {
- ByteString data =
- TestRequiredForeign.CreateBuilder()
- .SetOptionalMessage(TestRequiredUninitialized)
- .AddRepeatedMessage(TestRequiredUninitialized)
- .AddRepeatedMessage(TestRequiredUninitialized)
- .BuildPartial().ToByteString();
-
- try {
- TestRequiredForeign.ParseFrom(data);
- Assert.Fail("Should have thrown an exception.");
- } catch (InvalidProtocolBufferException e) {
- Assert.AreEqual(
- "Message missing required fields: " +
- "optional_message.a, " +
- "optional_message.b, " +
- "optional_message.c, " +
- "repeated_message[0].a, " +
- "repeated_message[0].b, " +
- "repeated_message[0].c, " +
- "repeated_message[1].a, " +
- "repeated_message[1].b, " +
- "repeated_message[1].c",
- e.Message);
- }
- }
-
- [Test]
- public void DynamicUninitializedException() {
- try {
- DynamicMessage.CreateBuilder(TestRequired.Descriptor).Build();
- Assert.Fail("Should have thrown an exception.");
- } catch (UninitializedMessageException e) {
- Assert.AreEqual("Message missing required fields: a, b, c", e.Message);
- }
- }
-
- [Test]
- public void DynamicBuildPartial() {
- // We're mostly testing that no exception is thrown.
- DynamicMessage message = DynamicMessage.CreateBuilder(TestRequired.Descriptor).BuildPartial();
- Assert.IsFalse(message.Initialized);
- }
-
- [Test]
- public void DynamicParseUnititialized() {
- try {
- MessageDescriptor descriptor = TestRequired.Descriptor;
- DynamicMessage.ParseFrom(descriptor, ByteString.Empty);
- Assert.Fail("Should have thrown an exception.");
- } catch (InvalidProtocolBufferException e) {
- Assert.AreEqual("Message missing required fields: a, b, c", e.Message);
- }
- }
- }
-
-}
diff --git a/csharp/ProtocolBuffers.Test/Properties/AssemblyInfo.cs b/csharp/ProtocolBuffers.Test/Properties/AssemblyInfo.cs
deleted file mode 100644
index 93ff802f..00000000
--- a/csharp/ProtocolBuffers.Test/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ProtocolBuffers.Test")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ProtocolBuffers.Test")]
-[assembly: AssemblyCopyright("Copyright © 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("54e627c3-daaa-4850-82cf-f25b7f097e78")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/csharp/ProtocolBuffers.Test/Properties/Google.ProtocolBuffers.Test.snk b/csharp/ProtocolBuffers.Test/Properties/Google.ProtocolBuffers.Test.snk
deleted file mode 100644
index 20046fb2..00000000
--- a/csharp/ProtocolBuffers.Test/Properties/Google.ProtocolBuffers.Test.snk
+++ /dev/null
Binary files differ
diff --git a/csharp/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
deleted file mode 100644
index 6335c614..00000000
--- a/csharp/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{DD01ED24-3750-4567-9A23-1DB676A15610}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Google.ProtocolBuffers</RootNamespace>
- <AssemblyName>Google.ProtocolBuffers.Test</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>Properties\Google.ProtocolBuffers.Test.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Mocks, Version=3.5.0.2, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\Rhino.Mocks.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AbstractMessageTest.cs" />
- <Compile Include="ByteStringTest.cs" />
- <Compile Include="CodedInputStreamTest.cs" />
- <Compile Include="CodedOutputStreamTest.cs" />
- <Compile Include="Collections\PopsicleListTest.cs" />
- <Compile Include="DescriptorsTest.cs" />
- <Compile Include="DynamicMessageTest.cs" />
- <Compile Include="GeneratedMessageTest.cs" />
- <Compile Include="MessageStreamIteratorTest.cs" />
- <Compile Include="MessageStreamWriterTest.cs" />
- <Compile Include="MessageTest.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ReflectionTester.cs" />
- <Compile Include="ServiceTest.cs" />
- <Compile Include="TestProtos\EnumWithNoOuter.cs" />
- <Compile Include="TestProtos\MessageWithNoOuter.cs" />
- <Compile Include="TestProtos\MultiFileProto.cs" />
- <Compile Include="TestProtos\ServiceWithNoOuter.cs" />
- <Compile Include="TestProtos\UnitTestEmbedOptimizeForProtoFile.cs" />
- <Compile Include="TestProtos\UnitTestImportProtoFile.cs" />
- <Compile Include="TestProtos\UnitTestMessageSetProtoFile.cs" />
- <Compile Include="TestProtos\UnitTestOptimizeForProtoFile.cs" />
- <Compile Include="TestProtos\UnitTestProtoFile.cs" />
- <Compile Include="TestUtil.cs" />
- <Compile Include="TextFormatTest.cs" />
- <Compile Include="UnknownFieldSetTest.cs" />
- <Compile Include="WireFormatTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
- <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
- <Name>ProtocolBuffers</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="Properties\Google.ProtocolBuffers.Test.snk" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project> \ No newline at end of file
diff --git a/csharp/ProtocolBuffers.Test/ReflectionTester.cs b/csharp/ProtocolBuffers.Test/ReflectionTester.cs
deleted file mode 100644
index 0a4b9646..00000000
--- a/csharp/ProtocolBuffers.Test/ReflectionTester.cs
+++ /dev/null
@@ -1,796 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- /// <summary>
- /// Performs the same things that the methods of TestUtil do, but
- /// via the reflection interface. This is its own class because it needs
- /// to know what descriptor to use.
- /// </summary>
- internal class ReflectionTester {
- private readonly MessageDescriptor baseDescriptor;
- private readonly ExtensionRegistry extensionRegistry;
-
- private readonly FileDescriptor file;
- private readonly FileDescriptor importFile;
-
- private readonly MessageDescriptor optionalGroup;
- private readonly MessageDescriptor repeatedGroup;
- private readonly MessageDescriptor nestedMessage;
- private readonly MessageDescriptor foreignMessage;
- private readonly MessageDescriptor importMessage;
-
- private readonly FieldDescriptor groupA;
- private readonly FieldDescriptor repeatedGroupA;
- private readonly FieldDescriptor nestedB;
- private readonly FieldDescriptor foreignC;
- private readonly FieldDescriptor importD;
-
- private readonly EnumDescriptor nestedEnum;
- private readonly EnumDescriptor foreignEnum;
- private readonly EnumDescriptor importEnum;
-
- private readonly EnumValueDescriptor nestedFoo;
- private readonly EnumValueDescriptor nestedBar;
- private readonly EnumValueDescriptor nestedBaz;
- private readonly EnumValueDescriptor foreignFoo;
- private readonly EnumValueDescriptor foreignBar;
- private readonly EnumValueDescriptor foreignBaz;
- private readonly EnumValueDescriptor importFoo;
- private readonly EnumValueDescriptor importBar;
- private readonly EnumValueDescriptor importBaz;
-
- /// <summary>
- /// Constructs an instance that will expect messages using the given
- /// descriptor. Normally <paramref name="baseDescriptor"/> should be
- /// a descriptor for TestAllTypes. However, if extensionRegistry is non-null,
- /// then baseDescriptor should be for TestAllExtensions instead, and instead of
- /// reading and writing normal fields, the tester will read and write extensions.
- /// All of the TestAllExtensions extensions must be registered in the registry.
- /// </summary>
- private ReflectionTester(MessageDescriptor baseDescriptor,
- ExtensionRegistry extensionRegistry) {
- this.baseDescriptor = baseDescriptor;
- this.extensionRegistry = extensionRegistry;
-
- this.file = baseDescriptor.File;
- Assert.AreEqual(1, file.Dependencies.Count);
- this.importFile = file.Dependencies[0];
-
- MessageDescriptor testAllTypes;
- if (extensionRegistry == null) {
- testAllTypes = baseDescriptor;
- } else {
- testAllTypes = file.FindTypeByName<MessageDescriptor>("TestAllTypes");
- Assert.IsNotNull(testAllTypes);
- }
-
- if (extensionRegistry == null) {
- this.optionalGroup =
- baseDescriptor.FindDescriptor<MessageDescriptor>("OptionalGroup");
- this.repeatedGroup =
- baseDescriptor.FindDescriptor<MessageDescriptor>("RepeatedGroup");
- } else {
- this.optionalGroup =
- file.FindTypeByName<MessageDescriptor>("OptionalGroup_extension");
- this.repeatedGroup =
- file.FindTypeByName<MessageDescriptor>("RepeatedGroup_extension");
- }
- this.nestedMessage = testAllTypes.FindDescriptor<MessageDescriptor>("NestedMessage");
- this.foreignMessage = file.FindTypeByName<MessageDescriptor>("ForeignMessage");
- this.importMessage = importFile.FindTypeByName<MessageDescriptor>("ImportMessage");
-
- this.nestedEnum = testAllTypes.FindDescriptor<EnumDescriptor>("NestedEnum");
- this.foreignEnum = file.FindTypeByName<EnumDescriptor>("ForeignEnum");
- this.importEnum = importFile.FindTypeByName<EnumDescriptor>("ImportEnum");
-
- Assert.IsNotNull(optionalGroup );
- Assert.IsNotNull(repeatedGroup );
- Assert.IsNotNull(nestedMessage );
- Assert.IsNotNull(foreignMessage);
- Assert.IsNotNull(importMessage );
- Assert.IsNotNull(nestedEnum );
- Assert.IsNotNull(foreignEnum );
- Assert.IsNotNull(importEnum );
-
- this.nestedB = nestedMessage.FindDescriptor<FieldDescriptor>("bb");
- this.foreignC = foreignMessage.FindDescriptor<FieldDescriptor>("c");
- this.importD = importMessage .FindDescriptor<FieldDescriptor>("d");
- this.nestedFoo = nestedEnum.FindValueByName("FOO");
- this.nestedBar = nestedEnum.FindValueByName("BAR");
- this.nestedBaz = nestedEnum.FindValueByName("BAZ");
- this.foreignFoo = foreignEnum.FindValueByName("FOREIGN_FOO");
- this.foreignBar = foreignEnum.FindValueByName("FOREIGN_BAR");
- this.foreignBaz = foreignEnum.FindValueByName("FOREIGN_BAZ");
- this.importFoo = importEnum.FindValueByName("IMPORT_FOO");
- this.importBar = importEnum.FindValueByName("IMPORT_BAR");
- this.importBaz = importEnum.FindValueByName("IMPORT_BAZ");
-
- this.groupA = optionalGroup.FindDescriptor<FieldDescriptor>("a");
- this.repeatedGroupA = repeatedGroup.FindDescriptor<FieldDescriptor>("a");
-
- Assert.IsNotNull(groupA );
- Assert.IsNotNull(repeatedGroupA);
- Assert.IsNotNull(nestedB );
- Assert.IsNotNull(foreignC );
- Assert.IsNotNull(importD );
- Assert.IsNotNull(nestedFoo );
- Assert.IsNotNull(nestedBar );
- Assert.IsNotNull(nestedBaz );
- Assert.IsNotNull(foreignFoo );
- Assert.IsNotNull(foreignBar );
- Assert.IsNotNull(foreignBaz );
- Assert.IsNotNull(importFoo );
- Assert.IsNotNull(importBar );
- Assert.IsNotNull(importBaz );
- }
-
- /// <summary>
- /// Creates an instance for the TestAllTypes message, with no extension registry.
- /// </summary>
- public static ReflectionTester CreateTestAllTypesInstance() {
- return new ReflectionTester(TestAllTypes.Descriptor, null);
- }
-
- /// <summary>
- /// Creates an instance for the TestAllExtensions message, with an
- /// extension registry from TestUtil.CreateExtensionRegistry.
- /// </summary>
- public static ReflectionTester CreateTestAllExtensionsInstance() {
- return new ReflectionTester(TestAllExtensions.Descriptor, TestUtil.CreateExtensionRegistry());
- }
-
- /// <summary>
- /// Shorthand to get a FieldDescriptor for a field of unittest::TestAllTypes.
- /// </summary>
- private FieldDescriptor f(String name) {
- FieldDescriptor result;
- if (extensionRegistry == null) {
- result = baseDescriptor.FindDescriptor<FieldDescriptor>(name);
- } else {
- result = file.FindTypeByName<FieldDescriptor>(name + "_extension");
- }
- Assert.IsNotNull(result);
- return result;
- }
-
- /// <summary>
- /// Calls parent.CreateBuilderForField() or uses the extension registry
- /// to find an appropriate builder, depending on what type is being tested.
- /// </summary>
- private IBuilder CreateBuilderForField(IBuilder parent, FieldDescriptor field) {
- if (extensionRegistry == null) {
- return parent.CreateBuilderForField(field);
- } else {
- ExtensionInfo extension = extensionRegistry[field.ContainingType, field.FieldNumber];
- Assert.IsNotNull(extension);
- Assert.IsNotNull(extension.DefaultInstance);
- return extension.DefaultInstance.WeakCreateBuilderForType();
- }
- }
-
- /// <summary>
- /// Sets every field of the message to the values expected by
- /// AssertAllFieldsSet, using the reflection interface.
- /// </summary>
- /// <param name="message"></param>
- internal void SetAllFieldsViaReflection(IBuilder message) {
- message[f("optional_int32" )] = 101 ;
- message[f("optional_int64" )] = 102L;
- message[f("optional_uint32" )] = 103U ;
- message[f("optional_uint64" )] = 104UL;
- message[f("optional_sint32" )] = 105 ;
- message[f("optional_sint64" )] = 106L;
- message[f("optional_fixed32" )] = 107U ;
- message[f("optional_fixed64" )] = 108UL;
- message[f("optional_sfixed32")] = 109 ;
- message[f("optional_sfixed64")] = 110L;
- message[f("optional_float" )] = 111F;
- message[f("optional_double" )] = 112D;
- message[f("optional_bool" )] = true;
- message[f("optional_string" )] = "115";
- message[f("optional_bytes")] = TestUtil.ToBytes("116");
-
- message[f("optionalgroup")] = CreateBuilderForField(message, f("optionalgroup")).SetField(groupA, 117).WeakBuild();
- message[f("optional_nested_message")] = CreateBuilderForField(message, f("optional_nested_message")).SetField(nestedB, 118).WeakBuild();
- message[f("optional_foreign_message")] = CreateBuilderForField(message, f("optional_foreign_message")).SetField(foreignC, 119).WeakBuild();
- message[f("optional_import_message")] = CreateBuilderForField(message, f("optional_import_message")).SetField(importD, 120).WeakBuild();
-
- message[f("optional_nested_enum" )] = nestedBaz;
- message[f("optional_foreign_enum")] = foreignBaz;
- message[f("optional_import_enum" )] = importBaz;
-
- message[f("optional_string_piece" )] = "124";
- message[f("optional_cord" )] = "125";
-
- // -----------------------------------------------------------------
-
- message.WeakAddRepeatedField(f("repeated_int32" ), 201 );
- message.WeakAddRepeatedField(f("repeated_int64" ), 202L);
- message.WeakAddRepeatedField(f("repeated_uint32" ), 203U );
- message.WeakAddRepeatedField(f("repeated_uint64" ), 204UL);
- message.WeakAddRepeatedField(f("repeated_sint32" ), 205 );
- message.WeakAddRepeatedField(f("repeated_sint64" ), 206L);
- message.WeakAddRepeatedField(f("repeated_fixed32" ), 207U );
- message.WeakAddRepeatedField(f("repeated_fixed64" ), 208UL);
- message.WeakAddRepeatedField(f("repeated_sfixed32"), 209 );
- message.WeakAddRepeatedField(f("repeated_sfixed64"), 210L);
- message.WeakAddRepeatedField(f("repeated_float" ), 211F);
- message.WeakAddRepeatedField(f("repeated_double" ), 212D);
- message.WeakAddRepeatedField(f("repeated_bool" ), true);
- message.WeakAddRepeatedField(f("repeated_string" ), "215");
- message.WeakAddRepeatedField(f("repeated_bytes" ), TestUtil.ToBytes("216"));
-
-
- message.WeakAddRepeatedField(f("repeatedgroup"), CreateBuilderForField(message, f("repeatedgroup")).SetField(repeatedGroupA, 217).WeakBuild());
- message.WeakAddRepeatedField(f("repeated_nested_message"), CreateBuilderForField(message, f("repeated_nested_message")).SetField(nestedB, 218).WeakBuild());
- message.WeakAddRepeatedField(f("repeated_foreign_message"), CreateBuilderForField(message, f("repeated_foreign_message")).SetField(foreignC, 219).WeakBuild());
- message.WeakAddRepeatedField(f("repeated_import_message"), CreateBuilderForField(message, f("repeated_import_message")).SetField(importD, 220).WeakBuild());
-
- message.WeakAddRepeatedField(f("repeated_nested_enum" ), nestedBar);
- message.WeakAddRepeatedField(f("repeated_foreign_enum"), foreignBar);
- message.WeakAddRepeatedField(f("repeated_import_enum" ), importBar);
-
- message.WeakAddRepeatedField(f("repeated_string_piece" ), "224");
- message.WeakAddRepeatedField(f("repeated_cord" ), "225");
-
- // Add a second one of each field.
- message.WeakAddRepeatedField(f("repeated_int32" ), 301 );
- message.WeakAddRepeatedField(f("repeated_int64" ), 302L);
- message.WeakAddRepeatedField(f("repeated_uint32" ), 303U );
- message.WeakAddRepeatedField(f("repeated_uint64" ), 304UL);
- message.WeakAddRepeatedField(f("repeated_sint32" ), 305 );
- message.WeakAddRepeatedField(f("repeated_sint64" ), 306L);
- message.WeakAddRepeatedField(f("repeated_fixed32" ), 307U );
- message.WeakAddRepeatedField(f("repeated_fixed64" ), 308UL);
- message.WeakAddRepeatedField(f("repeated_sfixed32"), 309 );
- message.WeakAddRepeatedField(f("repeated_sfixed64"), 310L);
- message.WeakAddRepeatedField(f("repeated_float" ), 311F);
- message.WeakAddRepeatedField(f("repeated_double" ), 312D);
- message.WeakAddRepeatedField(f("repeated_bool" ), false);
- message.WeakAddRepeatedField(f("repeated_string" ), "315");
- message.WeakAddRepeatedField(f("repeated_bytes" ), TestUtil.ToBytes("316"));
-
- message.WeakAddRepeatedField(f("repeatedgroup"),
- CreateBuilderForField(message, f("repeatedgroup"))
- .SetField(repeatedGroupA, 317).WeakBuild());
- message.WeakAddRepeatedField(f("repeated_nested_message"),
- CreateBuilderForField(message, f("repeated_nested_message"))
- .SetField(nestedB, 318).WeakBuild());
- message.WeakAddRepeatedField(f("repeated_foreign_message"),
- CreateBuilderForField(message, f("repeated_foreign_message"))
- .SetField(foreignC, 319).WeakBuild());
- message.WeakAddRepeatedField(f("repeated_import_message"),
- CreateBuilderForField(message, f("repeated_import_message"))
- .SetField(importD, 320).WeakBuild());
-
- message.WeakAddRepeatedField(f("repeated_nested_enum" ), nestedBaz);
- message.WeakAddRepeatedField(f("repeated_foreign_enum"), foreignBaz);
- message.WeakAddRepeatedField(f("repeated_import_enum" ), importBaz);
-
- message.WeakAddRepeatedField(f("repeated_string_piece" ), "324");
- message.WeakAddRepeatedField(f("repeated_cord" ), "325");
-
- // -----------------------------------------------------------------
-
- message[f("default_int32" )] = 401 ;
- message[f("default_int64" )] = 402L;
- message[f("default_uint32" )] = 403U ;
- message[f("default_uint64" )] = 404UL;
- message[f("default_sint32" )] = 405 ;
- message[f("default_sint64" )] = 406L;
- message[f("default_fixed32" )] = 407U ;
- message[f("default_fixed64" )] = 408UL;
- message[f("default_sfixed32")] = 409 ;
- message[f("default_sfixed64")] = 410L;
- message[f("default_float" )] = 411F;
- message[f("default_double" )] = 412D;
- message[f("default_bool" )] = false;
- message[f("default_string" )] = "415";
- message[f("default_bytes" )] = TestUtil.ToBytes("416");
-
- message[f("default_nested_enum" )] = nestedFoo;
- message[f("default_foreign_enum")] = foreignFoo;
- message[f("default_import_enum" )] = importFoo;
-
- message[f("default_string_piece" )] = "424";
- message[f("default_cord" )] = "425";
- }
-
- // -------------------------------------------------------------------
-
- /// <summary>
- /// Modify the repeated fields of the specified message to contain the
- /// values expected by AssertRepeatedFieldsModified, using the IBuilder
- /// reflection interface.
- /// </summary>
- internal void ModifyRepeatedFieldsViaReflection(IBuilder message) {
- message[f("repeated_int32" ), 1] = 501 ;
- message[f("repeated_int64" ), 1] = 502L;
- message[f("repeated_uint32" ), 1] = 503U ;
- message[f("repeated_uint64" ), 1] = 504UL;
- message[f("repeated_sint32" ), 1] = 505 ;
- message[f("repeated_sint64" ), 1] = 506L;
- message[f("repeated_fixed32" ), 1] = 507U ;
- message[f("repeated_fixed64" ), 1] = 508UL;
- message[f("repeated_sfixed32"), 1] = 509 ;
- message[f("repeated_sfixed64"), 1] = 510L;
- message[f("repeated_float" ), 1] = 511F;
- message[f("repeated_double" ), 1] = 512D;
- message[f("repeated_bool" ), 1] = true;
- message[f("repeated_string" ), 1] = "515";
- message.SetRepeatedField(f("repeated_bytes" ), 1, TestUtil.ToBytes("516"));
-
- message.SetRepeatedField(f("repeatedgroup"), 1, CreateBuilderForField(message, f("repeatedgroup")).SetField(repeatedGroupA, 517).WeakBuild());
- message.SetRepeatedField(f("repeated_nested_message"), 1, CreateBuilderForField(message, f("repeated_nested_message")).SetField(nestedB, 518).WeakBuild());
- message.SetRepeatedField(f("repeated_foreign_message"), 1, CreateBuilderForField(message, f("repeated_foreign_message")).SetField(foreignC, 519).WeakBuild());
- message.SetRepeatedField(f("repeated_import_message"), 1, CreateBuilderForField(message, f("repeated_import_message")).SetField(importD, 520).WeakBuild());
-
- message[f("repeated_nested_enum" ), 1] = nestedFoo;
- message[f("repeated_foreign_enum"), 1] = foreignFoo;
- message[f("repeated_import_enum" ), 1] = importFoo;
-
- message[f("repeated_string_piece"), 1] = "524";
- message[f("repeated_cord"), 1] = "525";
- }
-
- // -------------------------------------------------------------------
-
- /// <summary>
- /// Asserts that all fields of the specified message are set to the values
- /// assigned by SetAllFields, using the IMessage reflection interface.
- /// </summary>
- public void AssertAllFieldsSetViaReflection(IMessage message) {
- Assert.IsTrue(message.HasField(f("optional_int32" )));
- Assert.IsTrue(message.HasField(f("optional_int64" )));
- Assert.IsTrue(message.HasField(f("optional_uint32" )));
- Assert.IsTrue(message.HasField(f("optional_uint64" )));
- Assert.IsTrue(message.HasField(f("optional_sint32" )));
- Assert.IsTrue(message.HasField(f("optional_sint64" )));
- Assert.IsTrue(message.HasField(f("optional_fixed32" )));
- Assert.IsTrue(message.HasField(f("optional_fixed64" )));
- Assert.IsTrue(message.HasField(f("optional_sfixed32")));
- Assert.IsTrue(message.HasField(f("optional_sfixed64")));
- Assert.IsTrue(message.HasField(f("optional_float" )));
- Assert.IsTrue(message.HasField(f("optional_double" )));
- Assert.IsTrue(message.HasField(f("optional_bool" )));
- Assert.IsTrue(message.HasField(f("optional_string" )));
- Assert.IsTrue(message.HasField(f("optional_bytes" )));
-
- Assert.IsTrue(message.HasField(f("optionalgroup" )));
- Assert.IsTrue(message.HasField(f("optional_nested_message" )));
- Assert.IsTrue(message.HasField(f("optional_foreign_message")));
- Assert.IsTrue(message.HasField(f("optional_import_message" )));
-
- Assert.IsTrue(((IMessage)message[f("optionalgroup")]).HasField(groupA));
- Assert.IsTrue(((IMessage)message[f("optional_nested_message")]).HasField(nestedB));
- Assert.IsTrue(((IMessage)message[f("optional_foreign_message")]).HasField(foreignC));
- Assert.IsTrue(((IMessage)message[f("optional_import_message")]).HasField(importD));
-
- Assert.IsTrue(message.HasField(f("optional_nested_enum" )));
- Assert.IsTrue(message.HasField(f("optional_foreign_enum")));
- Assert.IsTrue(message.HasField(f("optional_import_enum" )));
-
- Assert.IsTrue(message.HasField(f("optional_string_piece")));
- Assert.IsTrue(message.HasField(f("optional_cord")));
-
- Assert.AreEqual(101 , message[f("optional_int32" )]);
- Assert.AreEqual(102L , message[f("optional_int64" )]);
- Assert.AreEqual(103U , message[f("optional_uint32" )]);
- Assert.AreEqual(104UL , message[f("optional_uint64" )]);
- Assert.AreEqual(105 , message[f("optional_sint32" )]);
- Assert.AreEqual(106L , message[f("optional_sint64" )]);
- Assert.AreEqual(107U , message[f("optional_fixed32" )]);
- Assert.AreEqual(108UL , message[f("optional_fixed64" )]);
- Assert.AreEqual(109 , message[f("optional_sfixed32")]);
- Assert.AreEqual(110L , message[f("optional_sfixed64")]);
- Assert.AreEqual(111F , message[f("optional_float" )]);
- Assert.AreEqual(112D , message[f("optional_double" )]);
- Assert.AreEqual(true , message[f("optional_bool" )]);
- Assert.AreEqual("115", message[f("optional_string" )]);
- Assert.AreEqual(TestUtil.ToBytes("116"), message[f("optional_bytes")]);
-
- Assert.AreEqual(117,((IMessage)message[f("optionalgroup")])[groupA]);
- Assert.AreEqual(118,((IMessage)message[f("optional_nested_message")])[nestedB]);
- Assert.AreEqual(119,((IMessage)message[f("optional_foreign_message")])[foreignC]);
- Assert.AreEqual(120,((IMessage)message[f("optional_import_message")])[importD]);
-
- Assert.AreEqual( nestedBaz, message[f("optional_nested_enum" )]);
- Assert.AreEqual(foreignBaz, message[f("optional_foreign_enum")]);
- Assert.AreEqual( importBaz, message[f("optional_import_enum" )]);
-
- Assert.AreEqual("124", message[f("optional_string_piece")]);
- Assert.AreEqual("125", message[f("optional_cord")]);
-
- // -----------------------------------------------------------------
-
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes" )));
-
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum" )));
-
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord")));
-
- Assert.AreEqual(201 , message[f("repeated_int32" ), 0]);
- Assert.AreEqual(202L , message[f("repeated_int64" ), 0]);
- Assert.AreEqual(203U , message[f("repeated_uint32" ), 0]);
- Assert.AreEqual(204UL, message[f("repeated_uint64" ), 0]);
- Assert.AreEqual(205 , message[f("repeated_sint32" ), 0]);
- Assert.AreEqual(206L , message[f("repeated_sint64" ), 0]);
- Assert.AreEqual(207U , message[f("repeated_fixed32" ), 0]);
- Assert.AreEqual(208UL, message[f("repeated_fixed64" ), 0]);
- Assert.AreEqual(209 , message[f("repeated_sfixed32"), 0]);
- Assert.AreEqual(210L , message[f("repeated_sfixed64"), 0]);
- Assert.AreEqual(211F , message[f("repeated_float" ), 0]);
- Assert.AreEqual(212D , message[f("repeated_double" ), 0]);
- Assert.AreEqual(true , message[f("repeated_bool" ), 0]);
- Assert.AreEqual("215", message[f("repeated_string" ), 0]);
- Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]);
-
- Assert.AreEqual(217,((IMessage)message[f("repeatedgroup"), 0])[repeatedGroupA]);
- Assert.AreEqual(218,((IMessage)message[f("repeated_nested_message"), 0])[nestedB]);
- Assert.AreEqual(219,((IMessage)message[f("repeated_foreign_message"), 0])[foreignC]);
- Assert.AreEqual(220,((IMessage)message[f("repeated_import_message"), 0])[importD]);
-
- Assert.AreEqual( nestedBar, message[f("repeated_nested_enum" ),0]);
- Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"),0]);
- Assert.AreEqual( importBar, message[f("repeated_import_enum" ),0]);
-
- Assert.AreEqual("224", message[f("repeated_string_piece"), 0]);
- Assert.AreEqual("225", message[f("repeated_cord"), 0]);
-
- Assert.AreEqual(301 , message[f("repeated_int32" ), 1]);
- Assert.AreEqual(302L , message[f("repeated_int64" ), 1]);
- Assert.AreEqual(303U , message[f("repeated_uint32" ), 1]);
- Assert.AreEqual(304UL, message[f("repeated_uint64" ), 1]);
- Assert.AreEqual(305 , message[f("repeated_sint32" ), 1]);
- Assert.AreEqual(306L , message[f("repeated_sint64" ), 1]);
- Assert.AreEqual(307U , message[f("repeated_fixed32" ), 1]);
- Assert.AreEqual(308UL, message[f("repeated_fixed64" ), 1]);
- Assert.AreEqual(309 , message[f("repeated_sfixed32"), 1]);
- Assert.AreEqual(310L , message[f("repeated_sfixed64"), 1]);
- Assert.AreEqual(311F , message[f("repeated_float" ), 1]);
- Assert.AreEqual(312D , message[f("repeated_double" ), 1]);
- Assert.AreEqual(false, message[f("repeated_bool" ), 1]);
- Assert.AreEqual("315", message[f("repeated_string" ), 1]);
- Assert.AreEqual(TestUtil.ToBytes("316"), message[f("repeated_bytes"), 1]);
-
- Assert.AreEqual(317,((IMessage)message[f("repeatedgroup"), 1])[repeatedGroupA]);
- Assert.AreEqual(318,((IMessage)message[f("repeated_nested_message"), 1])[nestedB]);
- Assert.AreEqual(319,((IMessage)message[f("repeated_foreign_message"), 1])[foreignC]);
- Assert.AreEqual(320,((IMessage)message[f("repeated_import_message"), 1])[importD]);
-
- Assert.AreEqual( nestedBaz, message[f("repeated_nested_enum" ),1]);
- Assert.AreEqual(foreignBaz, message[f("repeated_foreign_enum"),1]);
- Assert.AreEqual( importBaz, message[f("repeated_import_enum" ),1]);
-
- Assert.AreEqual("324", message[f("repeated_string_piece"), 1]);
- Assert.AreEqual("325", message[f("repeated_cord"), 1]);
-
- // -----------------------------------------------------------------
-
- Assert.IsTrue(message.HasField(f("default_int32" )));
- Assert.IsTrue(message.HasField(f("default_int64" )));
- Assert.IsTrue(message.HasField(f("default_uint32" )));
- Assert.IsTrue(message.HasField(f("default_uint64" )));
- Assert.IsTrue(message.HasField(f("default_sint32" )));
- Assert.IsTrue(message.HasField(f("default_sint64" )));
- Assert.IsTrue(message.HasField(f("default_fixed32" )));
- Assert.IsTrue(message.HasField(f("default_fixed64" )));
- Assert.IsTrue(message.HasField(f("default_sfixed32")));
- Assert.IsTrue(message.HasField(f("default_sfixed64")));
- Assert.IsTrue(message.HasField(f("default_float" )));
- Assert.IsTrue(message.HasField(f("default_double" )));
- Assert.IsTrue(message.HasField(f("default_bool" )));
- Assert.IsTrue(message.HasField(f("default_string" )));
- Assert.IsTrue(message.HasField(f("default_bytes" )));
-
- Assert.IsTrue(message.HasField(f("default_nested_enum" )));
- Assert.IsTrue(message.HasField(f("default_foreign_enum")));
- Assert.IsTrue(message.HasField(f("default_import_enum" )));
-
- Assert.IsTrue(message.HasField(f("default_string_piece")));
- Assert.IsTrue(message.HasField(f("default_cord")));
-
- Assert.AreEqual(401 , message[f("default_int32" )]);
- Assert.AreEqual(402L , message[f("default_int64" )]);
- Assert.AreEqual(403U , message[f("default_uint32" )]);
- Assert.AreEqual(404UL, message[f("default_uint64" )]);
- Assert.AreEqual(405 , message[f("default_sint32" )]);
- Assert.AreEqual(406L , message[f("default_sint64" )]);
- Assert.AreEqual(407U , message[f("default_fixed32" )]);
- Assert.AreEqual(408UL, message[f("default_fixed64" )]);
- Assert.AreEqual(409 , message[f("default_sfixed32")]);
- Assert.AreEqual(410L , message[f("default_sfixed64")]);
- Assert.AreEqual(411F , message[f("default_float" )]);
- Assert.AreEqual(412D , message[f("default_double" )]);
- Assert.AreEqual(false, message[f("default_bool" )]);
- Assert.AreEqual("415", message[f("default_string" )]);
- Assert.AreEqual(TestUtil.ToBytes("416"), message[f("default_bytes")]);
-
- Assert.AreEqual( nestedFoo, message[f("default_nested_enum" )]);
- Assert.AreEqual(foreignFoo, message[f("default_foreign_enum")]);
- Assert.AreEqual( importFoo, message[f("default_import_enum" )]);
-
- Assert.AreEqual("424", message[f("default_string_piece")]);
- Assert.AreEqual("425", message[f("default_cord")]);
- }
-
- /// <summary>
- /// Assert that all fields of the message are cleared, and that
- /// getting the fields returns their default values, using the reflection interface.
- /// </summary>
- public void AssertClearViaReflection(IMessage message) {
- // has_blah() should initially be false for all optional fields.
- Assert.IsFalse(message.HasField(f("optional_int32" )));
- Assert.IsFalse(message.HasField(f("optional_int64" )));
- Assert.IsFalse(message.HasField(f("optional_uint32" )));
- Assert.IsFalse(message.HasField(f("optional_uint64" )));
- Assert.IsFalse(message.HasField(f("optional_sint32" )));
- Assert.IsFalse(message.HasField(f("optional_sint64" )));
- Assert.IsFalse(message.HasField(f("optional_fixed32" )));
- Assert.IsFalse(message.HasField(f("optional_fixed64" )));
- Assert.IsFalse(message.HasField(f("optional_sfixed32")));
- Assert.IsFalse(message.HasField(f("optional_sfixed64")));
- Assert.IsFalse(message.HasField(f("optional_float" )));
- Assert.IsFalse(message.HasField(f("optional_double" )));
- Assert.IsFalse(message.HasField(f("optional_bool" )));
- Assert.IsFalse(message.HasField(f("optional_string" )));
- Assert.IsFalse(message.HasField(f("optional_bytes" )));
-
- Assert.IsFalse(message.HasField(f("optionalgroup" )));
- Assert.IsFalse(message.HasField(f("optional_nested_message" )));
- Assert.IsFalse(message.HasField(f("optional_foreign_message")));
- Assert.IsFalse(message.HasField(f("optional_import_message" )));
-
- Assert.IsFalse(message.HasField(f("optional_nested_enum" )));
- Assert.IsFalse(message.HasField(f("optional_foreign_enum")));
- Assert.IsFalse(message.HasField(f("optional_import_enum" )));
-
- Assert.IsFalse(message.HasField(f("optional_string_piece")));
- Assert.IsFalse(message.HasField(f("optional_cord")));
-
- // Optional fields without defaults are set to zero or something like it.
- Assert.AreEqual(0 , message[f("optional_int32" )]);
- Assert.AreEqual(0L , message[f("optional_int64" )]);
- Assert.AreEqual(0U , message[f("optional_uint32" )]);
- Assert.AreEqual(0UL , message[f("optional_uint64" )]);
- Assert.AreEqual(0 , message[f("optional_sint32" )]);
- Assert.AreEqual(0L , message[f("optional_sint64" )]);
- Assert.AreEqual(0U , message[f("optional_fixed32" )]);
- Assert.AreEqual(0UL , message[f("optional_fixed64" )]);
- Assert.AreEqual(0 , message[f("optional_sfixed32")]);
- Assert.AreEqual(0L , message[f("optional_sfixed64")]);
- Assert.AreEqual(0F , message[f("optional_float" )]);
- Assert.AreEqual(0D , message[f("optional_double" )]);
- Assert.AreEqual(false, message[f("optional_bool" )]);
- Assert.AreEqual("" , message[f("optional_string" )]);
- Assert.AreEqual(ByteString.Empty, message[f("optional_bytes")]);
-
- // Embedded messages should also be clear.
- Assert.IsFalse(((IMessage)message[f("optionalgroup")]).HasField(groupA));
- Assert.IsFalse(((IMessage)message[f("optional_nested_message")])
- .HasField(nestedB));
- Assert.IsFalse(((IMessage)message[f("optional_foreign_message")])
- .HasField(foreignC));
- Assert.IsFalse(((IMessage)message[f("optional_import_message")])
- .HasField(importD));
-
- Assert.AreEqual(0,((IMessage)message[f("optionalgroup")])[groupA]);
- Assert.AreEqual(0,((IMessage)message[f("optional_nested_message")])[nestedB]);
- Assert.AreEqual(0,((IMessage)message[f("optional_foreign_message")])[foreignC]);
- Assert.AreEqual(0,((IMessage)message[f("optional_import_message")])[importD]);
-
- // Enums without defaults are set to the first value in the enum.
- Assert.AreEqual( nestedFoo, message[f("optional_nested_enum" )]);
- Assert.AreEqual(foreignFoo, message[f("optional_foreign_enum")]);
- Assert.AreEqual( importFoo, message[f("optional_import_enum" )]);
-
- Assert.AreEqual("", message[f("optional_string_piece")]);
- Assert.AreEqual("", message[f("optional_cord")]);
-
- // Repeated fields are empty.
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int32" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int64" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint32" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint64" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint32" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint64" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed32" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed64" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed32")));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed64")));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_float" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_double" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bool" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bytes" )));
-
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeatedgroup" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_message" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_message")));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_message" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_enum" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_enum" )));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_enum" )));
-
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string_piece")));
- Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_cord")));
-
- // has_blah() should also be false for all default fields.
- Assert.IsFalse(message.HasField(f("default_int32" )));
- Assert.IsFalse(message.HasField(f("default_int64" )));
- Assert.IsFalse(message.HasField(f("default_uint32" )));
- Assert.IsFalse(message.HasField(f("default_uint64" )));
- Assert.IsFalse(message.HasField(f("default_sint32" )));
- Assert.IsFalse(message.HasField(f("default_sint64" )));
- Assert.IsFalse(message.HasField(f("default_fixed32" )));
- Assert.IsFalse(message.HasField(f("default_fixed64" )));
- Assert.IsFalse(message.HasField(f("default_sfixed32")));
- Assert.IsFalse(message.HasField(f("default_sfixed64")));
- Assert.IsFalse(message.HasField(f("default_float" )));
- Assert.IsFalse(message.HasField(f("default_double" )));
- Assert.IsFalse(message.HasField(f("default_bool" )));
- Assert.IsFalse(message.HasField(f("default_string" )));
- Assert.IsFalse(message.HasField(f("default_bytes" )));
-
- Assert.IsFalse(message.HasField(f("default_nested_enum" )));
- Assert.IsFalse(message.HasField(f("default_foreign_enum")));
- Assert.IsFalse(message.HasField(f("default_import_enum" )));
-
- Assert.IsFalse(message.HasField(f("default_string_piece" )));
- Assert.IsFalse(message.HasField(f("default_cord" )));
-
- // Fields with defaults have their default values (duh).
- Assert.AreEqual( 41 , message[f("default_int32" )]);
- Assert.AreEqual( 42L , message[f("default_int64" )]);
- Assert.AreEqual( 43U , message[f("default_uint32" )]);
- Assert.AreEqual( 44UL , message[f("default_uint64" )]);
- Assert.AreEqual(-45 , message[f("default_sint32" )]);
- Assert.AreEqual( 46L , message[f("default_sint64" )]);
- Assert.AreEqual( 47U , message[f("default_fixed32" )]);
- Assert.AreEqual( 48UL , message[f("default_fixed64" )]);
- Assert.AreEqual( 49 , message[f("default_sfixed32")]);
- Assert.AreEqual(-50L , message[f("default_sfixed64")]);
- Assert.AreEqual( 51.5F , message[f("default_float" )]);
- Assert.AreEqual( 52e3D , message[f("default_double" )]);
- Assert.AreEqual(true , message[f("default_bool" )]);
- Assert.AreEqual("hello", message[f("default_string" )]);
- Assert.AreEqual(TestUtil.ToBytes("world"), message[f("default_bytes")]);
-
- Assert.AreEqual( nestedBar, message[f("default_nested_enum" )]);
- Assert.AreEqual(foreignBar, message[f("default_foreign_enum")]);
- Assert.AreEqual( importBar, message[f("default_import_enum" )]);
-
- Assert.AreEqual("abc", message[f("default_string_piece")]);
- Assert.AreEqual("123", message[f("default_cord")]);
- }
-
- // ---------------------------------------------------------------
-
- internal void AssertRepeatedFieldsModifiedViaReflection(IMessage message) {
- // ModifyRepeatedFields only sets the second repeated element of each
- // field. In addition to verifying this, we also verify that the first
- // element and size were *not* modified.
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes" )));
-
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum" )));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum" )));
-
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece")));
- Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord")));
-
- Assert.AreEqual(201 , message[f("repeated_int32" ), 0]);
- Assert.AreEqual(202L , message[f("repeated_int64" ), 0]);
- Assert.AreEqual(203U , message[f("repeated_uint32" ), 0]);
- Assert.AreEqual(204UL, message[f("repeated_uint64" ), 0]);
- Assert.AreEqual(205 , message[f("repeated_sint32" ), 0]);
- Assert.AreEqual(206L , message[f("repeated_sint64" ), 0]);
- Assert.AreEqual(207U , message[f("repeated_fixed32" ), 0]);
- Assert.AreEqual(208UL, message[f("repeated_fixed64" ), 0]);
- Assert.AreEqual(209 , message[f("repeated_sfixed32"), 0]);
- Assert.AreEqual(210L , message[f("repeated_sfixed64"), 0]);
- Assert.AreEqual(211F , message[f("repeated_float" ), 0]);
- Assert.AreEqual(212D , message[f("repeated_double" ), 0]);
- Assert.AreEqual(true , message[f("repeated_bool" ), 0]);
- Assert.AreEqual("215", message[f("repeated_string" ), 0]);
- Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]);
-
- Assert.AreEqual(217,((IMessage)message[f("repeatedgroup"), 0])[repeatedGroupA]);
- Assert.AreEqual(218,((IMessage)message[f("repeated_nested_message"), 0])[nestedB]);
- Assert.AreEqual(219,((IMessage)message[f("repeated_foreign_message"), 0])[foreignC]);
- Assert.AreEqual(220,((IMessage)message[f("repeated_import_message"), 0])[importD]);
-
- Assert.AreEqual( nestedBar, message[f("repeated_nested_enum" ),0]);
- Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"),0]);
- Assert.AreEqual( importBar, message[f("repeated_import_enum" ),0]);
-
- Assert.AreEqual("224", message[f("repeated_string_piece"), 0]);
- Assert.AreEqual("225", message[f("repeated_cord"), 0]);
-
- Assert.AreEqual(501 , message[f("repeated_int32" ), 1]);
- Assert.AreEqual(502L , message[f("repeated_int64" ), 1]);
- Assert.AreEqual(503U , message[f("repeated_uint32" ), 1]);
- Assert.AreEqual(504UL, message[f("repeated_uint64" ), 1]);
- Assert.AreEqual(505 , message[f("repeated_sint32" ), 1]);
- Assert.AreEqual(506L , message[f("repeated_sint64" ), 1]);
- Assert.AreEqual(507U , message[f("repeated_fixed32" ), 1]);
- Assert.AreEqual(508UL, message[f("repeated_fixed64" ), 1]);
- Assert.AreEqual(509 , message[f("repeated_sfixed32"), 1]);
- Assert.AreEqual(510L , message[f("repeated_sfixed64"), 1]);
- Assert.AreEqual(511F , message[f("repeated_float" ), 1]);
- Assert.AreEqual(512D , message[f("repeated_double" ), 1]);
- Assert.AreEqual(true , message[f("repeated_bool" ), 1]);
- Assert.AreEqual("515", message[f("repeated_string" ), 1]);
- Assert.AreEqual(TestUtil.ToBytes("516"), message[f("repeated_bytes"), 1]);
-
- Assert.AreEqual(517,((IMessage)message[f("repeatedgroup"), 1])[repeatedGroupA]);
- Assert.AreEqual(518,((IMessage)message[f("repeated_nested_message"), 1])[nestedB]);
- Assert.AreEqual(519,((IMessage)message[f("repeated_foreign_message"), 1])[foreignC]);
- Assert.AreEqual(520,((IMessage)message[f("repeated_import_message"), 1])[importD]);
-
- Assert.AreEqual( nestedFoo, message[f("repeated_nested_enum" ),1]);
- Assert.AreEqual(foreignFoo, message[f("repeated_foreign_enum"),1]);
- Assert.AreEqual( importFoo, message[f("repeated_import_enum" ),1]);
-
- Assert.AreEqual("524", message[f("repeated_string_piece"), 1]);
- Assert.AreEqual("525", message[f("repeated_cord"), 1]);
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/ServiceTest.cs b/csharp/ProtocolBuffers.Test/ServiceTest.cs
deleted file mode 100644
index 34f83bda..00000000
--- a/csharp/ProtocolBuffers.Test/ServiceTest.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-using Rhino.Mocks;
-using Rhino.Mocks.Constraints;
-
-namespace Google.ProtocolBuffers {
-
- /// <summary>
- /// Tests for generated service classes.
- /// TODO(jonskeet): Convert the mocking tests using Rhino.Mocks.
- /// </summary>
- [TestFixture]
- public class ServiceTest {
-
- delegate void Action<T1, T2>(T1 t1, T2 t2);
-
- private static readonly MethodDescriptor FooDescriptor = TestService.Descriptor.Methods[0];
- private static readonly MethodDescriptor BarDescriptor = TestService.Descriptor.Methods[1];
-
- [Test]
- public void GetRequestPrototype() {
- TestService service = new TestServiceImpl();
-
- Assert.AreSame(service.GetRequestPrototype(FooDescriptor), FooRequest.DefaultInstance);
- Assert.AreSame(service.GetRequestPrototype(BarDescriptor), BarRequest.DefaultInstance);
- }
-
- [Test]
- public void GetResponsePrototype() {
- TestService service = new TestServiceImpl();
-
- Assert.AreSame(service.GetResponsePrototype(FooDescriptor), FooResponse.DefaultInstance);
- Assert.AreSame(service.GetResponsePrototype(BarDescriptor), BarResponse.DefaultInstance);
- }
-
- [Test]
- public void CallMethodFoo() {
- MockRepository mocks = new MockRepository();
- FooRequest fooRequest = FooRequest.CreateBuilder().Build();
- FooResponse fooResponse = FooResponse.CreateBuilder().Build();
- IRpcController controller = mocks.StrictMock<IRpcController>();
-
- bool fooCalled = false;
-
- TestService service = new TestServiceImpl((request, responseAction) => {
- Assert.AreSame(fooRequest, request);
- fooCalled = true;
- responseAction(fooResponse);
- }, null, controller);
-
- bool doneHandlerCalled = false;
- Action<IMessage> doneHandler = (response => {
- Assert.AreSame(fooResponse, response);
- doneHandlerCalled = true;
- });
-
- using (mocks.Record()) {
- // No mock interactions to record
- }
-
- service.CallMethod(FooDescriptor, controller, fooRequest, doneHandler);
-
- Assert.IsTrue(doneHandlerCalled);
- Assert.IsTrue(fooCalled);
- mocks.VerifyAll();
- }
-
- delegate void CallFooDelegate(MethodDescriptor descriptor, IRpcController controller,
- IMessage request, IMessage response, Action<IMessage> doneHandler);
-
- /// <summary>
- /// Tests the generated stub handling of Foo. By this stage we're reasonably confident
- /// that the choice between Foo and Bar is arbitrary, hence the lack of a corresponding Bar
- /// test.
- /// </summary>
- [Test]
- public void GeneratedStubFooCall() {
- FooRequest fooRequest = FooRequest.CreateBuilder().Build();
- MockRepository mocks = new MockRepository();
- IRpcChannel mockChannel = mocks.StrictMock<IRpcChannel>();
- IRpcController mockController = mocks.StrictMock<IRpcController>();
- TestService service = TestService.CreateStub(mockChannel);
- Action<FooResponse> doneHandler = mocks.StrictMock<Action<FooResponse>>();
-
- using (mocks.Record()) {
-
- // Nasty way of mocking out "the channel calls the done handler".
- Expect.Call(() => mockChannel.CallMethod(null, null, null, null, null))
- .IgnoreArguments()
- .Constraints(Is.Same(FooDescriptor), Is.Same(mockController), Is.Same(fooRequest),
- Is.Same(FooResponse.DefaultInstance), Is.Anything())
- .Do((CallFooDelegate) ((p1, p2, p3, response, done) => done(response)));
- doneHandler.Invoke(FooResponse.DefaultInstance);
- }
-
- service.Foo(mockController, fooRequest, doneHandler);
-
- mocks.VerifyAll();
- }
-
- [Test]
- public void CallMethodBar() {
- MockRepository mocks = new MockRepository();
- BarRequest barRequest = BarRequest.CreateBuilder().Build();
- BarResponse barResponse = BarResponse.CreateBuilder().Build();
- IRpcController controller = mocks.StrictMock<IRpcController>();
-
- bool barCalled = false;
-
- TestService service = new TestServiceImpl(null, (request, responseAction) => {
- Assert.AreSame(barRequest, request);
- barCalled = true;
- responseAction(barResponse);
- }, controller);
-
- bool doneHandlerCalled = false;
- Action<IMessage> doneHandler = (response => {
- Assert.AreSame(barResponse, response);
- doneHandlerCalled = true;
- });
-
- using (mocks.Record()) {
- // No mock interactions to record
- }
-
- service.CallMethod(BarDescriptor, controller, barRequest, doneHandler);
-
- Assert.IsTrue(doneHandlerCalled);
- Assert.IsTrue(barCalled);
- mocks.VerifyAll();
- }
-
-
- class TestServiceImpl : TestService {
- private readonly Action<FooRequest, Action<FooResponse>> fooHandler;
- private readonly Action<BarRequest, Action<BarResponse>> barHandler;
- private readonly IRpcController expectedController;
-
- internal TestServiceImpl() {
- }
-
- internal TestServiceImpl(Action<FooRequest, Action<FooResponse>> fooHandler,
- Action<BarRequest, Action<BarResponse>> barHandler,
- IRpcController expectedController) {
- this.fooHandler = fooHandler;
- this.barHandler = barHandler;
- this.expectedController = expectedController;
- }
-
- public override void Foo(IRpcController controller, FooRequest request, Action<FooResponse> done) {
- Assert.AreSame(expectedController, controller);
- fooHandler(request, done);
- }
-
- public override void Bar(IRpcController controller, BarRequest request, Action<BarResponse> done) {
- Assert.AreSame(expectedController, controller);
- barHandler(request, done);
- }
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/EnumWithNoOuter.cs b/csharp/ProtocolBuffers.Test/TestProtos/EnumWithNoOuter.cs
deleted file mode 100644
index 868279e6..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/EnumWithNoOuter.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public enum EnumWithNoOuter {
- FOO = 1,
- BAR = 2,
- }
-
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/MessageWithNoOuter.cs b/csharp/ProtocolBuffers.Test/TestProtos/MessageWithNoOuter.cs
deleted file mode 100644
index 64f09f86..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/MessageWithNoOuter.cs
+++ /dev/null
@@ -1,398 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public sealed partial class MessageWithNoOuter : pb::GeneratedMessage<MessageWithNoOuter, MessageWithNoOuter.Builder> {
- private static readonly MessageWithNoOuter defaultInstance = new Builder().BuildPartial();
- public static MessageWithNoOuter DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override MessageWithNoOuter DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override MessageWithNoOuter ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.MultiFileProto.internal__static_protobuf_unittest_MessageWithNoOuter__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<MessageWithNoOuter, MessageWithNoOuter.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.MultiFileProto.internal__static_protobuf_unittest_MessageWithNoOuter__FieldAccessorTable; }
- }
-
- #region Nested types
- public static class Types {
- public enum NestedEnum {
- BAZ = 3,
- }
-
- public sealed partial class NestedMessage : pb::GeneratedMessage<NestedMessage, NestedMessage.Builder> {
- private static readonly NestedMessage defaultInstance = new Builder().BuildPartial();
- public static NestedMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override NestedMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override NestedMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.MultiFileProto.internal__static_protobuf_unittest_MessageWithNoOuter_NestedMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<NestedMessage, NestedMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.MultiFileProto.internal__static_protobuf_unittest_MessageWithNoOuter_NestedMessage__FieldAccessorTable; }
- }
-
- // optional int32 i = 1;
- private bool hasI;
- private int i_ = 0;
- public bool HasI {
- get { return hasI; }
- }
- public int I {
- get { return i_; }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage result = new global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage();
-
- protected override global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
-
- // optional int32 i = 1;
- public bool HasI {
- get { return result.HasI; }
- }
- public int I {
- get { return result.I; }
- set { SetI(value); }
- }
- public Builder SetI(int value) {
- result.hasI = true;
- result.i_ = value;
- return this;
- }
- public Builder ClearI() {
- result.hasI = false;
- result.i_ = 0;
- return this;
- }
- }
- }
-
- }
- #endregion
-
- // optional .protobuf_unittest.MessageWithNoOuter.NestedMessage nested = 1;
- private bool hasNested;
- private global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage nested_ = global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.DefaultInstance;
- public bool HasNested {
- get { return hasNested; }
- }
- public global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage Nested {
- get { return nested_; }
- }
-
- // repeated .protobuf_unittest.TestAllTypes foreign = 2;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> foreign_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> ForeignList {
- get { return foreign_; }
- }
- public int ForeignCount
- { get { return foreign_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetForeign(int index) {
- return foreign_ [index];
- }
-
- // optional .protobuf_unittest.MessageWithNoOuter.NestedEnum nested_enum = 3;
- private bool hasNestedEnum;
- private global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedEnum nestedEnum_ = global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedEnum.BAZ;
- public bool HasNestedEnum {
- get { return hasNestedEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedEnum NestedEnum { get { return nestedEnum_; }}
-
- // optional .protobuf_unittest.EnumWithNoOuter foreign_enum = 4;
- private bool hasForeignEnum;
- private global::Google.ProtocolBuffers.TestProtos.EnumWithNoOuter foreignEnum_ = global::Google.ProtocolBuffers.TestProtos.EnumWithNoOuter.FOO;
- public bool HasForeignEnum {
- get { return hasForeignEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.EnumWithNoOuter ForeignEnum { get { return foreignEnum_; }}
-
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter result = new global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter();
-
- protected override global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter BuildPartial() {
- result.foreign_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter returnMe = result;
- result = null;
- return returnMe;
- }
-
-
- // optional .protobuf_unittest.MessageWithNoOuter.NestedMessage nested = 1;
- public bool HasNested {
- get { return result.HasNested; }
- }
- public global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage Nested {
- get { return result.Nested; }
- set { SetNested(value); }
- }
- public Builder SetNested(global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage value) {
- result.hasNested = true;
- result.nested_ = value;
- return this;
- }
- public Builder SetNested(global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.Builder builderForValue) {
- result.hasNested = true;
- result.nested_ = builderForValue.Build();
- return this;
- }
- public Builder MergeNested(global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage value) {
- if (result.HasNested &&
- result.nested_ != global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.DefaultInstance) {
- result.nested_ =
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.CreateBuilder(result.nested_).MergeFrom(value).BuildPartial();
- } else {
- result.nested_ = value;
- }
- result.hasNested = true;
- return this;
- }
- public Builder ClearNested() {
- result.hasNested = false;
- result.nested_ = global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.DefaultInstance;
- return this;
- }
-
- // repeated .protobuf_unittest.TestAllTypes foreign = 2;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> ForeignList {
- get { return result.foreign_; }
- }
- public int ForeignCount {
- get { return result.ForeignCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetForeign(int index) {
- return result.GetForeign(index);
- }
- public Builder SetForeign(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) {
- result.foreign_[index] = value;
- return this;
- }
- public Builder SetForeign(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) {
- result.foreign_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddForeign(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) {
- result.foreign_.Add(value);
- return this;
- }
- public Builder AddForeign(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) {
- result.foreign_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeForeign(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> values) {
- base.AddRange(values, result.foreign_);
- return this;
- }
- public Builder ClearForeign() {
- result.foreign_.Clear();
- return this;
- }
-
- // optional .protobuf_unittest.MessageWithNoOuter.NestedEnum nested_enum = 3;
- public bool HasNestedEnum {
- get { return result.HasNestedEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedEnum NestedEnum {
- get { return result.NestedEnum; }
- set { SetNestedEnum(value); }
- }
- public Builder SetNestedEnum(global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedEnum value) {
- result.hasNestedEnum = true;
- result.nestedEnum_ = value;
- return this;
- }
- public Builder ClearNestedEnum() {
- result.hasNestedEnum = false;
- result.nestedEnum_ = global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedEnum.BAZ;
- return this;
- }
-
- // optional .protobuf_unittest.EnumWithNoOuter foreign_enum = 4;
- public bool HasForeignEnum {
- get { return result.HasForeignEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.EnumWithNoOuter ForeignEnum {
- get { return result.ForeignEnum; }
- set { SetForeignEnum(value); }
- }
- public Builder SetForeignEnum(global::Google.ProtocolBuffers.TestProtos.EnumWithNoOuter value) {
- result.hasForeignEnum = true;
- result.foreignEnum_ = value;
- return this;
- }
- public Builder ClearForeignEnum() {
- result.hasForeignEnum = false;
- result.foreignEnum_ = global::Google.ProtocolBuffers.TestProtos.EnumWithNoOuter.FOO;
- return this;
- }
- }
- }
-
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/MultiFileProto.cs b/csharp/ProtocolBuffers.Test/TestProtos/MultiFileProto.cs
deleted file mode 100644
index 33b719b4..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/MultiFileProto.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public static partial class MultiFileProto {
-
- #region Descriptor
- public static pbd::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
- new byte[] {
- 0x0a, 0x3b, 0x73, 0x72, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x2f,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6d, 0x75, 0x6c, 0x74,
- 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x02, 0x0a, 0x12, 0x4d, 0x65, 0x73,
- 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x06, 0x6e,
- 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57,
- 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73,
- 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6e, 0x65,
- 0x73, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65,
- 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x38, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x65, 0x6e, 0x75,
- 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75,
- 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75,
- 0x74, 0x65, 0x72, 0x1a, 0x1a, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x22, 0x15, 0x0a, 0x0a, 0x4e, 0x65, 0x73, 0x74, 0x65,
- 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41, 0x5a, 0x10, 0x03, 0x2a, 0x23, 0x0a, 0x0f, 0x45, 0x6e,
- 0x75, 0x6d, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x4f, 0x4f,
- 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41, 0x52, 0x10, 0x02, 0x32, 0x63, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x76, 0x69,
- 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x03, 0x46, 0x6f, 0x6f,
- 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x1a,
- 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x44, 0x0a, 0x14, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73,
- 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x87, 0xad, 0x4b, 0x20, 0x01,
- 0x28, 0x05, 0x42, 0x58, 0x42, 0x16, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x54,
- 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x0e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0xd0, 0x3e, 0x01, 0xd8, 0x3e, 0x00, 0xe0, 0x3e, 0x01,
- }, new pbd::FileDescriptor[] {
- global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor,
- });
- #endregion
-
- #region Extensions
- public static readonly pb::GeneratedExtensionBase<int> ExtensionWithOuter =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[0]);
- #endregion
-
- #region Static variables
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_MessageWithNoOuter__Descriptor
- = Descriptor.MessageTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter, global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Builder> internal__static_protobuf_unittest_MessageWithNoOuter__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter, global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Builder>(internal__static_protobuf_unittest_MessageWithNoOuter__Descriptor,
- new string[] { "Nested", "Foreign", "NestedEnum", "ForeignEnum", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_MessageWithNoOuter_NestedMessage__Descriptor
- = internal__static_protobuf_unittest_MessageWithNoOuter__Descriptor.NestedTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.Builder> internal__static_protobuf_unittest_MessageWithNoOuter_NestedMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.Types.NestedMessage.Builder>(internal__static_protobuf_unittest_MessageWithNoOuter_NestedMessage__Descriptor,
- new string[] { "I", });
- #endregion
-
- }
-
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/ServiceWithNoOuter.cs b/csharp/ProtocolBuffers.Test/TestProtos/ServiceWithNoOuter.cs
deleted file mode 100644
index 887ac10e..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/ServiceWithNoOuter.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public abstract class ServiceWithNoOuter : pb::IService {
- public abstract void Foo(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> done);
-
- public static pbd::ServiceDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.MultiFileProto.Descriptor.Services[0]; }
- }
- public pbd::ServiceDescriptor DescriptorForType {
- get { return Descriptor; }
- }
-
- public void CallMethod(
- pbd::MethodDescriptor method,
- pb::IRpcController controller,
- pb::IMessage request,
- global::System.Action<pb::IMessage> done) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.CallMethod() given method descriptor for wrong " +
- "service type.");
- }
- switch(method.Index) {
- case 0:
- this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter)request,
- pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.TestAllTypes>(
- done));
- return;
- default:
- throw new global::System.InvalidOperationException("Can't get here.");
- }
- }
-
- public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.GetRequestPrototype() given method " +
- "descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- return global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.DefaultInstance;
- default:
- throw new global::System.ArgumentException("Can't get here.");
- }
- }
-
- public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.GetResponsePrototype() given method " +
- "descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance;
- default:
- throw new global::System.ArgumentException("Can't get here.");
- }
- }
-
- public static Stub CreateStub(
- pb::IRpcChannel channel) {
- return new Stub(channel);
- }
-
- public class Stub : global::Google.ProtocolBuffers.TestProtos.ServiceWithNoOuter {
- internal Stub(pb::IRpcChannel channel) {
- this.channel = channel;
- }
-
- private readonly pb::IRpcChannel channel;
-
- public pb::IRpcChannel Channel {
- get { return channel; }
- }
-
- public override void Foo(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> done) {
- channel.CallMethod(
- Descriptor.Methods[0],
- controller,
- request,
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance,
- pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder>(done, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance));
- }
- }
- }
-
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
deleted file mode 100644
index 8f4f3076..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+++ /dev/null
@@ -1,358 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public static partial class UnitTestEmbedOptimizeForProtoFile {
-
- #region Descriptor
- public static pbd::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
- new byte[] {
- 0x0a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,
- 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74,
- 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, 0x19,
- 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f,
- 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65,
- 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69,
- 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65,
- 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42,
- 0x4a, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
- 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca,
- 0x3e, 0x21, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d,
- 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
- }, new pbd::FileDescriptor[] {
- global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor,
- });
- #endregion
-
- #region Extensions
- #endregion
-
- #region Static variables
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor
- = Descriptor.MessageTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder> internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor,
- new string[] { "OptionalMessage", "RepeatedMessage", });
- #endregion
-
- }
-
- #region Enums
- #endregion
-
- #region Messages
- public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> {
- private static readonly TestEmbedOptimizedForSize defaultInstance = new Builder().BuildPartial();
- public static TestEmbedOptimizedForSize DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestEmbedOptimizedForSize DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestEmbedOptimizedForSize ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
- private bool hasOptionalMessage;
- private global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance;
- public bool HasOptionalMessage {
- get { return hasOptionalMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage {
- get { return optionalMessage_; }
- }
-
- // repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> repeatedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList {
- get { return repeatedMessage_; }
- }
- public int RepeatedMessageCount
- { get { return repeatedMessage_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) {
- return repeatedMessage_ [index];
- }
-
- public override bool IsInitialized {
- get {
- if (HasOptionalMessage) {
- if (!OptionalMessage.IsInitialized) return false;
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
- if (!element.IsInitialized) return false;
- }
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasOptionalMessage) {
- output.WriteMessage(1, OptionalMessage);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
- output.WriteMessage(2, element);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasOptionalMessage) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
- size += pb::CodedOutputStream.ComputeMessageSize(2, element);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize BuildPartial() {
- result.repeatedMessage_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance) return this;
- if (other.HasOptionalMessage) {
- MergeOptionalMessage(other.OptionalMessage);
- }
- if (other.repeatedMessage_.Count != 0) {
- base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder();
- if (HasOptionalMessage) {
- subBuilder.MergeFrom(OptionalMessage);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- OptionalMessage = subBuilder.BuildPartial();
- break;
- }
- case 18: {
- global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddRepeatedMessage(subBuilder.BuildPartial());
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
- public bool HasOptionalMessage {
- get { return result.HasOptionalMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage {
- get { return result.OptionalMessage; }
- set { SetOptionalMessage(value); }
- }
- public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
- result.hasOptionalMessage = true;
- result.optionalMessage_ = value;
- return this;
- }
- public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) {
- result.hasOptionalMessage = true;
- result.optionalMessage_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
- if (result.HasOptionalMessage &&
- result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance) {
- result.optionalMessage_ =
- global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalMessage_ = value;
- }
- result.hasOptionalMessage = true;
- return this;
- }
- public Builder ClearOptionalMessage() {
- result.hasOptionalMessage = false;
- result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance;
- return this;
- }
-
- // repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList {
- get { return result.repeatedMessage_; }
- }
- public int RepeatedMessageCount {
- get { return result.RepeatedMessageCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) {
- return result.GetRepeatedMessage(index);
- }
- public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
- result.repeatedMessage_[index] = value;
- return this;
- }
- public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) {
- result.repeatedMessage_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
- result.repeatedMessage_.Add(value);
- return this;
- }
- public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) {
- result.repeatedMessage_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> values) {
- base.AddRange(values, result.repeatedMessage_);
- return this;
- }
- public Builder ClearRepeatedMessage() {
- result.repeatedMessage_.Clear();
- return this;
- }
- }
- }
-
- #endregion
-
- #region Services
- #endregion
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
deleted file mode 100644
index f4314b30..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public static partial class UnitTestImportProtoFile {
-
- #region Descriptor
- public static pbd::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(
- global::System.Convert.FromBase64String(
- "ChV1bml0dGVzdF9pbXBvcnQucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2lt" +
- "cG9ydBokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnByb3RvGiBn" +
- "b29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90byIaCg1JbXBvcnRNZXNz" +
- "YWdlEgkKAWQYASABKAUqPAoKSW1wb3J0RW51bRIOCgpJTVBPUlRfRk9PEAcS" +
- "DgoKSU1QT1JUX0JBUhAIEg4KCklNUE9SVF9CQVoQCUJcChhjb20uZ29vZ2xl" +
- "LnByb3RvYnVmLnRlc3RIAYLiCSFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRl" +
- "c3RQcm90b3OK4gkXVW5pdFRlc3RJbXBvcnRQcm90b0ZpbGU="),
- new pbd::FileDescriptor[] {
- global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
- global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor,
- });
- #endregion
-
- #region Static variables
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor
- = Descriptor.MessageTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder> internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder>(internal__static_protobuf_unittest_import_ImportMessage__Descriptor,
- new string[] { "D", });
- #endregion
- }
- #region Enums
- public enum ImportEnum {
- IMPORT_FOO = 7,
- IMPORT_BAR = 8,
- IMPORT_BAZ = 9,
- }
-
- #endregion
-
- #region Messages
- public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> {
- private static readonly ImportMessage defaultInstance = new Builder().BuildPartial();
- public static ImportMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override ImportMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override ImportMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<ImportMessage, ImportMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; }
- }
-
- private bool hasD;
- private int d_ = 0;
- public bool HasD {
- get { return hasD; }
- }
- public int D {
- get { return d_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasD) {
- output.WriteInt32(1, D);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasD) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, D);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static ImportMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static ImportMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static ImportMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static ImportMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static ImportMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(ImportMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<ImportMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
- public Builder() {}
-
- ImportMessage result = new ImportMessage();
-
- protected override ImportMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new ImportMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return ImportMessage.Descriptor; }
- }
-
- public override ImportMessage DefaultInstanceForType {
- get { return ImportMessage.DefaultInstance; }
- }
-
- public override ImportMessage BuildPartial() {
- ImportMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is ImportMessage) {
- return MergeFrom((ImportMessage) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(ImportMessage other) {
- if (other == ImportMessage.DefaultInstance) return this;
- if (other.HasD) {
- D = other.D;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0: {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- default: {
- if (!ParseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- D = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- public bool HasD {
- get { return result.HasD; }
- }
- public int D {
- get { return result.D; }
- set { SetD(value); }
- }
- public Builder SetD(int value) {
- result.hasD = true;
- result.d_ = value;
- return this;
- }
- public Builder ClearD() {
- result.hasD = false;
- result.d_ = 0;
- return this;
- }
- }
- }
-
- #endregion
-
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
deleted file mode 100644
index e03eac92..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+++ /dev/null
@@ -1,1416 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public static partial class UnitTestMessageSetProtoFile {
-
- #region Descriptor
- public static pbd::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
- new byte[] {
- 0x0a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x22, 0x1e, 0x0a, 0x0e,
- 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x2a, 0x08, 0x08, 0x04, 0x10, 0x80,
- 0x80, 0x80, 0x80, 0x02, 0x3a, 0x02, 0x08, 0x01, 0x22, 0x51, 0x0a, 0x17, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x0b, 0x6d,
- 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73,
- 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x22, 0x96, 0x01, 0x0a, 0x18, 0x54, 0x65, 0x73, 0x74,
- 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x31,
- 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x32, 0x6f, 0x0a, 0x15, 0x6d, 0x65, 0x73, 0x73, 0x61,
- 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73,
- 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x18, 0xb0, 0xa6, 0x5e, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x31, 0x22, 0x98, 0x01, 0x0a, 0x18, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x12, 0x0b, 0x0a, 0x03, 0x73, 0x74, 0x72,
- 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x32, 0x6f, 0x0a, 0x15, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65,
- 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x18, 0xf9, 0xbb, 0x5e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d,
- 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x22,
- 0x6e, 0x0a, 0x0d, 0x52, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x12, 0x33, 0x0a, 0x04,
- 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0a, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x53, 0x65, 0x74, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x1a, 0x28, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0f, 0x0a,
- 0x07, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x6d, 0x65,
- 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x02, 0x28, 0x0c, 0x42, 0x44, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x1b, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65,
- 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c,
- 0x65,
- }, new pbd::FileDescriptor[] {
- });
- #endregion
-
- #region Extensions
- #endregion
-
- #region Static variables
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSet__Descriptor
- = Descriptor.MessageTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSet, global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder> internal__static_protobuf_unittest_TestMessageSet__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSet, global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder>(internal__static_protobuf_unittest_TestMessageSet__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor
- = Descriptor.MessageTypes[1];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer, global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.Builder> internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer, global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.Builder>(internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor,
- new string[] { "MessageSet", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor
- = Descriptor.MessageTypes[2];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1, global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.Builder> internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1, global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.Builder>(internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor,
- new string[] { "I", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor
- = Descriptor.MessageTypes[3];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2, global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.Builder> internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2, global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.Builder>(internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor,
- new string[] { "Str", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_RawMessageSet__Descriptor
- = Descriptor.MessageTypes[4];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.RawMessageSet, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Builder> internal__static_protobuf_unittest_RawMessageSet__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.RawMessageSet, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Builder>(internal__static_protobuf_unittest_RawMessageSet__Descriptor,
- new string[] { "Item", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor
- = internal__static_protobuf_unittest_RawMessageSet__Descriptor.NestedTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder> internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder>(internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor,
- new string[] { "TypeId", "Message", });
- #endregion
-
- }
-
- #region Enums
- #endregion
-
- #region Messages
- public sealed partial class TestMessageSet : pb::ExtendableMessage<TestMessageSet, TestMessageSet.Builder> {
- private static readonly TestMessageSet defaultInstance = new Builder().BuildPartial();
- public static TestMessageSet DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestMessageSet DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestMessageSet ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSet__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestMessageSet, TestMessageSet.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSet__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- if (!ExtensionsAreInitialized) return false;
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- pb::ExtendableMessage<TestMessageSet, TestMessageSet.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
- extensionWriter.WriteUntil(536870912, output);
- UnknownFields.WriteAsMessageSetTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += ExtensionsSerializedSize;
- size += UnknownFields.SerializedSizeAsMessageSet;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSet ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestMessageSet prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::ExtendableBuilder<global::Google.ProtocolBuffers.TestProtos.TestMessageSet, global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestMessageSet.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestMessageSet result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSet();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestMessageSet MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSet();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSet DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSet BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestMessageSet returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestMessageSet) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestMessageSet) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestMessageSet other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class TestMessageSetContainer : pb::GeneratedMessage<TestMessageSetContainer, TestMessageSetContainer.Builder> {
- private static readonly TestMessageSetContainer defaultInstance = new Builder().BuildPartial();
- public static TestMessageSetContainer DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestMessageSetContainer DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestMessageSetContainer ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestMessageSetContainer, TestMessageSetContainer.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestMessageSet message_set = 1;
- private bool hasMessageSet;
- private global::Google.ProtocolBuffers.TestProtos.TestMessageSet messageSet_ = global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance;
- public bool HasMessageSet {
- get { return hasMessageSet; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestMessageSet MessageSet {
- get { return messageSet_; }
- }
-
- public override bool IsInitialized {
- get {
- if (HasMessageSet) {
- if (!MessageSet.IsInitialized) return false;
- }
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasMessageSet) {
- output.WriteMessage(1, MessageSet);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasMessageSet) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, MessageSet);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.DefaultInstance) return this;
- if (other.HasMessageSet) {
- MergeMessageSet(other.MessageSet);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMessageSet.CreateBuilder();
- if (HasMessageSet) {
- subBuilder.MergeFrom(MessageSet);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- MessageSet = subBuilder.BuildPartial();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestMessageSet message_set = 1;
- public bool HasMessageSet {
- get { return result.HasMessageSet; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestMessageSet MessageSet {
- get { return result.MessageSet; }
- set { SetMessageSet(value); }
- }
- public Builder SetMessageSet(global::Google.ProtocolBuffers.TestProtos.TestMessageSet value) {
- result.hasMessageSet = true;
- result.messageSet_ = value;
- return this;
- }
- public Builder SetMessageSet(global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder builderForValue) {
- result.hasMessageSet = true;
- result.messageSet_ = builderForValue.Build();
- return this;
- }
- public Builder MergeMessageSet(global::Google.ProtocolBuffers.TestProtos.TestMessageSet value) {
- if (result.HasMessageSet &&
- result.messageSet_ != global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance) {
- result.messageSet_ =
- global::Google.ProtocolBuffers.TestProtos.TestMessageSet.CreateBuilder(result.messageSet_).MergeFrom(value).BuildPartial();
- } else {
- result.messageSet_ = value;
- }
- result.hasMessageSet = true;
- return this;
- }
- public Builder ClearMessageSet() {
- result.hasMessageSet = false;
- result.messageSet_ = global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance;
- return this;
- }
- }
- }
-
- public sealed partial class TestMessageSetExtension1 : pb::GeneratedMessage<TestMessageSetExtension1, TestMessageSetExtension1.Builder> {
- private static readonly TestMessageSetExtension1 defaultInstance = new Builder().BuildPartial();
- public static TestMessageSetExtension1 DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestMessageSetExtension1 DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestMessageSetExtension1 ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestMessageSetExtension1, TestMessageSetExtension1.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable; }
- }
-
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1> MessageSetExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1>.CreateInstance(Descriptor.Extensions[0]);
- #region Nested types
- public static class Types {
- }
- #endregion
-
- // optional int32 i = 15;
- private bool hasI;
- private int i_ = 0;
- public bool HasI {
- get { return hasI; }
- }
- public int I {
- get { return i_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasI) {
- output.WriteInt32(15, I);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasI) {
- size += pb::CodedOutputStream.ComputeInt32Size(15, I);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1 other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.DefaultInstance) return this;
- if (other.HasI) {
- I = other.I;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 120: {
- I = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 i = 15;
- public bool HasI {
- get { return result.HasI; }
- }
- public int I {
- get { return result.I; }
- set { SetI(value); }
- }
- public Builder SetI(int value) {
- result.hasI = true;
- result.i_ = value;
- return this;
- }
- public Builder ClearI() {
- result.hasI = false;
- result.i_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestMessageSetExtension2 : pb::GeneratedMessage<TestMessageSetExtension2, TestMessageSetExtension2.Builder> {
- private static readonly TestMessageSetExtension2 defaultInstance = new Builder().BuildPartial();
- public static TestMessageSetExtension2 DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestMessageSetExtension2 DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestMessageSetExtension2 ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestMessageSetExtension2, TestMessageSetExtension2.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable; }
- }
-
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2> MessageSetExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2>.CreateInstance(Descriptor.Extensions[0]);
- #region Nested types
- public static class Types {
- }
- #endregion
-
- // optional string str = 25;
- private bool hasStr;
- private string str_ = "";
- public bool HasStr {
- get { return hasStr; }
- }
- public string Str {
- get { return str_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasStr) {
- output.WriteString(25, Str);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasStr) {
- size += pb::CodedOutputStream.ComputeStringSize(25, Str);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2 other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.DefaultInstance) return this;
- if (other.HasStr) {
- Str = other.Str;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 202: {
- Str = input.ReadString();
- break;
- }
- }
- }
- }
-
-
- // optional string str = 25;
- public bool HasStr {
- get { return result.HasStr; }
- }
- public string Str {
- get { return result.Str; }
- set { SetStr(value); }
- }
- public Builder SetStr(string value) {
- result.hasStr = true;
- result.str_ = value;
- return this;
- }
- public Builder ClearStr() {
- result.hasStr = false;
- result.str_ = "";
- return this;
- }
- }
- }
-
- public sealed partial class RawMessageSet : pb::GeneratedMessage<RawMessageSet, RawMessageSet.Builder> {
- private static readonly RawMessageSet defaultInstance = new Builder().BuildPartial();
- public static RawMessageSet DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override RawMessageSet DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override RawMessageSet ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<RawMessageSet, RawMessageSet.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet__FieldAccessorTable; }
- }
-
- #region Nested types
- public static class Types {
- public sealed partial class Item : pb::GeneratedMessage<Item, Item.Builder> {
- private static readonly Item defaultInstance = new Builder().BuildPartial();
- public static Item DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override Item DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override Item ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<Item, Item.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable; }
- }
-
- // required int32 type_id = 2;
- private bool hasTypeId;
- private int typeId_ = 0;
- public bool HasTypeId {
- get { return hasTypeId; }
- }
- public int TypeId {
- get { return typeId_; }
- }
-
- // required bytes message = 3;
- private bool hasMessage;
- private pb::ByteString message_ = pb::ByteString.Empty;
- public bool HasMessage {
- get { return hasMessage; }
- }
- public pb::ByteString Message {
- get { return message_; }
- }
-
- public override bool IsInitialized {
- get {
- if (!hasTypeId) return false;
- if (!hasMessage) return false;
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasTypeId) {
- output.WriteInt32(2, TypeId);
- }
- if (HasMessage) {
- output.WriteBytes(3, Message);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasTypeId) {
- size += pb::CodedOutputStream.ComputeInt32Size(2, TypeId);
- }
- if (HasMessage) {
- size += pb::CodedOutputStream.ComputeBytesSize(3, Message);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item result = new global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item();
-
- protected override global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.DefaultInstance) return this;
- if (other.HasTypeId) {
- TypeId = other.TypeId;
- }
- if (other.HasMessage) {
- Message = other.Message;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 16: {
- TypeId = input.ReadInt32();
- break;
- }
- case 26: {
- Message = input.ReadBytes();
- break;
- }
- }
- }
- }
-
-
- // required int32 type_id = 2;
- public bool HasTypeId {
- get { return result.HasTypeId; }
- }
- public int TypeId {
- get { return result.TypeId; }
- set { SetTypeId(value); }
- }
- public Builder SetTypeId(int value) {
- result.hasTypeId = true;
- result.typeId_ = value;
- return this;
- }
- public Builder ClearTypeId() {
- result.hasTypeId = false;
- result.typeId_ = 0;
- return this;
- }
-
- // required bytes message = 3;
- public bool HasMessage {
- get { return result.HasMessage; }
- }
- public pb::ByteString Message {
- get { return result.Message; }
- set { SetMessage(value); }
- }
- public Builder SetMessage(pb::ByteString value) {
- result.hasMessage = true;
- result.message_ = value;
- return this;
- }
- public Builder ClearMessage() {
- result.hasMessage = false;
- result.message_ = pb::ByteString.Empty;
- return this;
- }
- }
- }
-
- }
- #endregion
-
- // repeated group Item = 1 {
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item> item_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item> ItemList {
- get { return item_; }
- }
- public int ItemCount
- { get { return item_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item GetItem(int index) {
- return item_ [index];
- }
-
- public override bool IsInitialized {
- get {
- foreach (global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item element in ItemList) {
- if (!element.IsInitialized) return false;
- }
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- foreach (global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item element in ItemList) {
- output.WriteGroup(1, element);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- foreach (global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item element in ItemList) {
- size += pb::CodedOutputStream.ComputeGroupSize(1, element);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RawMessageSet ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.RawMessageSet prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.RawMessageSet, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.RawMessageSet.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.RawMessageSet result = new global::Google.ProtocolBuffers.TestProtos.RawMessageSet();
-
- protected override global::Google.ProtocolBuffers.TestProtos.RawMessageSet MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.RawMessageSet();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.RawMessageSet DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.RawMessageSet BuildPartial() {
- result.item_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.RawMessageSet returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.RawMessageSet) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.RawMessageSet) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.RawMessageSet other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.RawMessageSet.DefaultInstance) return this;
- if (other.item_.Count != 0) {
- base.AddRange(other.item_, result.item_);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 11: {
- global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.CreateBuilder();
- input.ReadGroup(1, subBuilder, extensionRegistry);
- AddItem(subBuilder.BuildPartial());
- break;
- }
- }
- }
- }
-
-
- // repeated group Item = 1 {
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item> ItemList {
- get { return result.item_; }
- }
- public int ItemCount {
- get { return result.ItemCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item GetItem(int index) {
- return result.GetItem(index);
- }
- public Builder SetItem(int index, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item value) {
- result.item_[index] = value;
- return this;
- }
- public Builder SetItem(int index, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder builderForValue) {
- result.item_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddItem(global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item value) {
- result.item_.Add(value);
- return this;
- }
- public Builder AddItem(global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder builderForValue) {
- result.item_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeItem(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item> values) {
- base.AddRange(values, result.item_);
- return this;
- }
- public Builder ClearItem() {
- result.item_.Clear();
- return this;
- }
- }
- }
-
- #endregion
-
- #region Services
- #endregion
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs
deleted file mode 100644
index 260be712..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs
+++ /dev/null
@@ -1,538 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public static partial class UnitTestOptimizeForProtoFile {
-
- #region Descriptor
- public static pbd::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
- new byte[] {
- 0x0a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
- 0x74, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a,
- 0x14, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a,
- 0x65, 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x2e, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
- 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x32, 0x40, 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69,
- 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0xd2, 0x09, 0x20, 0x01, 0x28, 0x05, 0x22, 0x29, 0x0a,
- 0x1c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,
- 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x09, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05,
- 0x22, 0x5a, 0x0a, 0x1c, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69,
- 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3a, 0x0a, 0x01, 0x6f, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74,
- 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69,
- 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x45, 0x48, 0x02, 0xc2, 0x3e, 0x21, 0x47,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72,
- 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x1c, 0x55, 0x6e, 0x69, 0x74, 0x54,
- 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46,
- 0x69, 0x6c, 0x65,
- }, new pbd::FileDescriptor[] {
- global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor,
- });
- #endregion
-
- #region Extensions
- #endregion
-
- #region Static variables
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor
- = Descriptor.MessageTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder> internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor,
- new string[] { "I", "Msg", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor
- = Descriptor.MessageTypes[1];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder> internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor,
- new string[] { "X", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor
- = Descriptor.MessageTypes[2];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Builder> internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor,
- new string[] { "O", });
- #endregion
-
- }
-
- #region Enums
- #endregion
-
- #region Messages
- public sealed partial class TestOptimizedForSize : pb::ExtendableMessage<TestOptimizedForSize, TestOptimizedForSize.Builder> {
- private static readonly TestOptimizedForSize defaultInstance = new Builder().BuildPartial();
- public static TestOptimizedForSize DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestOptimizedForSize DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestOptimizedForSize ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestOptimizedForSize, TestOptimizedForSize.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; }
- }
-
- public static readonly pb::GeneratedExtensionBase<int> TestExtension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[0]);
- #region Nested types
- public static class Types {
- }
- #endregion
-
- // optional int32 i = 1;
- private bool hasI;
- private int i_ = 0;
- public bool HasI {
- get { return hasI; }
- }
- public int I {
- get { return i_; }
- }
-
- // optional .protobuf_unittest.ForeignMessage msg = 19;
- private bool hasMsg;
- private global::Google.ProtocolBuffers.TestProtos.ForeignMessage msg_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
- public bool HasMsg {
- get { return hasMsg; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage Msg {
- get { return msg_; }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::ExtendableBuilder<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize returnMe = result;
- result = null;
- return returnMe;
- }
-
-
- // optional int32 i = 1;
- public bool HasI {
- get { return result.HasI; }
- }
- public int I {
- get { return result.I; }
- set { SetI(value); }
- }
- public Builder SetI(int value) {
- result.hasI = true;
- result.i_ = value;
- return this;
- }
- public Builder ClearI() {
- result.hasI = false;
- result.i_ = 0;
- return this;
- }
-
- // optional .protobuf_unittest.ForeignMessage msg = 19;
- public bool HasMsg {
- get { return result.HasMsg; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage Msg {
- get { return result.Msg; }
- set { SetMsg(value); }
- }
- public Builder SetMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.hasMsg = true;
- result.msg_ = value;
- return this;
- }
- public Builder SetMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.hasMsg = true;
- result.msg_ = builderForValue.Build();
- return this;
- }
- public Builder MergeMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- if (result.HasMsg &&
- result.msg_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) {
- result.msg_ =
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.msg_).MergeFrom(value).BuildPartial();
- } else {
- result.msg_ = value;
- }
- result.hasMsg = true;
- return this;
- }
- public Builder ClearMsg() {
- result.hasMsg = false;
- result.msg_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
- return this;
- }
- }
- }
-
- public sealed partial class TestRequiredOptimizedForSize : pb::GeneratedMessage<TestRequiredOptimizedForSize, TestRequiredOptimizedForSize.Builder> {
- private static readonly TestRequiredOptimizedForSize defaultInstance = new Builder().BuildPartial();
- public static TestRequiredOptimizedForSize DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestRequiredOptimizedForSize DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestRequiredOptimizedForSize ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestRequiredOptimizedForSize, TestRequiredOptimizedForSize.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable; }
- }
-
- // required int32 x = 1;
- private bool hasX;
- private int x_ = 0;
- public bool HasX {
- get { return hasX; }
- }
- public int X {
- get { return x_; }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize returnMe = result;
- result = null;
- return returnMe;
- }
-
-
- // required int32 x = 1;
- public bool HasX {
- get { return result.HasX; }
- }
- public int X {
- get { return result.X; }
- set { SetX(value); }
- }
- public Builder SetX(int value) {
- result.hasX = true;
- result.x_ = value;
- return this;
- }
- public Builder ClearX() {
- result.hasX = false;
- result.x_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestOptionalOptimizedForSize : pb::GeneratedMessage<TestOptionalOptimizedForSize, TestOptionalOptimizedForSize.Builder> {
- private static readonly TestOptionalOptimizedForSize defaultInstance = new Builder().BuildPartial();
- public static TestOptionalOptimizedForSize DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestOptionalOptimizedForSize DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestOptionalOptimizedForSize ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestOptionalOptimizedForSize, TestOptionalOptimizedForSize.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestRequiredOptimizedForSize o = 1;
- private bool hasO;
- private global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize o_ = global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance;
- public bool HasO {
- get { return hasO; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize O {
- get { return o_; }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize returnMe = result;
- result = null;
- return returnMe;
- }
-
-
- // optional .protobuf_unittest.TestRequiredOptimizedForSize o = 1;
- public bool HasO {
- get { return result.HasO; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize O {
- get { return result.O; }
- set { SetO(value); }
- }
- public Builder SetO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize value) {
- result.hasO = true;
- result.o_ = value;
- return this;
- }
- public Builder SetO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder builderForValue) {
- result.hasO = true;
- result.o_ = builderForValue.Build();
- return this;
- }
- public Builder MergeO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize value) {
- if (result.HasO &&
- result.o_ != global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance) {
- result.o_ =
- global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.CreateBuilder(result.o_).MergeFrom(value).BuildPartial();
- } else {
- result.o_ = value;
- }
- result.hasO = true;
- return this;
- }
- public Builder ClearO() {
- result.hasO = false;
- result.o_ = global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance;
- return this;
- }
- }
- }
-
- #endregion
-
- #region Services
- #endregion
-}
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
deleted file mode 100644
index a971832b..00000000
--- a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+++ /dev/null
@@ -1,12930 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-using pb = global::Google.ProtocolBuffers;
-using pbc = global::Google.ProtocolBuffers.Collections;
-using pbd = global::Google.ProtocolBuffers.Descriptors;
-using scg = global::System.Collections.Generic;
-namespace Google.ProtocolBuffers.TestProtos {
-
- public static partial class UnitTestProtoFile {
-
- #region Descriptor
- public static pbd::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
- new byte[] {
- 0x0a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d,
- 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x15, 0x0a, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f,
- 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x16, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f,
- 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x12, 0x17, 0x0a, 0x0f, 0x6f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d,
- 0x12, 0x17, 0x0a, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x04, 0x12, 0x17, 0x0a, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x69,
- 0x6e, 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x11, 0x12, 0x17, 0x0a, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, 0x28, 0x12, 0x12, 0x18, 0x0a, 0x10, 0x6f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28,
- 0x07, 0x12, 0x18, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36,
- 0x34, 0x18, 0x08, 0x20, 0x01, 0x28, 0x06, 0x12, 0x19, 0x0a, 0x11, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f,
- 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x12, 0x19, 0x0a, 0x11, 0x6f, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x01, 0x28,
- 0x10, 0x12, 0x16, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18,
- 0x0b, 0x20, 0x01, 0x28, 0x02, 0x12, 0x17, 0x0a, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f,
- 0x75, 0x62, 0x6c, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x12, 0x15, 0x0a, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x12, 0x17, 0x0a, 0x0f, 0x6f, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x12, 0x16,
- 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01,
- 0x28, 0x0c, 0x12, 0x44, 0x0a, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18,
- 0x10, 0x20, 0x01, 0x28, 0x0a, 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x4e, 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
- 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e,
- 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x18, 0x6f, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x12, 0x48, 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74,
- 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72,
- 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x14, 0x6f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18,
- 0x15, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e,
- 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x3d, 0x0a, 0x15, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
- 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x42, 0x0a, 0x14, 0x6f, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x17, 0x20, 0x01,
- 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65,
- 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d,
- 0x12, 0x21, 0x0a, 0x15, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f,
- 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x08, 0x02, 0x12, 0x19, 0x0a, 0x0d, 0x6f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02,
- 0x08, 0x01, 0x12, 0x16, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32,
- 0x18, 0x1f, 0x20, 0x03, 0x28, 0x05, 0x12, 0x16, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69,
- 0x6e, 0x74, 0x36, 0x34, 0x18, 0x20, 0x20, 0x03, 0x28, 0x03, 0x12, 0x17, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x21, 0x20, 0x03, 0x28, 0x0d, 0x12, 0x17, 0x0a, 0x0f, 0x72,
- 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x22, 0x20, 0x03, 0x28, 0x04,
- 0x12, 0x17, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18,
- 0x23, 0x20, 0x03, 0x28, 0x11, 0x12, 0x17, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69,
- 0x6e, 0x74, 0x36, 0x34, 0x18, 0x24, 0x20, 0x03, 0x28, 0x12, 0x12, 0x18, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x25, 0x20, 0x03, 0x28, 0x07, 0x12, 0x18, 0x0a, 0x10,
- 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x26, 0x20, 0x03,
- 0x28, 0x06, 0x12, 0x19, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65,
- 0x64, 0x33, 0x32, 0x18, 0x27, 0x20, 0x03, 0x28, 0x0f, 0x12, 0x19, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,
- 0x64, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x28, 0x20, 0x03, 0x28, 0x10, 0x12, 0x16, 0x0a, 0x0e,
- 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x29, 0x20, 0x03, 0x28, 0x02,
- 0x12, 0x17, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18,
- 0x2a, 0x20, 0x03, 0x28, 0x01, 0x12, 0x15, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6f,
- 0x6f, 0x6c, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x08, 0x12, 0x17, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64,
- 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x2c, 0x20, 0x03, 0x28, 0x09, 0x12, 0x16, 0x0a, 0x0e, 0x72, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x2d, 0x20, 0x03, 0x28, 0x0c, 0x12, 0x44, 0x0a,
- 0x0d, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x2e, 0x20, 0x03, 0x28, 0x0a,
- 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x4e, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x30, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64,
- 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x18, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x31, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x17,
- 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x18, 0x32, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70,
- 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x14, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x33, 0x20, 0x03, 0x28, 0x0e,
- 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64,
- 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x3d, 0x0a, 0x15, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72,
- 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x34, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65,
- 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x42, 0x0a, 0x14, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x35, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x24, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d,
- 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x15, 0x72,
- 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65,
- 0x18, 0x36, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x08, 0x02, 0x12, 0x19, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x37, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x08, 0x01, 0x12, 0x19, 0x0a,
- 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x3d, 0x20, 0x01, 0x28, 0x05,
- 0x3a, 0x02, 0x34, 0x31, 0x12, 0x19, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x36,
- 0x34, 0x18, 0x3e, 0x20, 0x01, 0x28, 0x03, 0x3a, 0x02, 0x34, 0x32, 0x12, 0x1a, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75,
- 0x6c, 0x74, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x3f, 0x20, 0x01, 0x28, 0x0d, 0x3a, 0x02, 0x34, 0x33, 0x12,
- 0x1a, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x40, 0x20,
- 0x01, 0x28, 0x04, 0x3a, 0x02, 0x34, 0x34, 0x12, 0x1b, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73,
- 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x41, 0x20, 0x01, 0x28, 0x11, 0x3a, 0x03, 0x2d, 0x34, 0x35, 0x12, 0x1a, 0x0a, 0x0e,
- 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x42, 0x20, 0x01, 0x28, 0x12,
- 0x3a, 0x02, 0x34, 0x36, 0x12, 0x1b, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x69, 0x78, 0x65,
- 0x64, 0x33, 0x32, 0x18, 0x43, 0x20, 0x01, 0x28, 0x07, 0x3a, 0x02, 0x34, 0x37, 0x12, 0x1b, 0x0a, 0x0f, 0x64, 0x65, 0x66,
- 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x44, 0x20, 0x01, 0x28, 0x06, 0x3a, 0x02,
- 0x34, 0x38, 0x12, 0x1c, 0x0a, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64,
- 0x33, 0x32, 0x18, 0x45, 0x20, 0x01, 0x28, 0x0f, 0x3a, 0x02, 0x34, 0x39, 0x12, 0x1d, 0x0a, 0x10, 0x64, 0x65, 0x66, 0x61,
- 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x46, 0x20, 0x01, 0x28, 0x10, 0x3a, 0x03,
- 0x2d, 0x35, 0x30, 0x12, 0x1b, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74,
- 0x18, 0x47, 0x20, 0x01, 0x28, 0x02, 0x3a, 0x04, 0x35, 0x31, 0x2e, 0x35, 0x12, 0x1d, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61,
- 0x75, 0x6c, 0x74, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x48, 0x20, 0x01, 0x28, 0x01, 0x3a, 0x05, 0x35, 0x32,
- 0x30, 0x30, 0x30, 0x12, 0x1a, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18,
- 0x49, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75,
- 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x4a, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x05, 0x68, 0x65, 0x6c,
- 0x6c, 0x6f, 0x12, 0x1c, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18,
- 0x4b, 0x20, 0x01, 0x28, 0x0c, 0x3a, 0x05, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x12, 0x4c, 0x0a, 0x13, 0x64, 0x65, 0x66, 0x61,
- 0x75, 0x6c, 0x74, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x51, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65,
- 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x03, 0x42, 0x41, 0x52, 0x12, 0x49, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
- 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x52, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x0b, 0x46, 0x4f, 0x52, 0x45, 0x49, 0x47,
- 0x4e, 0x5f, 0x42, 0x41, 0x52, 0x12, 0x4d, 0x0a, 0x13, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x6d, 0x70,
- 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x53, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72,
- 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54,
- 0x5f, 0x42, 0x41, 0x52, 0x12, 0x25, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69,
- 0x6e, 0x67, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x54, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x03, 0x61, 0x62, 0x63, 0x42,
- 0x02, 0x08, 0x02, 0x12, 0x1d, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x72, 0x64, 0x18,
- 0x55, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x03, 0x31, 0x32, 0x33, 0x42, 0x02, 0x08, 0x01, 0x1a, 0x1b, 0x0a, 0x0d, 0x4e, 0x65,
- 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0a, 0x0a, 0x02, 0x62, 0x62, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x05, 0x1a, 0x1a, 0x0a, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70,
- 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x1a, 0x1a, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x65, 0x61,
- 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x05, 0x22,
- 0x27, 0x0a, 0x0a, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x4f, 0x4f,
- 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41, 0x52, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41, 0x5a, 0x10, 0x03,
- 0x22, 0x1b, 0x0a, 0x0e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x09,
- 0x0a, 0x01, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x22, 0x1d, 0x0a, 0x11, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c,
- 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2a, 0x08, 0x08, 0x01, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02,
- 0x22, 0x24, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x22, 0x24,
- 0x0a, 0x17, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x05, 0x22, 0xd5, 0x05, 0x0a,
- 0x0c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x01,
- 0x20, 0x02, 0x28, 0x05, 0x12, 0x0e, 0x0a, 0x06, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
- 0x12, 0x09, 0x0a, 0x01, 0x62, 0x18, 0x03, 0x20, 0x02, 0x28, 0x05, 0x12, 0x0e, 0x0a, 0x06, 0x64, 0x75, 0x6d, 0x6d, 0x79,
- 0x34, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0e, 0x0a, 0x06, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x35, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x05, 0x12, 0x0e, 0x0a, 0x06, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x36, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x12,
- 0x0e, 0x0a, 0x06, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x37, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0e, 0x0a, 0x06, 0x64,
- 0x75, 0x6d, 0x6d, 0x79, 0x38, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0e, 0x0a, 0x06, 0x64, 0x75, 0x6d, 0x6d, 0x79,
- 0x39, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x30, 0x18, 0x0a,
- 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x31, 0x18, 0x0b, 0x20, 0x01, 0x28,
- 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f,
- 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x33, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64,
- 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x34, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d,
- 0x79, 0x31, 0x35, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x36,
- 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x37, 0x18, 0x11, 0x20,
- 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x38, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05,
- 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x31, 0x39, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a,
- 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x30, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75,
- 0x6d, 0x6d, 0x79, 0x32, 0x31, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79,
- 0x32, 0x32, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x33, 0x18,
- 0x17, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x34, 0x18, 0x18, 0x20, 0x01,
- 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x35, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x12,
- 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x36, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07,
- 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32, 0x37, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d,
- 0x6d, 0x79, 0x32, 0x38, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x32,
- 0x39, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x33, 0x30, 0x18, 0x1e,
- 0x20, 0x01, 0x28, 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x33, 0x31, 0x18, 0x1f, 0x20, 0x01, 0x28,
- 0x05, 0x12, 0x0f, 0x0a, 0x07, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x33, 0x32, 0x18, 0x20, 0x20, 0x01, 0x28, 0x05, 0x12, 0x09,
- 0x0a, 0x01, 0x63, 0x18, 0x21, 0x20, 0x02, 0x28, 0x05, 0x32, 0x56, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12,
- 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe8, 0x07,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
- 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x32, 0x55, 0x0a,
- 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
- 0x69, 0x72, 0x65, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x13, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
- 0x64, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x12, 0x39, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
- 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52,
- 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65,
- 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0d, 0x0a, 0x05, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x05, 0x22, 0x5a, 0x0a, 0x11, 0x54, 0x65, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4e, 0x65, 0x73, 0x74,
- 0x65, 0x64, 0x12, 0x45, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e,
- 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x54, 0x65, 0x73,
- 0x74, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2a, 0x0a, 0x1e, 0x54, 0x65, 0x73,
- 0x74, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2a, 0x08, 0x08, 0x01, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x34, 0x0a,
- 0x18, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x54, 0x61, 0x67, 0x4e,
- 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0d, 0x0a, 0x02,
- 0x62, 0x62, 0x18, 0xff, 0xff, 0xff, 0x7f, 0x20, 0x01, 0x28, 0x05, 0x22, 0x55, 0x0a, 0x14, 0x54, 0x65, 0x73, 0x74, 0x52,
- 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x01, 0x61,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65,
- 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x22, 0x4b,
- 0x0a, 0x14, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x75, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x41, 0x12, 0x33, 0x0a, 0x02, 0x62, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d,
- 0x75, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x22, 0x62, 0x0a, 0x14, 0x54,
- 0x65, 0x73, 0x74, 0x4d, 0x75, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x12,
- 0x32, 0x0a, 0x01, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x75, 0x74, 0x75, 0x61,
- 0x6c, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x12, 0x16, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f,
- 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x22, 0xb3, 0x01, 0x0a, 0x12,
- 0x54, 0x65, 0x73, 0x74, 0x44, 0x75, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x09,
- 0x0a, 0x01, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x36, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0a, 0x32, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65,
- 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x44, 0x75, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65,
- 0x72, 0x2e, 0x46, 0x6f, 0x6f, 0x12, 0x36, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0a, 0x32, 0x29,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x44, 0x75, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x42, 0x61,
- 0x72, 0x1a, 0x10, 0x0a, 0x03, 0x46, 0x6f, 0x6f, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x1a,
- 0x10, 0x0a, 0x03, 0x42, 0x61, 0x72, 0x12, 0x09, 0x0a, 0x01, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x22, 0x80, 0x02,
- 0x0a, 0x18, 0x54, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
- 0x61, 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x5a, 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6e,
- 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x39, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x61, 0x73,
- 0x42, 0x69, 0x74, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x87,
- 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x1c,
- 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x12, 0x50, 0x0a, 0x25, 0x6e, 0x65,
- 0x73, 0x74, 0x65, 0x64, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64,
- 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe5, 0x03, 0x0a,
- 0x17, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e,
- 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x0e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x46, 0x69, 0x65,
- 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x13, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69,
- 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x31, 0x0a, 0x09, 0x45, 0x6e, 0x75, 0x6d, 0x46, 0x69, 0x65,
- 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f,
- 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d,
- 0x12, 0x37, 0x0a, 0x0c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65,
- 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a,
- 0x10, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x09, 0x42, 0x02, 0x08, 0x02, 0x12, 0x15, 0x0a, 0x09, 0x43, 0x6f, 0x72, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64,
- 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x08, 0x01, 0x12, 0x1e, 0x0a, 0x16, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x07, 0x20, 0x03,
- 0x28, 0x05, 0x12, 0x1b, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
- 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x12, 0x39, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x65, 0x61,
- 0x74, 0x65, 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1e,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46,
- 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x3f, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
- 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x18, 0x52,
- 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46, 0x69,
- 0x65, 0x6c, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x08, 0x02, 0x12, 0x1d, 0x0a, 0x11, 0x52, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x72, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09,
- 0x42, 0x02, 0x08, 0x01, 0x22, 0x55, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x72, 0x64,
- 0x65, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x11, 0x0a, 0x09, 0x6d, 0x79, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18,
- 0x0b, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0e, 0x0a, 0x06, 0x6d, 0x79, 0x5f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x03, 0x12, 0x10, 0x0a, 0x08, 0x6d, 0x79, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x65, 0x20, 0x01, 0x28, 0x02, 0x2a,
- 0x04, 0x08, 0x02, 0x10, 0x0b, 0x2a, 0x04, 0x08, 0x0c, 0x10, 0x65, 0x22, 0x90, 0x02, 0x0a, 0x18, 0x54, 0x65, 0x73, 0x74,
- 0x45, 0x78, 0x74, 0x72, 0x65, 0x6d, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
- 0x12, 0x3f, 0x0a, 0x0d, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0c, 0x3a, 0x28, 0x5c, 0x30, 0x30, 0x30, 0x5c, 0x30, 0x30, 0x31, 0x5c, 0x30, 0x30, 0x37, 0x5c, 0x30, 0x31,
- 0x30, 0x5c, 0x30, 0x31, 0x34, 0x5c, 0x6e, 0x5c, 0x72, 0x5c, 0x74, 0x5c, 0x30, 0x31, 0x33, 0x5c, 0x5c, 0x5c, 0x27, 0x5c,
- 0x22, 0x5c, 0x33, 0x37, 0x36, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33,
- 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x3a, 0x0a, 0x34, 0x32, 0x39, 0x34, 0x39, 0x36, 0x37, 0x32, 0x39, 0x35, 0x12,
- 0x2a, 0x0a, 0x0c, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x04, 0x3a, 0x14, 0x31, 0x38, 0x34, 0x34, 0x36, 0x37, 0x34, 0x34, 0x30, 0x37, 0x33, 0x37, 0x30, 0x39, 0x35, 0x35, 0x31,
- 0x36, 0x31, 0x35, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x05, 0x3a, 0x0b, 0x2d, 0x32, 0x31, 0x34, 0x37, 0x34, 0x38, 0x33, 0x36, 0x34, 0x37, 0x12, 0x29, 0x0a,
- 0x0b, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x3a, 0x14,
- 0x2d, 0x39, 0x32, 0x32, 0x33, 0x33, 0x37, 0x32, 0x30, 0x33, 0x36, 0x38, 0x35, 0x34, 0x37, 0x37, 0x35, 0x38, 0x30, 0x37,
- 0x12, 0x18, 0x0a, 0x0b, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x09, 0x3a, 0x03, 0xe1, 0x88, 0xb4, 0x22, 0x0c, 0x0a, 0x0a, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x22, 0x0d, 0x0a, 0x0b, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x42,
- 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x42, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x40, 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12,
- 0x0f, 0x0a, 0x0b, 0x46, 0x4f, 0x52, 0x45, 0x49, 0x47, 0x4e, 0x5f, 0x46, 0x4f, 0x4f, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b,
- 0x46, 0x4f, 0x52, 0x45, 0x49, 0x47, 0x4e, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x4f, 0x52,
- 0x45, 0x49, 0x47, 0x4e, 0x5f, 0x42, 0x41, 0x5a, 0x10, 0x06, 0x2a, 0x47, 0x0a, 0x14, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6e,
- 0x75, 0x6d, 0x57, 0x69, 0x74, 0x68, 0x44, 0x75, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x4f,
- 0x4f, 0x31, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x41, 0x52, 0x31, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x41,
- 0x5a, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x4f, 0x4f, 0x32, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x41, 0x52,
- 0x32, 0x10, 0x02, 0x2a, 0x89, 0x01, 0x0a, 0x0e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x45, 0x6e,
- 0x75, 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x5f, 0x41, 0x10, 0x7b, 0x12, 0x0e, 0x0a, 0x08,
- 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x5f, 0x42, 0x10, 0xa6, 0xe7, 0x03, 0x12, 0x0f, 0x0a, 0x08, 0x53, 0x50, 0x41, 0x52,
- 0x53, 0x45, 0x5f, 0x43, 0x10, 0xb2, 0xb1, 0x80, 0x06, 0x12, 0x15, 0x0a, 0x08, 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x5f,
- 0x44, 0x10, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x15, 0x0a, 0x08, 0x53, 0x50, 0x41, 0x52,
- 0x53, 0x45, 0x5f, 0x45, 0x10, 0xb4, 0xde, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53,
- 0x50, 0x41, 0x52, 0x53, 0x45, 0x5f, 0x46, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x5f,
- 0x47, 0x10, 0x02, 0x32, 0x99, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
- 0x44, 0x0a, 0x03, 0x46, 0x6f, 0x6f, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f,
- 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x42, 0x61, 0x72, 0x12, 0x1d, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x61, 0x72,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75,
- 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a,
- 0x46, 0x0a, 0x18, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75,
- 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x46, 0x0a, 0x18, 0x6f, 0x70, 0x74, 0x69, 0x6f,
- 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12,
- 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x03, 0x3a, 0x47, 0x0a, 0x19, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x69, 0x6e, 0x74,
- 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c,
- 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x3a, 0x47, 0x0a, 0x19,
- 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x3a, 0x47, 0x0a, 0x19, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
- 0x6c, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x11, 0x3a, 0x47, 0x0a, 0x19, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36,
- 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x12, 0x3a, 0x48, 0x0a, 0x1a, 0x6f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x07, 0x3a, 0x48, 0x0a, 0x1a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
- 0x6c, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12,
- 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20,
- 0x01, 0x28, 0x06, 0x3a, 0x49, 0x0a, 0x1b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x66, 0x69, 0x78,
- 0x65, 0x64, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x3a, 0x49,
- 0x0a, 0x1b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x10, 0x3a, 0x46, 0x0a, 0x18, 0x6f, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18,
- 0x0b, 0x20, 0x01, 0x28, 0x02, 0x3a, 0x47, 0x0a, 0x19, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f,
- 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x3a, 0x45,
- 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x47, 0x0a, 0x19, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
- 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x01,
- 0x28, 0x09, 0x3a, 0x46, 0x0a, 0x18, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73,
- 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x3a, 0x71, 0x0a, 0x17, 0x6f, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18,
- 0x10, 0x20, 0x01, 0x28, 0x0a, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x7e, 0x0a, 0x21, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
- 0x6c, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79,
- 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x73, 0x0a,
- 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6d, 0x65,
- 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x78, 0x0a, 0x21, 0x6f, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f,
- 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x78, 0x0a, 0x1e,
- 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d,
- 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x6d,
- 0x0a, 0x1f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x65,
- 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c,
- 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f,
- 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x72, 0x0a, 0x1e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,
- 0x6c, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74,
- 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75,
- 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72,
- 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x51, 0x0a, 0x1f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74,
- 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x18,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x08, 0x02, 0x3a, 0x49, 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
- 0x5f, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x02, 0x08, 0x01, 0x3a, 0x46, 0x0a, 0x18, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x33,
- 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x05, 0x3a, 0x46, 0x0a, 0x18, 0x72,
- 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74,
- 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x03, 0x3a, 0x47, 0x0a, 0x19, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73,
- 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x21, 0x20, 0x03, 0x28, 0x0d,
- 0x3a, 0x47, 0x0a, 0x19, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x04, 0x3a, 0x47, 0x0a, 0x19, 0x72, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65,
- 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
- 0x18, 0x23, 0x20, 0x03, 0x28, 0x11, 0x3a, 0x47, 0x0a, 0x19, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73,
- 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x24, 0x20, 0x03, 0x28, 0x12, 0x3a,
- 0x48, 0x0a, 0x1a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x25, 0x20, 0x03, 0x28, 0x07, 0x3a, 0x48, 0x0a, 0x1a, 0x72, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74,
- 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x18, 0x26, 0x20, 0x03, 0x28, 0x06, 0x3a, 0x49, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x27, 0x20, 0x03,
- 0x28, 0x0f, 0x3a, 0x49, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65,
- 0x64, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c,
- 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x28, 0x20, 0x03, 0x28, 0x10, 0x3a, 0x46, 0x0a,
- 0x18, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x29, 0x20, 0x03, 0x28, 0x02, 0x3a, 0x47, 0x0a, 0x19, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,
- 0x64, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x2a, 0x20, 0x03,
- 0x28, 0x01, 0x3a, 0x45, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x08, 0x3a, 0x47, 0x0a, 0x19, 0x72, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65,
- 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
- 0x18, 0x2c, 0x20, 0x03, 0x28, 0x09, 0x3a, 0x46, 0x0a, 0x18, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62,
- 0x79, 0x74, 0x65, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x2d, 0x20, 0x03, 0x28, 0x0c, 0x3a, 0x71,
- 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x2e, 0x20, 0x03, 0x28, 0x0a, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72,
- 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x7e, 0x0a, 0x21, 0x72, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x30, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x3a, 0x73, 0x0a, 0x22, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67,
- 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12,
- 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x31, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74,
- 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x78,
- 0x0a, 0x21, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x65,
- 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x32, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f,
- 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x3a, 0x78, 0x0a, 0x1e, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f,
- 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x33, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2a,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, 0x6e,
- 0x75, 0x6d, 0x3a, 0x6d, 0x0a, 0x1f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x69,
- 0x67, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65,
- 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x34, 0x20, 0x03, 0x28,
- 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x72, 0x0a, 0x1e, 0x72, 0x65, 0x70,
- 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75,
- 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x35, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49,
- 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x51, 0x0a, 0x1f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,
- 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
- 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x18, 0x36, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x08, 0x02, 0x3a, 0x49, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65,
- 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12,
- 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x37, 0x20,
- 0x03, 0x28, 0x09, 0x42, 0x02, 0x08, 0x01, 0x3a, 0x49, 0x0a, 0x17, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x69,
- 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x3d, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x02,
- 0x34, 0x31, 0x3a, 0x49, 0x0a, 0x17, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f,
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x3e, 0x20, 0x01, 0x28, 0x03, 0x3a, 0x02, 0x34, 0x32, 0x3a, 0x4a, 0x0a,
- 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
- 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x3f, 0x20, 0x01, 0x28, 0x0d, 0x3a, 0x02, 0x34, 0x33, 0x3a, 0x4a, 0x0a, 0x18, 0x64, 0x65, 0x66,
- 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73,
- 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18,
- 0x40, 0x20, 0x01, 0x28, 0x04, 0x3a, 0x02, 0x34, 0x34, 0x3a, 0x4b, 0x0a, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
- 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65,
- 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x41, 0x20, 0x01, 0x28,
- 0x11, 0x3a, 0x03, 0x2d, 0x34, 0x35, 0x3a, 0x4a, 0x0a, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x69,
- 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41,
- 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x42, 0x20, 0x01, 0x28, 0x12, 0x3a, 0x02,
- 0x34, 0x36, 0x3a, 0x4b, 0x0a, 0x19, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33,
- 0x32, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x43, 0x20, 0x01, 0x28, 0x07, 0x3a, 0x02, 0x34, 0x37, 0x3a,
- 0x4b, 0x0a, 0x19, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x65,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f,
- 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65,
- 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x44, 0x20, 0x01, 0x28, 0x06, 0x3a, 0x02, 0x34, 0x38, 0x3a, 0x4c, 0x0a, 0x1a,
- 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x65, 0x78, 0x74,
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
- 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x45, 0x20, 0x01, 0x28, 0x0f, 0x3a, 0x02, 0x34, 0x39, 0x3a, 0x4d, 0x0a, 0x1a, 0x64, 0x65,
- 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
- 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x18, 0x46, 0x20, 0x01, 0x28, 0x10, 0x3a, 0x03, 0x2d, 0x35, 0x30, 0x3a, 0x4b, 0x0a, 0x17, 0x64, 0x65, 0x66,
- 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74,
- 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x47,
- 0x20, 0x01, 0x28, 0x02, 0x3a, 0x04, 0x35, 0x31, 0x2e, 0x35, 0x3a, 0x4d, 0x0a, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
- 0x74, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
- 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x48, 0x20, 0x01,
- 0x28, 0x01, 0x3a, 0x05, 0x35, 0x32, 0x30, 0x30, 0x30, 0x3a, 0x4a, 0x0a, 0x16, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
- 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x49, 0x20, 0x01, 0x28, 0x08, 0x3a,
- 0x04, 0x74, 0x72, 0x75, 0x65, 0x3a, 0x4d, 0x0a, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72,
- 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c,
- 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x4a, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x05, 0x68,
- 0x65, 0x6c, 0x6c, 0x6f, 0x3a, 0x4c, 0x0a, 0x17, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65,
- 0x73, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x4b, 0x20, 0x01, 0x28, 0x0c, 0x3a, 0x05, 0x77, 0x6f, 0x72,
- 0x6c, 0x64, 0x3a, 0x7c, 0x0a, 0x1d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64,
- 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74,
- 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x51, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e,
- 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x45,
- 0x6e, 0x75, 0x6d, 0x3a, 0x03, 0x42, 0x41, 0x52, 0x3a, 0x79, 0x0a, 0x1e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f,
- 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65,
- 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
- 0x18, 0x52, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e,
- 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x0b,
- 0x46, 0x4f, 0x52, 0x45, 0x49, 0x47, 0x4e, 0x5f, 0x42, 0x41, 0x52, 0x3a, 0x7d, 0x0a, 0x1d, 0x64, 0x65, 0x66, 0x61, 0x75,
- 0x6c, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
- 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x18, 0x53, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f,
- 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f,
- 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x41, 0x52, 0x3a, 0x55,
- 0x0a, 0x1e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x69, 0x65,
- 0x63, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c,
- 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x54, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x03, 0x61, 0x62,
- 0x63, 0x42, 0x02, 0x08, 0x02, 0x3a, 0x4d, 0x0a, 0x16, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x72,
- 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x55, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x03, 0x31, 0x32, 0x33,
- 0x42, 0x02, 0x08, 0x01, 0x3a, 0x42, 0x0a, 0x13, 0x6d, 0x79, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75,
- 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x72, 0x64,
- 0x65, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x32, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x3f, 0x0a, 0x10, 0x6d, 0x79, 0x5f, 0x65,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65,
- 0x6c, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x49, 0x42,
- 0x0d, 0x55, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72,
- 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x11, 0x55, 0x6e, 0x69, 0x74, 0x54,
- 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
- }, new pbd::FileDescriptor[] {
- global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor,
- });
- #endregion
-
- #region Extensions
- public static readonly pb::GeneratedExtensionBase<int> OptionalInt32Extension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[0]);
- public static readonly pb::GeneratedExtensionBase<long> OptionalInt64Extension =
- pb::GeneratedSingleExtension<long>.CreateInstance(Descriptor.Extensions[1]);
- public static readonly pb::GeneratedExtensionBase<uint> OptionalUint32Extension =
- pb::GeneratedSingleExtension<uint>.CreateInstance(Descriptor.Extensions[2]);
- public static readonly pb::GeneratedExtensionBase<ulong> OptionalUint64Extension =
- pb::GeneratedSingleExtension<ulong>.CreateInstance(Descriptor.Extensions[3]);
- public static readonly pb::GeneratedExtensionBase<int> OptionalSint32Extension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[4]);
- public static readonly pb::GeneratedExtensionBase<long> OptionalSint64Extension =
- pb::GeneratedSingleExtension<long>.CreateInstance(Descriptor.Extensions[5]);
- public static readonly pb::GeneratedExtensionBase<uint> OptionalFixed32Extension =
- pb::GeneratedSingleExtension<uint>.CreateInstance(Descriptor.Extensions[6]);
- public static readonly pb::GeneratedExtensionBase<ulong> OptionalFixed64Extension =
- pb::GeneratedSingleExtension<ulong>.CreateInstance(Descriptor.Extensions[7]);
- public static readonly pb::GeneratedExtensionBase<int> OptionalSfixed32Extension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[8]);
- public static readonly pb::GeneratedExtensionBase<long> OptionalSfixed64Extension =
- pb::GeneratedSingleExtension<long>.CreateInstance(Descriptor.Extensions[9]);
- public static readonly pb::GeneratedExtensionBase<float> OptionalFloatExtension =
- pb::GeneratedSingleExtension<float>.CreateInstance(Descriptor.Extensions[10]);
- public static readonly pb::GeneratedExtensionBase<double> OptionalDoubleExtension =
- pb::GeneratedSingleExtension<double>.CreateInstance(Descriptor.Extensions[11]);
- public static readonly pb::GeneratedExtensionBase<bool> OptionalBoolExtension =
- pb::GeneratedSingleExtension<bool>.CreateInstance(Descriptor.Extensions[12]);
- public static readonly pb::GeneratedExtensionBase<string> OptionalStringExtension =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[13]);
- public static readonly pb::GeneratedExtensionBase<pb::ByteString> OptionalBytesExtension =
- pb::GeneratedSingleExtension<pb::ByteString>.CreateInstance(Descriptor.Extensions[14]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension> OptionalGroupExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension>.CreateInstance(Descriptor.Extensions[15]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage> OptionalNestedMessageExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage>.CreateInstance(Descriptor.Extensions[16]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> OptionalForeignMessageExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.ForeignMessage>.CreateInstance(Descriptor.Extensions[17]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.ImportMessage> OptionalImportMessageExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.ImportMessage>.CreateInstance(Descriptor.Extensions[18]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> OptionalNestedEnumExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>.CreateInstance(Descriptor.Extensions[19]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> OptionalForeignEnumExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>.CreateInstance(Descriptor.Extensions[20]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.ImportEnum> OptionalImportEnumExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.ImportEnum>.CreateInstance(Descriptor.Extensions[21]);
- public static readonly pb::GeneratedExtensionBase<string> OptionalStringPieceExtension =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[22]);
- public static readonly pb::GeneratedExtensionBase<string> OptionalCordExtension =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[23]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<int>> RepeatedInt32Extension =
- pb::GeneratedRepeatExtension<int>.CreateInstance(Descriptor.Extensions[24]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<long>> RepeatedInt64Extension =
- pb::GeneratedRepeatExtension<long>.CreateInstance(Descriptor.Extensions[25]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<uint>> RepeatedUint32Extension =
- pb::GeneratedRepeatExtension<uint>.CreateInstance(Descriptor.Extensions[26]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<ulong>> RepeatedUint64Extension =
- pb::GeneratedRepeatExtension<ulong>.CreateInstance(Descriptor.Extensions[27]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<int>> RepeatedSint32Extension =
- pb::GeneratedRepeatExtension<int>.CreateInstance(Descriptor.Extensions[28]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<long>> RepeatedSint64Extension =
- pb::GeneratedRepeatExtension<long>.CreateInstance(Descriptor.Extensions[29]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<uint>> RepeatedFixed32Extension =
- pb::GeneratedRepeatExtension<uint>.CreateInstance(Descriptor.Extensions[30]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<ulong>> RepeatedFixed64Extension =
- pb::GeneratedRepeatExtension<ulong>.CreateInstance(Descriptor.Extensions[31]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<int>> RepeatedSfixed32Extension =
- pb::GeneratedRepeatExtension<int>.CreateInstance(Descriptor.Extensions[32]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<long>> RepeatedSfixed64Extension =
- pb::GeneratedRepeatExtension<long>.CreateInstance(Descriptor.Extensions[33]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<float>> RepeatedFloatExtension =
- pb::GeneratedRepeatExtension<float>.CreateInstance(Descriptor.Extensions[34]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<double>> RepeatedDoubleExtension =
- pb::GeneratedRepeatExtension<double>.CreateInstance(Descriptor.Extensions[35]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<bool>> RepeatedBoolExtension =
- pb::GeneratedRepeatExtension<bool>.CreateInstance(Descriptor.Extensions[36]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<string>> RepeatedStringExtension =
- pb::GeneratedRepeatExtension<string>.CreateInstance(Descriptor.Extensions[37]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<pb::ByteString>> RepeatedBytesExtension =
- pb::GeneratedRepeatExtension<pb::ByteString>.CreateInstance(Descriptor.Extensions[38]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension>> RepeatedGroupExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension>.CreateInstance(Descriptor.Extensions[39]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage>> RepeatedNestedMessageExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage>.CreateInstance(Descriptor.Extensions[40]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage>> RepeatedForeignMessageExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.ForeignMessage>.CreateInstance(Descriptor.Extensions[41]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.ImportMessage>> RepeatedImportMessageExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.ImportMessage>.CreateInstance(Descriptor.Extensions[42]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>> RepeatedNestedEnumExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>.CreateInstance(Descriptor.Extensions[43]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>> RepeatedForeignEnumExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>.CreateInstance(Descriptor.Extensions[44]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.ImportEnum>> RepeatedImportEnumExtension =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.ImportEnum>.CreateInstance(Descriptor.Extensions[45]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<string>> RepeatedStringPieceExtension =
- pb::GeneratedRepeatExtension<string>.CreateInstance(Descriptor.Extensions[46]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<string>> RepeatedCordExtension =
- pb::GeneratedRepeatExtension<string>.CreateInstance(Descriptor.Extensions[47]);
- public static readonly pb::GeneratedExtensionBase<int> DefaultInt32Extension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[48]);
- public static readonly pb::GeneratedExtensionBase<long> DefaultInt64Extension =
- pb::GeneratedSingleExtension<long>.CreateInstance(Descriptor.Extensions[49]);
- public static readonly pb::GeneratedExtensionBase<uint> DefaultUint32Extension =
- pb::GeneratedSingleExtension<uint>.CreateInstance(Descriptor.Extensions[50]);
- public static readonly pb::GeneratedExtensionBase<ulong> DefaultUint64Extension =
- pb::GeneratedSingleExtension<ulong>.CreateInstance(Descriptor.Extensions[51]);
- public static readonly pb::GeneratedExtensionBase<int> DefaultSint32Extension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[52]);
- public static readonly pb::GeneratedExtensionBase<long> DefaultSint64Extension =
- pb::GeneratedSingleExtension<long>.CreateInstance(Descriptor.Extensions[53]);
- public static readonly pb::GeneratedExtensionBase<uint> DefaultFixed32Extension =
- pb::GeneratedSingleExtension<uint>.CreateInstance(Descriptor.Extensions[54]);
- public static readonly pb::GeneratedExtensionBase<ulong> DefaultFixed64Extension =
- pb::GeneratedSingleExtension<ulong>.CreateInstance(Descriptor.Extensions[55]);
- public static readonly pb::GeneratedExtensionBase<int> DefaultSfixed32Extension =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[56]);
- public static readonly pb::GeneratedExtensionBase<long> DefaultSfixed64Extension =
- pb::GeneratedSingleExtension<long>.CreateInstance(Descriptor.Extensions[57]);
- public static readonly pb::GeneratedExtensionBase<float> DefaultFloatExtension =
- pb::GeneratedSingleExtension<float>.CreateInstance(Descriptor.Extensions[58]);
- public static readonly pb::GeneratedExtensionBase<double> DefaultDoubleExtension =
- pb::GeneratedSingleExtension<double>.CreateInstance(Descriptor.Extensions[59]);
- public static readonly pb::GeneratedExtensionBase<bool> DefaultBoolExtension =
- pb::GeneratedSingleExtension<bool>.CreateInstance(Descriptor.Extensions[60]);
- public static readonly pb::GeneratedExtensionBase<string> DefaultStringExtension =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[61]);
- public static readonly pb::GeneratedExtensionBase<pb::ByteString> DefaultBytesExtension =
- pb::GeneratedSingleExtension<pb::ByteString>.CreateInstance(Descriptor.Extensions[62]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> DefaultNestedEnumExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>.CreateInstance(Descriptor.Extensions[63]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> DefaultForeignEnumExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>.CreateInstance(Descriptor.Extensions[64]);
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.ImportEnum> DefaultImportEnumExtension =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.ImportEnum>.CreateInstance(Descriptor.Extensions[65]);
- public static readonly pb::GeneratedExtensionBase<string> DefaultStringPieceExtension =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[66]);
- public static readonly pb::GeneratedExtensionBase<string> DefaultCordExtension =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[67]);
- public static readonly pb::GeneratedExtensionBase<string> MyExtensionString =
- pb::GeneratedSingleExtension<string>.CreateInstance(Descriptor.Extensions[68]);
- public static readonly pb::GeneratedExtensionBase<int> MyExtensionInt =
- pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[69]);
- #endregion
-
- #region Static variables
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes__Descriptor
- = Descriptor.MessageTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder> internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder>(internal__static_protobuf_unittest_TestAllTypes__Descriptor,
- new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalGroup", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalImportMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalImportEnum", "OptionalStringPiece", "OptionalCord", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedGroup", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedStringPiece", "RepeatedCord", "DefaultInt32", "DefaultInt64", "DefaultUint32", "DefaultUint64", "DefaultSint32", "DefaultSint64", "DefaultFixed32", "DefaultFixed64", "DefaultSfixed32", "DefaultSfixed64", "DefaultFloat", "DefaultDouble", "DefaultBool", "DefaultString", "DefaultBytes", "DefaultNestedEnum", "DefaultForeignEnum", "DefaultImportEnum", "DefaultStringPiece", "DefaultCord", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor
- = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder> internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder>(internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor,
- new string[] { "Bb", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor
- = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[1];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder> internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder>(internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor,
- new string[] { "A", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor
- = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[2];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder> internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder>(internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor,
- new string[] { "A", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_ForeignMessage__Descriptor
- = Descriptor.MessageTypes[1];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder> internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder>(internal__static_protobuf_unittest_ForeignMessage__Descriptor,
- new string[] { "C", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllExtensions__Descriptor
- = Descriptor.MessageTypes[2];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllExtensions, global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Builder> internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestAllExtensions, global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Builder>(internal__static_protobuf_unittest_TestAllExtensions__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor
- = Descriptor.MessageTypes[3];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension, global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.Builder> internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension, global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.Builder>(internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor,
- new string[] { "A", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor
- = Descriptor.MessageTypes[4];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension, global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.Builder> internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension, global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.Builder>(internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor,
- new string[] { "A", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequired__Descriptor
- = Descriptor.MessageTypes[5];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequired, global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder> internal__static_protobuf_unittest_TestRequired__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequired, global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder>(internal__static_protobuf_unittest_TestRequired__Descriptor,
- new string[] { "A", "Dummy2", "B", "Dummy4", "Dummy5", "Dummy6", "Dummy7", "Dummy8", "Dummy9", "Dummy10", "Dummy11", "Dummy12", "Dummy13", "Dummy14", "Dummy15", "Dummy16", "Dummy17", "Dummy18", "Dummy19", "Dummy20", "Dummy21", "Dummy22", "Dummy23", "Dummy24", "Dummy25", "Dummy26", "Dummy27", "Dummy28", "Dummy29", "Dummy30", "Dummy31", "Dummy32", "C", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredForeign__Descriptor
- = Descriptor.MessageTypes[6];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign, global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.Builder> internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign, global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.Builder>(internal__static_protobuf_unittest_TestRequiredForeign__Descriptor,
- new string[] { "OptionalMessage", "RepeatedMessage", "Dummy", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestForeignNested__Descriptor
- = Descriptor.MessageTypes[7];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestForeignNested, global::Google.ProtocolBuffers.TestProtos.TestForeignNested.Builder> internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestForeignNested, global::Google.ProtocolBuffers.TestProtos.TestForeignNested.Builder>(internal__static_protobuf_unittest_TestForeignNested__Descriptor,
- new string[] { "ForeignNested", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessage__Descriptor
- = Descriptor.MessageTypes[8];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage, global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.Builder> internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage, global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.Builder>(internal__static_protobuf_unittest_TestEmptyMessage__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor
- = Descriptor.MessageTypes[9];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions, global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Builder> internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions, global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Builder>(internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor
- = Descriptor.MessageTypes[10];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber, global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.Builder> internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber, global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.Builder>(internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor,
- new string[] { "A", "Bb", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor
- = Descriptor.MessageTypes[11];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage, global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder> internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage, global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder>(internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor,
- new string[] { "A", "I", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor
- = Descriptor.MessageTypes[12];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA, global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder> internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA, global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder>(internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor,
- new string[] { "Bb", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor
- = Descriptor.MessageTypes[13];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB, global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder> internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB, global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder>(internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor,
- new string[] { "A", "OptionalInt32", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor
- = Descriptor.MessageTypes[14];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber, global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Builder> internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber, global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Builder>(internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor,
- new string[] { "A", "Foo", "Bar", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor
- = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo, global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder> internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo, global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder>(internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor,
- new string[] { "A", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor
- = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[1];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar, global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder> internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar, global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder>(internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor,
- new string[] { "A", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor
- = Descriptor.MessageTypes[15];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits, global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Builder> internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits, global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Builder>(internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor,
- new string[] { "OptionalNestedMessage", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor
- = internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor.NestedTypes[0];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder> internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder>(internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor,
- new string[] { "NestedmessageRepeatedInt32", "NestedmessageRepeatedForeignmessage", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor
- = Descriptor.MessageTypes[16];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames, global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.Builder> internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames, global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.Builder>(internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor,
- new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "StringPieceField", "CordField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedStringPieceField", "RepeatedCordField", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestFieldOrderings__Descriptor
- = Descriptor.MessageTypes[17];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings, global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Builder> internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings, global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Builder>(internal__static_protobuf_unittest_TestFieldOrderings__Descriptor,
- new string[] { "MyString", "MyInt", "MyFloat", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor
- = Descriptor.MessageTypes[18];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues, global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Builder> internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues, global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Builder>(internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor,
- new string[] { "EscapedBytes", "LargeUint32", "LargeUint64", "SmallInt32", "SmallInt64", "Utf8String", });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_FooRequest__Descriptor
- = Descriptor.MessageTypes[19];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FooRequest, global::Google.ProtocolBuffers.TestProtos.FooRequest.Builder> internal__static_protobuf_unittest_FooRequest__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FooRequest, global::Google.ProtocolBuffers.TestProtos.FooRequest.Builder>(internal__static_protobuf_unittest_FooRequest__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_FooResponse__Descriptor
- = Descriptor.MessageTypes[20];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FooResponse, global::Google.ProtocolBuffers.TestProtos.FooResponse.Builder> internal__static_protobuf_unittest_FooResponse__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FooResponse, global::Google.ProtocolBuffers.TestProtos.FooResponse.Builder>(internal__static_protobuf_unittest_FooResponse__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_BarRequest__Descriptor
- = Descriptor.MessageTypes[21];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.BarRequest, global::Google.ProtocolBuffers.TestProtos.BarRequest.Builder> internal__static_protobuf_unittest_BarRequest__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.BarRequest, global::Google.ProtocolBuffers.TestProtos.BarRequest.Builder>(internal__static_protobuf_unittest_BarRequest__Descriptor,
- new string[] { });
- internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_BarResponse__Descriptor
- = Descriptor.MessageTypes[22];
- internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.BarResponse, global::Google.ProtocolBuffers.TestProtos.BarResponse.Builder> internal__static_protobuf_unittest_BarResponse__FieldAccessorTable
- = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.BarResponse, global::Google.ProtocolBuffers.TestProtos.BarResponse.Builder>(internal__static_protobuf_unittest_BarResponse__Descriptor,
- new string[] { });
- #endregion
-
- }
-
- #region Enums
- public enum ForeignEnum {
- FOREIGN_FOO = 4,
- FOREIGN_BAR = 5,
- FOREIGN_BAZ = 6,
- }
-
- public enum TestEnumWithDupValue {
- FOO1 = 1,
- BAR1 = 2,
- BAZ = 3,
- FOO2 = 1,
- BAR2 = 2,
- }
-
- public enum TestSparseEnum {
- SPARSE_A = 123,
- SPARSE_B = 62374,
- SPARSE_C = 12589234,
- SPARSE_D = -15,
- SPARSE_E = -53452,
- SPARSE_F = 0,
- SPARSE_G = 2,
- }
-
- #endregion
-
- #region Messages
- public sealed partial class TestAllTypes : pb::GeneratedMessage<TestAllTypes, TestAllTypes.Builder> {
- private static readonly TestAllTypes defaultInstance = new Builder().BuildPartial();
- public static TestAllTypes DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestAllTypes DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestAllTypes ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestAllTypes, TestAllTypes.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; }
- }
-
- #region Nested types
- public static class Types {
- public enum NestedEnum {
- FOO = 1,
- BAR = 2,
- BAZ = 3,
- }
-
- public sealed partial class NestedMessage : pb::GeneratedMessage<NestedMessage, NestedMessage.Builder> {
- private static readonly NestedMessage defaultInstance = new Builder().BuildPartial();
- public static NestedMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override NestedMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override NestedMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<NestedMessage, NestedMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; }
- }
-
- // optional int32 bb = 1;
- private bool hasBb;
- private int bb_ = 0;
- public bool HasBb {
- get { return hasBb; }
- }
- public int Bb {
- get { return bb_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasBb) {
- output.WriteInt32(1, Bb);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasBb) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, Bb);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) return this;
- if (other.HasBb) {
- Bb = other.Bb;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- Bb = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 bb = 1;
- public bool HasBb {
- get { return result.HasBb; }
- }
- public int Bb {
- get { return result.Bb; }
- set { SetBb(value); }
- }
- public Builder SetBb(int value) {
- result.hasBb = true;
- result.bb_ = value;
- return this;
- }
- public Builder ClearBb() {
- result.hasBb = false;
- result.bb_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class OptionalGroup : pb::GeneratedMessage<OptionalGroup, OptionalGroup.Builder> {
- private static readonly OptionalGroup defaultInstance = new Builder().BuildPartial();
- public static OptionalGroup DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override OptionalGroup DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override OptionalGroup ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<OptionalGroup, OptionalGroup.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; }
- }
-
- // optional int32 a = 17;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(17, A);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(17, A);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 136: {
- A = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 17;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class RepeatedGroup : pb::GeneratedMessage<RepeatedGroup, RepeatedGroup.Builder> {
- private static readonly RepeatedGroup defaultInstance = new Builder().BuildPartial();
- public static RepeatedGroup DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override RepeatedGroup DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override RepeatedGroup ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<RepeatedGroup, RepeatedGroup.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; }
- }
-
- // optional int32 a = 47;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(47, A);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(47, A);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 376: {
- A = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 47;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
- }
- }
-
- }
- #endregion
-
- // optional int32 optional_int32 = 1;
- private bool hasOptionalInt32;
- private int optionalInt32_ = 0;
- public bool HasOptionalInt32 {
- get { return hasOptionalInt32; }
- }
- public int OptionalInt32 {
- get { return optionalInt32_; }
- }
-
- // optional int64 optional_int64 = 2;
- private bool hasOptionalInt64;
- private long optionalInt64_ = 0L;
- public bool HasOptionalInt64 {
- get { return hasOptionalInt64; }
- }
- public long OptionalInt64 {
- get { return optionalInt64_; }
- }
-
- // optional uint32 optional_uint32 = 3;
- private bool hasOptionalUint32;
- private uint optionalUint32_ = 0;
- public bool HasOptionalUint32 {
- get { return hasOptionalUint32; }
- }
- public uint OptionalUint32 {
- get { return optionalUint32_; }
- }
-
- // optional uint64 optional_uint64 = 4;
- private bool hasOptionalUint64;
- private ulong optionalUint64_ = 0UL;
- public bool HasOptionalUint64 {
- get { return hasOptionalUint64; }
- }
- public ulong OptionalUint64 {
- get { return optionalUint64_; }
- }
-
- // optional sint32 optional_sint32 = 5;
- private bool hasOptionalSint32;
- private int optionalSint32_ = 0;
- public bool HasOptionalSint32 {
- get { return hasOptionalSint32; }
- }
- public int OptionalSint32 {
- get { return optionalSint32_; }
- }
-
- // optional sint64 optional_sint64 = 6;
- private bool hasOptionalSint64;
- private long optionalSint64_ = 0L;
- public bool HasOptionalSint64 {
- get { return hasOptionalSint64; }
- }
- public long OptionalSint64 {
- get { return optionalSint64_; }
- }
-
- // optional fixed32 optional_fixed32 = 7;
- private bool hasOptionalFixed32;
- private uint optionalFixed32_ = 0;
- public bool HasOptionalFixed32 {
- get { return hasOptionalFixed32; }
- }
- public uint OptionalFixed32 {
- get { return optionalFixed32_; }
- }
-
- // optional fixed64 optional_fixed64 = 8;
- private bool hasOptionalFixed64;
- private ulong optionalFixed64_ = 0UL;
- public bool HasOptionalFixed64 {
- get { return hasOptionalFixed64; }
- }
- public ulong OptionalFixed64 {
- get { return optionalFixed64_; }
- }
-
- // optional sfixed32 optional_sfixed32 = 9;
- private bool hasOptionalSfixed32;
- private int optionalSfixed32_ = 0;
- public bool HasOptionalSfixed32 {
- get { return hasOptionalSfixed32; }
- }
- public int OptionalSfixed32 {
- get { return optionalSfixed32_; }
- }
-
- // optional sfixed64 optional_sfixed64 = 10;
- private bool hasOptionalSfixed64;
- private long optionalSfixed64_ = 0L;
- public bool HasOptionalSfixed64 {
- get { return hasOptionalSfixed64; }
- }
- public long OptionalSfixed64 {
- get { return optionalSfixed64_; }
- }
-
- // optional float optional_float = 11;
- private bool hasOptionalFloat;
- private float optionalFloat_ = 0F;
- public bool HasOptionalFloat {
- get { return hasOptionalFloat; }
- }
- public float OptionalFloat {
- get { return optionalFloat_; }
- }
-
- // optional double optional_double = 12;
- private bool hasOptionalDouble;
- private double optionalDouble_ = 0D;
- public bool HasOptionalDouble {
- get { return hasOptionalDouble; }
- }
- public double OptionalDouble {
- get { return optionalDouble_; }
- }
-
- // optional bool optional_bool = 13;
- private bool hasOptionalBool;
- private bool optionalBool_ = false;
- public bool HasOptionalBool {
- get { return hasOptionalBool; }
- }
- public bool OptionalBool {
- get { return optionalBool_; }
- }
-
- // optional string optional_string = 14;
- private bool hasOptionalString;
- private string optionalString_ = "";
- public bool HasOptionalString {
- get { return hasOptionalString; }
- }
- public string OptionalString {
- get { return optionalString_; }
- }
-
- // optional bytes optional_bytes = 15;
- private bool hasOptionalBytes;
- private pb::ByteString optionalBytes_ = pb::ByteString.Empty;
- public bool HasOptionalBytes {
- get { return hasOptionalBytes; }
- }
- public pb::ByteString OptionalBytes {
- get { return optionalBytes_; }
- }
-
- // optional group OptionalGroup = 16 {
- private bool hasOptionalGroup;
- private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup optionalGroup_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance;
- public bool HasOptionalGroup {
- get { return hasOptionalGroup; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup {
- get { return optionalGroup_; }
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
- private bool hasOptionalNestedMessage;
- private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance;
- public bool HasOptionalNestedMessage {
- get { return hasOptionalNestedMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage {
- get { return optionalNestedMessage_; }
- }
-
- // optional .protobuf_unittest.ForeignMessage optional_foreign_message = 19;
- private bool hasOptionalForeignMessage;
- private global::Google.ProtocolBuffers.TestProtos.ForeignMessage optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
- public bool HasOptionalForeignMessage {
- get { return hasOptionalForeignMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage {
- get { return optionalForeignMessage_; }
- }
-
- // optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
- private bool hasOptionalImportMessage;
- private global::Google.ProtocolBuffers.TestProtos.ImportMessage optionalImportMessage_ = global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance;
- public bool HasOptionalImportMessage {
- get { return hasOptionalImportMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage {
- get { return optionalImportMessage_; }
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
- private bool hasOptionalNestedEnum;
- private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO;
- public bool HasOptionalNestedEnum {
- get { return hasOptionalNestedEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { get { return optionalNestedEnum_; }}
-
- // optional .protobuf_unittest.ForeignEnum optional_foreign_enum = 22;
- private bool hasOptionalForeignEnum;
- private global::Google.ProtocolBuffers.TestProtos.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO;
- public bool HasOptionalForeignEnum {
- get { return hasOptionalForeignEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { get { return optionalForeignEnum_; }}
-
- // optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
- private bool hasOptionalImportEnum;
- private global::Google.ProtocolBuffers.TestProtos.ImportEnum optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO;
- public bool HasOptionalImportEnum {
- get { return hasOptionalImportEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { get { return optionalImportEnum_; }}
-
- // optional string optional_string_piece = 24 [ctype = STRING_PIECE];
- private bool hasOptionalStringPiece;
- private string optionalStringPiece_ = "";
- public bool HasOptionalStringPiece {
- get { return hasOptionalStringPiece; }
- }
- public string OptionalStringPiece {
- get { return optionalStringPiece_; }
- }
-
- // optional string optional_cord = 25 [ctype = CORD];
- private bool hasOptionalCord;
- private string optionalCord_ = "";
- public bool HasOptionalCord {
- get { return hasOptionalCord; }
- }
- public string OptionalCord {
- get { return optionalCord_; }
- }
-
- // repeated int32 repeated_int32 = 31;
- private pbc::PopsicleList<int> repeatedInt32_ = new pbc::PopsicleList<int>();
- public scg::IList<int> RepeatedInt32List {
- get { return repeatedInt32_; }
- }
- public int RepeatedInt32Count {
- get { return repeatedInt32_.Count; }
- }
- public int GetRepeatedInt32(int index) {
- return repeatedInt32_[index];
- }
-
- // repeated int64 repeated_int64 = 32;
- private pbc::PopsicleList<long> repeatedInt64_ = new pbc::PopsicleList<long>();
- public scg::IList<long> RepeatedInt64List {
- get { return repeatedInt64_; }
- }
- public int RepeatedInt64Count {
- get { return repeatedInt64_.Count; }
- }
- public long GetRepeatedInt64(int index) {
- return repeatedInt64_[index];
- }
-
- // repeated uint32 repeated_uint32 = 33;
- private pbc::PopsicleList<uint> repeatedUint32_ = new pbc::PopsicleList<uint>();
- public scg::IList<uint> RepeatedUint32List {
- get { return repeatedUint32_; }
- }
- public int RepeatedUint32Count {
- get { return repeatedUint32_.Count; }
- }
- public uint GetRepeatedUint32(int index) {
- return repeatedUint32_[index];
- }
-
- // repeated uint64 repeated_uint64 = 34;
- private pbc::PopsicleList<ulong> repeatedUint64_ = new pbc::PopsicleList<ulong>();
- public scg::IList<ulong> RepeatedUint64List {
- get { return repeatedUint64_; }
- }
- public int RepeatedUint64Count {
- get { return repeatedUint64_.Count; }
- }
- public ulong GetRepeatedUint64(int index) {
- return repeatedUint64_[index];
- }
-
- // repeated sint32 repeated_sint32 = 35;
- private pbc::PopsicleList<int> repeatedSint32_ = new pbc::PopsicleList<int>();
- public scg::IList<int> RepeatedSint32List {
- get { return repeatedSint32_; }
- }
- public int RepeatedSint32Count {
- get { return repeatedSint32_.Count; }
- }
- public int GetRepeatedSint32(int index) {
- return repeatedSint32_[index];
- }
-
- // repeated sint64 repeated_sint64 = 36;
- private pbc::PopsicleList<long> repeatedSint64_ = new pbc::PopsicleList<long>();
- public scg::IList<long> RepeatedSint64List {
- get { return repeatedSint64_; }
- }
- public int RepeatedSint64Count {
- get { return repeatedSint64_.Count; }
- }
- public long GetRepeatedSint64(int index) {
- return repeatedSint64_[index];
- }
-
- // repeated fixed32 repeated_fixed32 = 37;
- private pbc::PopsicleList<uint> repeatedFixed32_ = new pbc::PopsicleList<uint>();
- public scg::IList<uint> RepeatedFixed32List {
- get { return repeatedFixed32_; }
- }
- public int RepeatedFixed32Count {
- get { return repeatedFixed32_.Count; }
- }
- public uint GetRepeatedFixed32(int index) {
- return repeatedFixed32_[index];
- }
-
- // repeated fixed64 repeated_fixed64 = 38;
- private pbc::PopsicleList<ulong> repeatedFixed64_ = new pbc::PopsicleList<ulong>();
- public scg::IList<ulong> RepeatedFixed64List {
- get { return repeatedFixed64_; }
- }
- public int RepeatedFixed64Count {
- get { return repeatedFixed64_.Count; }
- }
- public ulong GetRepeatedFixed64(int index) {
- return repeatedFixed64_[index];
- }
-
- // repeated sfixed32 repeated_sfixed32 = 39;
- private pbc::PopsicleList<int> repeatedSfixed32_ = new pbc::PopsicleList<int>();
- public scg::IList<int> RepeatedSfixed32List {
- get { return repeatedSfixed32_; }
- }
- public int RepeatedSfixed32Count {
- get { return repeatedSfixed32_.Count; }
- }
- public int GetRepeatedSfixed32(int index) {
- return repeatedSfixed32_[index];
- }
-
- // repeated sfixed64 repeated_sfixed64 = 40;
- private pbc::PopsicleList<long> repeatedSfixed64_ = new pbc::PopsicleList<long>();
- public scg::IList<long> RepeatedSfixed64List {
- get { return repeatedSfixed64_; }
- }
- public int RepeatedSfixed64Count {
- get { return repeatedSfixed64_.Count; }
- }
- public long GetRepeatedSfixed64(int index) {
- return repeatedSfixed64_[index];
- }
-
- // repeated float repeated_float = 41;
- private pbc::PopsicleList<float> repeatedFloat_ = new pbc::PopsicleList<float>();
- public scg::IList<float> RepeatedFloatList {
- get { return repeatedFloat_; }
- }
- public int RepeatedFloatCount {
- get { return repeatedFloat_.Count; }
- }
- public float GetRepeatedFloat(int index) {
- return repeatedFloat_[index];
- }
-
- // repeated double repeated_double = 42;
- private pbc::PopsicleList<double> repeatedDouble_ = new pbc::PopsicleList<double>();
- public scg::IList<double> RepeatedDoubleList {
- get { return repeatedDouble_; }
- }
- public int RepeatedDoubleCount {
- get { return repeatedDouble_.Count; }
- }
- public double GetRepeatedDouble(int index) {
- return repeatedDouble_[index];
- }
-
- // repeated bool repeated_bool = 43;
- private pbc::PopsicleList<bool> repeatedBool_ = new pbc::PopsicleList<bool>();
- public scg::IList<bool> RepeatedBoolList {
- get { return repeatedBool_; }
- }
- public int RepeatedBoolCount {
- get { return repeatedBool_.Count; }
- }
- public bool GetRepeatedBool(int index) {
- return repeatedBool_[index];
- }
-
- // repeated string repeated_string = 44;
- private pbc::PopsicleList<string> repeatedString_ = new pbc::PopsicleList<string>();
- public scg::IList<string> RepeatedStringList {
- get { return repeatedString_; }
- }
- public int RepeatedStringCount {
- get { return repeatedString_.Count; }
- }
- public string GetRepeatedString(int index) {
- return repeatedString_[index];
- }
-
- // repeated bytes repeated_bytes = 45;
- private pbc::PopsicleList<pb::ByteString> repeatedBytes_ = new pbc::PopsicleList<pb::ByteString>();
- public scg::IList<pb::ByteString> RepeatedBytesList {
- get { return repeatedBytes_; }
- }
- public int RepeatedBytesCount {
- get { return repeatedBytes_.Count; }
- }
- public pb::ByteString GetRepeatedBytes(int index) {
- return repeatedBytes_[index];
- }
-
- // repeated group RepeatedGroup = 46 {
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup> repeatedGroup_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup> RepeatedGroupList {
- get { return repeatedGroup_; }
- }
- public int RepeatedGroupCount
- { get { return repeatedGroup_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) {
- return repeatedGroup_ [index];
- }
-
- // repeated .protobuf_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage> repeatedNestedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage> RepeatedNestedMessageList {
- get { return repeatedNestedMessage_; }
- }
- public int RepeatedNestedMessageCount
- { get { return repeatedNestedMessage_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) {
- return repeatedNestedMessage_ [index];
- }
-
- // repeated .protobuf_unittest.ForeignMessage repeated_foreign_message = 49;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> repeatedForeignMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> RepeatedForeignMessageList {
- get { return repeatedForeignMessage_; }
- }
- public int RepeatedForeignMessageCount
- { get { return repeatedForeignMessage_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) {
- return repeatedForeignMessage_ [index];
- }
-
- // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ImportMessage> repeatedImportMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ImportMessage>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ImportMessage> RepeatedImportMessageList {
- get { return repeatedImportMessage_; }
- }
- public int RepeatedImportMessageCount
- { get { return repeatedImportMessage_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) {
- return repeatedImportMessage_ [index];
- }
-
- // repeated .protobuf_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
- private scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> repeatedNestedEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> ();
- public scg.IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> RepeatedNestedEnumList {
- get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); }
- }
- public int RepeatedNestedEnumCount {
- get { return repeatedNestedEnum_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) {
- return repeatedNestedEnum_[index];
- }
-
- // repeated .protobuf_unittest.ForeignEnum repeated_foreign_enum = 52;
- private scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> repeatedForeignEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> ();
- public scg.IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> RepeatedForeignEnumList {
- get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); }
- }
- public int RepeatedForeignEnumCount {
- get { return repeatedForeignEnum_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) {
- return repeatedForeignEnum_[index];
- }
-
- // repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
- private scg::IList<global::Google.ProtocolBuffers.TestProtos.ImportEnum> repeatedImportEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ImportEnum> ();
- public scg.IList<global::Google.ProtocolBuffers.TestProtos.ImportEnum> RepeatedImportEnumList {
- get { return pbc::Lists.AsReadOnly(repeatedImportEnum_); }
- }
- public int RepeatedImportEnumCount {
- get { return repeatedImportEnum_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) {
- return repeatedImportEnum_[index];
- }
-
- // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
- private pbc::PopsicleList<string> repeatedStringPiece_ = new pbc::PopsicleList<string>();
- public scg::IList<string> RepeatedStringPieceList {
- get { return repeatedStringPiece_; }
- }
- public int RepeatedStringPieceCount {
- get { return repeatedStringPiece_.Count; }
- }
- public string GetRepeatedStringPiece(int index) {
- return repeatedStringPiece_[index];
- }
-
- // repeated string repeated_cord = 55 [ctype = CORD];
- private pbc::PopsicleList<string> repeatedCord_ = new pbc::PopsicleList<string>();
- public scg::IList<string> RepeatedCordList {
- get { return repeatedCord_; }
- }
- public int RepeatedCordCount {
- get { return repeatedCord_.Count; }
- }
- public string GetRepeatedCord(int index) {
- return repeatedCord_[index];
- }
-
- // optional int32 default_int32 = 61 [default = 41];
- private bool hasDefaultInt32;
- private int defaultInt32_ = 41;
- public bool HasDefaultInt32 {
- get { return hasDefaultInt32; }
- }
- public int DefaultInt32 {
- get { return defaultInt32_; }
- }
-
- // optional int64 default_int64 = 62 [default = 42];
- private bool hasDefaultInt64;
- private long defaultInt64_ = 42L;
- public bool HasDefaultInt64 {
- get { return hasDefaultInt64; }
- }
- public long DefaultInt64 {
- get { return defaultInt64_; }
- }
-
- // optional uint32 default_uint32 = 63 [default = 43];
- private bool hasDefaultUint32;
- private uint defaultUint32_ = 43;
- public bool HasDefaultUint32 {
- get { return hasDefaultUint32; }
- }
- public uint DefaultUint32 {
- get { return defaultUint32_; }
- }
-
- // optional uint64 default_uint64 = 64 [default = 44];
- private bool hasDefaultUint64;
- private ulong defaultUint64_ = 44UL;
- public bool HasDefaultUint64 {
- get { return hasDefaultUint64; }
- }
- public ulong DefaultUint64 {
- get { return defaultUint64_; }
- }
-
- // optional sint32 default_sint32 = 65 [default = -45];
- private bool hasDefaultSint32;
- private int defaultSint32_ = -45;
- public bool HasDefaultSint32 {
- get { return hasDefaultSint32; }
- }
- public int DefaultSint32 {
- get { return defaultSint32_; }
- }
-
- // optional sint64 default_sint64 = 66 [default = 46];
- private bool hasDefaultSint64;
- private long defaultSint64_ = 46L;
- public bool HasDefaultSint64 {
- get { return hasDefaultSint64; }
- }
- public long DefaultSint64 {
- get { return defaultSint64_; }
- }
-
- // optional fixed32 default_fixed32 = 67 [default = 47];
- private bool hasDefaultFixed32;
- private uint defaultFixed32_ = 47;
- public bool HasDefaultFixed32 {
- get { return hasDefaultFixed32; }
- }
- public uint DefaultFixed32 {
- get { return defaultFixed32_; }
- }
-
- // optional fixed64 default_fixed64 = 68 [default = 48];
- private bool hasDefaultFixed64;
- private ulong defaultFixed64_ = 48UL;
- public bool HasDefaultFixed64 {
- get { return hasDefaultFixed64; }
- }
- public ulong DefaultFixed64 {
- get { return defaultFixed64_; }
- }
-
- // optional sfixed32 default_sfixed32 = 69 [default = 49];
- private bool hasDefaultSfixed32;
- private int defaultSfixed32_ = 49;
- public bool HasDefaultSfixed32 {
- get { return hasDefaultSfixed32; }
- }
- public int DefaultSfixed32 {
- get { return defaultSfixed32_; }
- }
-
- // optional sfixed64 default_sfixed64 = 70 [default = -50];
- private bool hasDefaultSfixed64;
- private long defaultSfixed64_ = -50L;
- public bool HasDefaultSfixed64 {
- get { return hasDefaultSfixed64; }
- }
- public long DefaultSfixed64 {
- get { return defaultSfixed64_; }
- }
-
- // optional float default_float = 71 [default = 51.5];
- private bool hasDefaultFloat;
- private float defaultFloat_ = 51.5F;
- public bool HasDefaultFloat {
- get { return hasDefaultFloat; }
- }
- public float DefaultFloat {
- get { return defaultFloat_; }
- }
-
- // optional double default_double = 72 [default = 52000];
- private bool hasDefaultDouble;
- private double defaultDouble_ = 52000D;
- public bool HasDefaultDouble {
- get { return hasDefaultDouble; }
- }
- public double DefaultDouble {
- get { return defaultDouble_; }
- }
-
- // optional bool default_bool = 73 [default = true];
- private bool hasDefaultBool;
- private bool defaultBool_ = true;
- public bool HasDefaultBool {
- get { return hasDefaultBool; }
- }
- public bool DefaultBool {
- get { return defaultBool_; }
- }
-
- // optional string default_string = 74 [default = "hello"];
- private bool hasDefaultString;
- private string defaultString_ = "hello";
- public bool HasDefaultString {
- get { return hasDefaultString; }
- }
- public string DefaultString {
- get { return defaultString_; }
- }
-
- // optional bytes default_bytes = 75 [default = "world"];
- private bool hasDefaultBytes;
- private pb::ByteString defaultBytes_ = ((pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue);
- public bool HasDefaultBytes {
- get { return hasDefaultBytes; }
- }
- public pb::ByteString DefaultBytes {
- get { return defaultBytes_; }
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
- private bool hasDefaultNestedEnum;
- private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR;
- public bool HasDefaultNestedEnum {
- get { return hasDefaultNestedEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { get { return defaultNestedEnum_; }}
-
- // optional .protobuf_unittest.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
- private bool hasDefaultForeignEnum;
- private global::Google.ProtocolBuffers.TestProtos.ForeignEnum defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR;
- public bool HasDefaultForeignEnum {
- get { return hasDefaultForeignEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { get { return defaultForeignEnum_; }}
-
- // optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
- private bool hasDefaultImportEnum;
- private global::Google.ProtocolBuffers.TestProtos.ImportEnum defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR;
- public bool HasDefaultImportEnum {
- get { return hasDefaultImportEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { get { return defaultImportEnum_; }}
-
- // optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
- private bool hasDefaultStringPiece;
- private string defaultStringPiece_ = "abc";
- public bool HasDefaultStringPiece {
- get { return hasDefaultStringPiece; }
- }
- public string DefaultStringPiece {
- get { return defaultStringPiece_; }
- }
-
- // optional string default_cord = 85 [default = "123", ctype = CORD];
- private bool hasDefaultCord;
- private string defaultCord_ = "123";
- public bool HasDefaultCord {
- get { return hasDefaultCord; }
- }
- public string DefaultCord {
- get { return defaultCord_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasOptionalInt32) {
- output.WriteInt32(1, OptionalInt32);
- }
- if (HasOptionalInt64) {
- output.WriteInt64(2, OptionalInt64);
- }
- if (HasOptionalUint32) {
- output.WriteUInt32(3, OptionalUint32);
- }
- if (HasOptionalUint64) {
- output.WriteUInt64(4, OptionalUint64);
- }
- if (HasOptionalSint32) {
- output.WriteSInt32(5, OptionalSint32);
- }
- if (HasOptionalSint64) {
- output.WriteSInt64(6, OptionalSint64);
- }
- if (HasOptionalFixed32) {
- output.WriteFixed32(7, OptionalFixed32);
- }
- if (HasOptionalFixed64) {
- output.WriteFixed64(8, OptionalFixed64);
- }
- if (HasOptionalSfixed32) {
- output.WriteSFixed32(9, OptionalSfixed32);
- }
- if (HasOptionalSfixed64) {
- output.WriteSFixed64(10, OptionalSfixed64);
- }
- if (HasOptionalFloat) {
- output.WriteFloat(11, OptionalFloat);
- }
- if (HasOptionalDouble) {
- output.WriteDouble(12, OptionalDouble);
- }
- if (HasOptionalBool) {
- output.WriteBool(13, OptionalBool);
- }
- if (HasOptionalString) {
- output.WriteString(14, OptionalString);
- }
- if (HasOptionalBytes) {
- output.WriteBytes(15, OptionalBytes);
- }
- if (HasOptionalGroup) {
- output.WriteGroup(16, OptionalGroup);
- }
- if (HasOptionalNestedMessage) {
- output.WriteMessage(18, OptionalNestedMessage);
- }
- if (HasOptionalForeignMessage) {
- output.WriteMessage(19, OptionalForeignMessage);
- }
- if (HasOptionalImportMessage) {
- output.WriteMessage(20, OptionalImportMessage);
- }
- if (HasOptionalNestedEnum) {
- output.WriteEnum(21, (int) OptionalNestedEnum);
- }
- if (HasOptionalForeignEnum) {
- output.WriteEnum(22, (int) OptionalForeignEnum);
- }
- if (HasOptionalImportEnum) {
- output.WriteEnum(23, (int) OptionalImportEnum);
- }
- if (HasOptionalStringPiece) {
- output.WriteString(24, OptionalStringPiece);
- }
- if (HasOptionalCord) {
- output.WriteString(25, OptionalCord);
- }
- foreach (int element in RepeatedInt32List) {
- output.WriteInt32(31, element);
- }
- foreach (long element in RepeatedInt64List) {
- output.WriteInt64(32, element);
- }
- foreach (uint element in RepeatedUint32List) {
- output.WriteUInt32(33, element);
- }
- foreach (ulong element in RepeatedUint64List) {
- output.WriteUInt64(34, element);
- }
- foreach (int element in RepeatedSint32List) {
- output.WriteSInt32(35, element);
- }
- foreach (long element in RepeatedSint64List) {
- output.WriteSInt64(36, element);
- }
- foreach (uint element in RepeatedFixed32List) {
- output.WriteFixed32(37, element);
- }
- foreach (ulong element in RepeatedFixed64List) {
- output.WriteFixed64(38, element);
- }
- foreach (int element in RepeatedSfixed32List) {
- output.WriteSFixed32(39, element);
- }
- foreach (long element in RepeatedSfixed64List) {
- output.WriteSFixed64(40, element);
- }
- foreach (float element in RepeatedFloatList) {
- output.WriteFloat(41, element);
- }
- foreach (double element in RepeatedDoubleList) {
- output.WriteDouble(42, element);
- }
- foreach (bool element in RepeatedBoolList) {
- output.WriteBool(43, element);
- }
- foreach (string element in RepeatedStringList) {
- output.WriteString(44, element);
- }
- foreach (pb::ByteString element in RepeatedBytesList) {
- output.WriteBytes(45, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup element in RepeatedGroupList) {
- output.WriteGroup(46, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) {
- output.WriteMessage(48, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedForeignMessageList) {
- output.WriteMessage(49, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ImportMessage element in RepeatedImportMessageList) {
- output.WriteMessage(50, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum element in RepeatedNestedEnumList) {
- output.WriteEnum(51, (int) element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in RepeatedForeignEnumList) {
- output.WriteEnum(52, (int) element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ImportEnum element in RepeatedImportEnumList) {
- output.WriteEnum(53, (int) element);
- }
- foreach (string element in RepeatedStringPieceList) {
- output.WriteString(54, element);
- }
- foreach (string element in RepeatedCordList) {
- output.WriteString(55, element);
- }
- if (HasDefaultInt32) {
- output.WriteInt32(61, DefaultInt32);
- }
- if (HasDefaultInt64) {
- output.WriteInt64(62, DefaultInt64);
- }
- if (HasDefaultUint32) {
- output.WriteUInt32(63, DefaultUint32);
- }
- if (HasDefaultUint64) {
- output.WriteUInt64(64, DefaultUint64);
- }
- if (HasDefaultSint32) {
- output.WriteSInt32(65, DefaultSint32);
- }
- if (HasDefaultSint64) {
- output.WriteSInt64(66, DefaultSint64);
- }
- if (HasDefaultFixed32) {
- output.WriteFixed32(67, DefaultFixed32);
- }
- if (HasDefaultFixed64) {
- output.WriteFixed64(68, DefaultFixed64);
- }
- if (HasDefaultSfixed32) {
- output.WriteSFixed32(69, DefaultSfixed32);
- }
- if (HasDefaultSfixed64) {
- output.WriteSFixed64(70, DefaultSfixed64);
- }
- if (HasDefaultFloat) {
- output.WriteFloat(71, DefaultFloat);
- }
- if (HasDefaultDouble) {
- output.WriteDouble(72, DefaultDouble);
- }
- if (HasDefaultBool) {
- output.WriteBool(73, DefaultBool);
- }
- if (HasDefaultString) {
- output.WriteString(74, DefaultString);
- }
- if (HasDefaultBytes) {
- output.WriteBytes(75, DefaultBytes);
- }
- if (HasDefaultNestedEnum) {
- output.WriteEnum(81, (int) DefaultNestedEnum);
- }
- if (HasDefaultForeignEnum) {
- output.WriteEnum(82, (int) DefaultForeignEnum);
- }
- if (HasDefaultImportEnum) {
- output.WriteEnum(83, (int) DefaultImportEnum);
- }
- if (HasDefaultStringPiece) {
- output.WriteString(84, DefaultStringPiece);
- }
- if (HasDefaultCord) {
- output.WriteString(85, DefaultCord);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasOptionalInt32) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32);
- }
- if (HasOptionalInt64) {
- size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64);
- }
- if (HasOptionalUint32) {
- size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32);
- }
- if (HasOptionalUint64) {
- size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64);
- }
- if (HasOptionalSint32) {
- size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32);
- }
- if (HasOptionalSint64) {
- size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64);
- }
- if (HasOptionalFixed32) {
- size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32);
- }
- if (HasOptionalFixed64) {
- size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64);
- }
- if (HasOptionalSfixed32) {
- size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32);
- }
- if (HasOptionalSfixed64) {
- size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64);
- }
- if (HasOptionalFloat) {
- size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat);
- }
- if (HasOptionalDouble) {
- size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble);
- }
- if (HasOptionalBool) {
- size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool);
- }
- if (HasOptionalString) {
- size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString);
- }
- if (HasOptionalBytes) {
- size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes);
- }
- if (HasOptionalGroup) {
- size += pb::CodedOutputStream.ComputeGroupSize(16, OptionalGroup);
- }
- if (HasOptionalNestedMessage) {
- size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage);
- }
- if (HasOptionalForeignMessage) {
- size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage);
- }
- if (HasOptionalImportMessage) {
- size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalImportMessage);
- }
- if (HasOptionalNestedEnum) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(21, (int) OptionalNestedEnum);
- }
- if (HasOptionalForeignEnum) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(22, (int) OptionalForeignEnum);
- }
- if (HasOptionalImportEnum) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(23, (int) OptionalImportEnum);
- }
- if (HasOptionalStringPiece) {
- size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece);
- }
- if (HasOptionalCord) {
- size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord);
- }
- foreach (int element in RepeatedInt32List) {
- size += pb::CodedOutputStream
- .ComputeInt32Size(31, element);
- }
- foreach (long element in RepeatedInt64List) {
- size += pb::CodedOutputStream
- .ComputeInt64Size(32, element);
- }
- foreach (uint element in RepeatedUint32List) {
- size += pb::CodedOutputStream
- .ComputeUInt32Size(33, element);
- }
- foreach (ulong element in RepeatedUint64List) {
- size += pb::CodedOutputStream
- .ComputeUInt64Size(34, element);
- }
- foreach (int element in RepeatedSint32List) {
- size += pb::CodedOutputStream
- .ComputeSInt32Size(35, element);
- }
- foreach (long element in RepeatedSint64List) {
- size += pb::CodedOutputStream
- .ComputeSInt64Size(36, element);
- }
- foreach (uint element in RepeatedFixed32List) {
- size += pb::CodedOutputStream
- .ComputeFixed32Size(37, element);
- }
- foreach (ulong element in RepeatedFixed64List) {
- size += pb::CodedOutputStream
- .ComputeFixed64Size(38, element);
- }
- foreach (int element in RepeatedSfixed32List) {
- size += pb::CodedOutputStream
- .ComputeSFixed32Size(39, element);
- }
- foreach (long element in RepeatedSfixed64List) {
- size += pb::CodedOutputStream
- .ComputeSFixed64Size(40, element);
- }
- foreach (float element in RepeatedFloatList) {
- size += pb::CodedOutputStream
- .ComputeFloatSize(41, element);
- }
- foreach (double element in RepeatedDoubleList) {
- size += pb::CodedOutputStream
- .ComputeDoubleSize(42, element);
- }
- foreach (bool element in RepeatedBoolList) {
- size += pb::CodedOutputStream
- .ComputeBoolSize(43, element);
- }
- foreach (string element in RepeatedStringList) {
- size += pb::CodedOutputStream
- .ComputeStringSize(44, element);
- }
- foreach (pb::ByteString element in RepeatedBytesList) {
- size += pb::CodedOutputStream
- .ComputeBytesSize(45, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup element in RepeatedGroupList) {
- size += pb::CodedOutputStream.ComputeGroupSize(46, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) {
- size += pb::CodedOutputStream.ComputeMessageSize(48, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedForeignMessageList) {
- size += pb::CodedOutputStream.ComputeMessageSize(49, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ImportMessage element in RepeatedImportMessageList) {
- size += pb::CodedOutputStream.ComputeMessageSize(50, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum element in RepeatedNestedEnumList) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(51, (int) element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in RepeatedForeignEnumList) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(52, (int) element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ImportEnum element in RepeatedImportEnumList) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(53, (int) element);
- }
- foreach (string element in RepeatedStringPieceList) {
- size += pb::CodedOutputStream
- .ComputeStringSize(54, element);
- }
- foreach (string element in RepeatedCordList) {
- size += pb::CodedOutputStream
- .ComputeStringSize(55, element);
- }
- if (HasDefaultInt32) {
- size += pb::CodedOutputStream.ComputeInt32Size(61, DefaultInt32);
- }
- if (HasDefaultInt64) {
- size += pb::CodedOutputStream.ComputeInt64Size(62, DefaultInt64);
- }
- if (HasDefaultUint32) {
- size += pb::CodedOutputStream.ComputeUInt32Size(63, DefaultUint32);
- }
- if (HasDefaultUint64) {
- size += pb::CodedOutputStream.ComputeUInt64Size(64, DefaultUint64);
- }
- if (HasDefaultSint32) {
- size += pb::CodedOutputStream.ComputeSInt32Size(65, DefaultSint32);
- }
- if (HasDefaultSint64) {
- size += pb::CodedOutputStream.ComputeSInt64Size(66, DefaultSint64);
- }
- if (HasDefaultFixed32) {
- size += pb::CodedOutputStream.ComputeFixed32Size(67, DefaultFixed32);
- }
- if (HasDefaultFixed64) {
- size += pb::CodedOutputStream.ComputeFixed64Size(68, DefaultFixed64);
- }
- if (HasDefaultSfixed32) {
- size += pb::CodedOutputStream.ComputeSFixed32Size(69, DefaultSfixed32);
- }
- if (HasDefaultSfixed64) {
- size += pb::CodedOutputStream.ComputeSFixed64Size(70, DefaultSfixed64);
- }
- if (HasDefaultFloat) {
- size += pb::CodedOutputStream.ComputeFloatSize(71, DefaultFloat);
- }
- if (HasDefaultDouble) {
- size += pb::CodedOutputStream.ComputeDoubleSize(72, DefaultDouble);
- }
- if (HasDefaultBool) {
- size += pb::CodedOutputStream.ComputeBoolSize(73, DefaultBool);
- }
- if (HasDefaultString) {
- size += pb::CodedOutputStream.ComputeStringSize(74, DefaultString);
- }
- if (HasDefaultBytes) {
- size += pb::CodedOutputStream.ComputeBytesSize(75, DefaultBytes);
- }
- if (HasDefaultNestedEnum) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(81, (int) DefaultNestedEnum);
- }
- if (HasDefaultForeignEnum) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(82, (int) DefaultForeignEnum);
- }
- if (HasDefaultImportEnum) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(83, (int) DefaultImportEnum);
- }
- if (HasDefaultStringPiece) {
- size += pb::CodedOutputStream.ComputeStringSize(84, DefaultStringPiece);
- }
- if (HasDefaultCord) {
- size += pb::CodedOutputStream.ComputeStringSize(85, DefaultCord);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllTypes ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestAllTypes prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestAllTypes, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestAllTypes MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestAllTypes();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllTypes BuildPartial() {
- result.repeatedInt32_.MakeReadOnly();
- result.repeatedInt64_.MakeReadOnly();
- result.repeatedUint32_.MakeReadOnly();
- result.repeatedUint64_.MakeReadOnly();
- result.repeatedSint32_.MakeReadOnly();
- result.repeatedSint64_.MakeReadOnly();
- result.repeatedFixed32_.MakeReadOnly();
- result.repeatedFixed64_.MakeReadOnly();
- result.repeatedSfixed32_.MakeReadOnly();
- result.repeatedSfixed64_.MakeReadOnly();
- result.repeatedFloat_.MakeReadOnly();
- result.repeatedDouble_.MakeReadOnly();
- result.repeatedBool_.MakeReadOnly();
- result.repeatedString_.MakeReadOnly();
- result.repeatedBytes_.MakeReadOnly();
- result.repeatedGroup_.MakeReadOnly();
- result.repeatedNestedMessage_.MakeReadOnly();
- result.repeatedForeignMessage_.MakeReadOnly();
- result.repeatedImportMessage_.MakeReadOnly();
- result.repeatedNestedEnum_ = pbc::Lists.AsReadOnly(result.repeatedNestedEnum_);
- result.repeatedForeignEnum_ = pbc::Lists.AsReadOnly(result.repeatedForeignEnum_);
- result.repeatedImportEnum_ = pbc::Lists.AsReadOnly(result.repeatedImportEnum_);
- result.repeatedStringPiece_.MakeReadOnly();
- result.repeatedCord_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestAllTypes) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestAllTypes) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestAllTypes other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) return this;
- if (other.HasOptionalInt32) {
- OptionalInt32 = other.OptionalInt32;
- }
- if (other.HasOptionalInt64) {
- OptionalInt64 = other.OptionalInt64;
- }
- if (other.HasOptionalUint32) {
- OptionalUint32 = other.OptionalUint32;
- }
- if (other.HasOptionalUint64) {
- OptionalUint64 = other.OptionalUint64;
- }
- if (other.HasOptionalSint32) {
- OptionalSint32 = other.OptionalSint32;
- }
- if (other.HasOptionalSint64) {
- OptionalSint64 = other.OptionalSint64;
- }
- if (other.HasOptionalFixed32) {
- OptionalFixed32 = other.OptionalFixed32;
- }
- if (other.HasOptionalFixed64) {
- OptionalFixed64 = other.OptionalFixed64;
- }
- if (other.HasOptionalSfixed32) {
- OptionalSfixed32 = other.OptionalSfixed32;
- }
- if (other.HasOptionalSfixed64) {
- OptionalSfixed64 = other.OptionalSfixed64;
- }
- if (other.HasOptionalFloat) {
- OptionalFloat = other.OptionalFloat;
- }
- if (other.HasOptionalDouble) {
- OptionalDouble = other.OptionalDouble;
- }
- if (other.HasOptionalBool) {
- OptionalBool = other.OptionalBool;
- }
- if (other.HasOptionalString) {
- OptionalString = other.OptionalString;
- }
- if (other.HasOptionalBytes) {
- OptionalBytes = other.OptionalBytes;
- }
- if (other.HasOptionalGroup) {
- MergeOptionalGroup(other.OptionalGroup);
- }
- if (other.HasOptionalNestedMessage) {
- MergeOptionalNestedMessage(other.OptionalNestedMessage);
- }
- if (other.HasOptionalForeignMessage) {
- MergeOptionalForeignMessage(other.OptionalForeignMessage);
- }
- if (other.HasOptionalImportMessage) {
- MergeOptionalImportMessage(other.OptionalImportMessage);
- }
- if (other.HasOptionalNestedEnum) {
- OptionalNestedEnum = other.OptionalNestedEnum;
- }
- if (other.HasOptionalForeignEnum) {
- OptionalForeignEnum = other.OptionalForeignEnum;
- }
- if (other.HasOptionalImportEnum) {
- OptionalImportEnum = other.OptionalImportEnum;
- }
- if (other.HasOptionalStringPiece) {
- OptionalStringPiece = other.OptionalStringPiece;
- }
- if (other.HasOptionalCord) {
- OptionalCord = other.OptionalCord;
- }
- if (other.repeatedInt32_.Count != 0) {
- base.AddRange(other.repeatedInt32_, result.repeatedInt32_);
- }
- if (other.repeatedInt64_.Count != 0) {
- base.AddRange(other.repeatedInt64_, result.repeatedInt64_);
- }
- if (other.repeatedUint32_.Count != 0) {
- base.AddRange(other.repeatedUint32_, result.repeatedUint32_);
- }
- if (other.repeatedUint64_.Count != 0) {
- base.AddRange(other.repeatedUint64_, result.repeatedUint64_);
- }
- if (other.repeatedSint32_.Count != 0) {
- base.AddRange(other.repeatedSint32_, result.repeatedSint32_);
- }
- if (other.repeatedSint64_.Count != 0) {
- base.AddRange(other.repeatedSint64_, result.repeatedSint64_);
- }
- if (other.repeatedFixed32_.Count != 0) {
- base.AddRange(other.repeatedFixed32_, result.repeatedFixed32_);
- }
- if (other.repeatedFixed64_.Count != 0) {
- base.AddRange(other.repeatedFixed64_, result.repeatedFixed64_);
- }
- if (other.repeatedSfixed32_.Count != 0) {
- base.AddRange(other.repeatedSfixed32_, result.repeatedSfixed32_);
- }
- if (other.repeatedSfixed64_.Count != 0) {
- base.AddRange(other.repeatedSfixed64_, result.repeatedSfixed64_);
- }
- if (other.repeatedFloat_.Count != 0) {
- base.AddRange(other.repeatedFloat_, result.repeatedFloat_);
- }
- if (other.repeatedDouble_.Count != 0) {
- base.AddRange(other.repeatedDouble_, result.repeatedDouble_);
- }
- if (other.repeatedBool_.Count != 0) {
- base.AddRange(other.repeatedBool_, result.repeatedBool_);
- }
- if (other.repeatedString_.Count != 0) {
- base.AddRange(other.repeatedString_, result.repeatedString_);
- }
- if (other.repeatedBytes_.Count != 0) {
- base.AddRange(other.repeatedBytes_, result.repeatedBytes_);
- }
- if (other.repeatedGroup_.Count != 0) {
- base.AddRange(other.repeatedGroup_, result.repeatedGroup_);
- }
- if (other.repeatedNestedMessage_.Count != 0) {
- base.AddRange(other.repeatedNestedMessage_, result.repeatedNestedMessage_);
- }
- if (other.repeatedForeignMessage_.Count != 0) {
- base.AddRange(other.repeatedForeignMessage_, result.repeatedForeignMessage_);
- }
- if (other.repeatedImportMessage_.Count != 0) {
- base.AddRange(other.repeatedImportMessage_, result.repeatedImportMessage_);
- }
- if (other.repeatedNestedEnum_.Count != 0) {
- if (result.repeatedNestedEnum_.Count == 0) {
- result.repeatedNestedEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>();
- }
- base.AddRange(other.repeatedNestedEnum_, result.repeatedNestedEnum_);
- }
- if (other.repeatedForeignEnum_.Count != 0) {
- if (result.repeatedForeignEnum_.Count == 0) {
- result.repeatedForeignEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>();
- }
- base.AddRange(other.repeatedForeignEnum_, result.repeatedForeignEnum_);
- }
- if (other.repeatedImportEnum_.Count != 0) {
- if (result.repeatedImportEnum_.Count == 0) {
- result.repeatedImportEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ImportEnum>();
- }
- base.AddRange(other.repeatedImportEnum_, result.repeatedImportEnum_);
- }
- if (other.repeatedStringPiece_.Count != 0) {
- base.AddRange(other.repeatedStringPiece_, result.repeatedStringPiece_);
- }
- if (other.repeatedCord_.Count != 0) {
- base.AddRange(other.repeatedCord_, result.repeatedCord_);
- }
- if (other.HasDefaultInt32) {
- DefaultInt32 = other.DefaultInt32;
- }
- if (other.HasDefaultInt64) {
- DefaultInt64 = other.DefaultInt64;
- }
- if (other.HasDefaultUint32) {
- DefaultUint32 = other.DefaultUint32;
- }
- if (other.HasDefaultUint64) {
- DefaultUint64 = other.DefaultUint64;
- }
- if (other.HasDefaultSint32) {
- DefaultSint32 = other.DefaultSint32;
- }
- if (other.HasDefaultSint64) {
- DefaultSint64 = other.DefaultSint64;
- }
- if (other.HasDefaultFixed32) {
- DefaultFixed32 = other.DefaultFixed32;
- }
- if (other.HasDefaultFixed64) {
- DefaultFixed64 = other.DefaultFixed64;
- }
- if (other.HasDefaultSfixed32) {
- DefaultSfixed32 = other.DefaultSfixed32;
- }
- if (other.HasDefaultSfixed64) {
- DefaultSfixed64 = other.DefaultSfixed64;
- }
- if (other.HasDefaultFloat) {
- DefaultFloat = other.DefaultFloat;
- }
- if (other.HasDefaultDouble) {
- DefaultDouble = other.DefaultDouble;
- }
- if (other.HasDefaultBool) {
- DefaultBool = other.DefaultBool;
- }
- if (other.HasDefaultString) {
- DefaultString = other.DefaultString;
- }
- if (other.HasDefaultBytes) {
- DefaultBytes = other.DefaultBytes;
- }
- if (other.HasDefaultNestedEnum) {
- DefaultNestedEnum = other.DefaultNestedEnum;
- }
- if (other.HasDefaultForeignEnum) {
- DefaultForeignEnum = other.DefaultForeignEnum;
- }
- if (other.HasDefaultImportEnum) {
- DefaultImportEnum = other.DefaultImportEnum;
- }
- if (other.HasDefaultStringPiece) {
- DefaultStringPiece = other.DefaultStringPiece;
- }
- if (other.HasDefaultCord) {
- DefaultCord = other.DefaultCord;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- OptionalInt32 = input.ReadInt32();
- break;
- }
- case 16: {
- OptionalInt64 = input.ReadInt64();
- break;
- }
- case 24: {
- OptionalUint32 = input.ReadUInt32();
- break;
- }
- case 32: {
- OptionalUint64 = input.ReadUInt64();
- break;
- }
- case 40: {
- OptionalSint32 = input.ReadSInt32();
- break;
- }
- case 48: {
- OptionalSint64 = input.ReadSInt64();
- break;
- }
- case 61: {
- OptionalFixed32 = input.ReadFixed32();
- break;
- }
- case 65: {
- OptionalFixed64 = input.ReadFixed64();
- break;
- }
- case 77: {
- OptionalSfixed32 = input.ReadSFixed32();
- break;
- }
- case 81: {
- OptionalSfixed64 = input.ReadSFixed64();
- break;
- }
- case 93: {
- OptionalFloat = input.ReadFloat();
- break;
- }
- case 97: {
- OptionalDouble = input.ReadDouble();
- break;
- }
- case 104: {
- OptionalBool = input.ReadBool();
- break;
- }
- case 114: {
- OptionalString = input.ReadString();
- break;
- }
- case 122: {
- OptionalBytes = input.ReadBytes();
- break;
- }
- case 131: {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder();
- if (HasOptionalGroup) {
- subBuilder.MergeFrom(OptionalGroup);
- }
- input.ReadGroup(16, subBuilder, extensionRegistry);
- OptionalGroup = subBuilder.BuildPartial();
- break;
- }
- case 146: {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder();
- if (HasOptionalNestedMessage) {
- subBuilder.MergeFrom(OptionalNestedMessage);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- OptionalNestedMessage = subBuilder.BuildPartial();
- break;
- }
- case 154: {
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder();
- if (HasOptionalForeignMessage) {
- subBuilder.MergeFrom(OptionalForeignMessage);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- OptionalForeignMessage = subBuilder.BuildPartial();
- break;
- }
- case 162: {
- global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder();
- if (HasOptionalImportMessage) {
- subBuilder.MergeFrom(OptionalImportMessage);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- OptionalImportMessage = subBuilder.BuildPartial();
- break;
- }
- case 168: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum), rawValue)) {
- unknownFields.MergeVarintField(21, (ulong) rawValue);
- } else {
- OptionalNestedEnum = (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum) rawValue;
- }
- break;
- }
- case 176: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ForeignEnum), rawValue)) {
- unknownFields.MergeVarintField(22, (ulong) rawValue);
- } else {
- OptionalForeignEnum = (global::Google.ProtocolBuffers.TestProtos.ForeignEnum) rawValue;
- }
- break;
- }
- case 184: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ImportEnum), rawValue)) {
- unknownFields.MergeVarintField(23, (ulong) rawValue);
- } else {
- OptionalImportEnum = (global::Google.ProtocolBuffers.TestProtos.ImportEnum) rawValue;
- }
- break;
- }
- case 194: {
- OptionalStringPiece = input.ReadString();
- break;
- }
- case 202: {
- OptionalCord = input.ReadString();
- break;
- }
- case 248: {
- AddRepeatedInt32(input.ReadInt32());
- break;
- }
- case 256: {
- AddRepeatedInt64(input.ReadInt64());
- break;
- }
- case 264: {
- AddRepeatedUint32(input.ReadUInt32());
- break;
- }
- case 272: {
- AddRepeatedUint64(input.ReadUInt64());
- break;
- }
- case 280: {
- AddRepeatedSint32(input.ReadSInt32());
- break;
- }
- case 288: {
- AddRepeatedSint64(input.ReadSInt64());
- break;
- }
- case 301: {
- AddRepeatedFixed32(input.ReadFixed32());
- break;
- }
- case 305: {
- AddRepeatedFixed64(input.ReadFixed64());
- break;
- }
- case 317: {
- AddRepeatedSfixed32(input.ReadSFixed32());
- break;
- }
- case 321: {
- AddRepeatedSfixed64(input.ReadSFixed64());
- break;
- }
- case 333: {
- AddRepeatedFloat(input.ReadFloat());
- break;
- }
- case 337: {
- AddRepeatedDouble(input.ReadDouble());
- break;
- }
- case 344: {
- AddRepeatedBool(input.ReadBool());
- break;
- }
- case 354: {
- AddRepeatedString(input.ReadString());
- break;
- }
- case 362: {
- AddRepeatedBytes(input.ReadBytes());
- break;
- }
- case 371: {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.CreateBuilder();
- input.ReadGroup(46, subBuilder, extensionRegistry);
- AddRepeatedGroup(subBuilder.BuildPartial());
- break;
- }
- case 386: {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddRepeatedNestedMessage(subBuilder.BuildPartial());
- break;
- }
- case 394: {
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddRepeatedForeignMessage(subBuilder.BuildPartial());
- break;
- }
- case 402: {
- global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddRepeatedImportMessage(subBuilder.BuildPartial());
- break;
- }
- case 408: {
- int rawValue = input.ReadEnum();
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value = (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum) rawValue;
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum), value)) {
- unknownFields.MergeVarintField(51, (ulong) rawValue);
- } else {
- AddRepeatedNestedEnum(value);
- }
- break;
- }
- case 416: {
- int rawValue = input.ReadEnum();
- global::Google.ProtocolBuffers.TestProtos.ForeignEnum value = (global::Google.ProtocolBuffers.TestProtos.ForeignEnum) rawValue;
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ForeignEnum), value)) {
- unknownFields.MergeVarintField(52, (ulong) rawValue);
- } else {
- AddRepeatedForeignEnum(value);
- }
- break;
- }
- case 424: {
- int rawValue = input.ReadEnum();
- global::Google.ProtocolBuffers.TestProtos.ImportEnum value = (global::Google.ProtocolBuffers.TestProtos.ImportEnum) rawValue;
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ImportEnum), value)) {
- unknownFields.MergeVarintField(53, (ulong) rawValue);
- } else {
- AddRepeatedImportEnum(value);
- }
- break;
- }
- case 434: {
- AddRepeatedStringPiece(input.ReadString());
- break;
- }
- case 442: {
- AddRepeatedCord(input.ReadString());
- break;
- }
- case 488: {
- DefaultInt32 = input.ReadInt32();
- break;
- }
- case 496: {
- DefaultInt64 = input.ReadInt64();
- break;
- }
- case 504: {
- DefaultUint32 = input.ReadUInt32();
- break;
- }
- case 512: {
- DefaultUint64 = input.ReadUInt64();
- break;
- }
- case 520: {
- DefaultSint32 = input.ReadSInt32();
- break;
- }
- case 528: {
- DefaultSint64 = input.ReadSInt64();
- break;
- }
- case 541: {
- DefaultFixed32 = input.ReadFixed32();
- break;
- }
- case 545: {
- DefaultFixed64 = input.ReadFixed64();
- break;
- }
- case 557: {
- DefaultSfixed32 = input.ReadSFixed32();
- break;
- }
- case 561: {
- DefaultSfixed64 = input.ReadSFixed64();
- break;
- }
- case 573: {
- DefaultFloat = input.ReadFloat();
- break;
- }
- case 577: {
- DefaultDouble = input.ReadDouble();
- break;
- }
- case 584: {
- DefaultBool = input.ReadBool();
- break;
- }
- case 594: {
- DefaultString = input.ReadString();
- break;
- }
- case 602: {
- DefaultBytes = input.ReadBytes();
- break;
- }
- case 648: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum), rawValue)) {
- unknownFields.MergeVarintField(81, (ulong) rawValue);
- } else {
- DefaultNestedEnum = (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum) rawValue;
- }
- break;
- }
- case 656: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ForeignEnum), rawValue)) {
- unknownFields.MergeVarintField(82, (ulong) rawValue);
- } else {
- DefaultForeignEnum = (global::Google.ProtocolBuffers.TestProtos.ForeignEnum) rawValue;
- }
- break;
- }
- case 664: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ImportEnum), rawValue)) {
- unknownFields.MergeVarintField(83, (ulong) rawValue);
- } else {
- DefaultImportEnum = (global::Google.ProtocolBuffers.TestProtos.ImportEnum) rawValue;
- }
- break;
- }
- case 674: {
- DefaultStringPiece = input.ReadString();
- break;
- }
- case 682: {
- DefaultCord = input.ReadString();
- break;
- }
- }
- }
- }
-
-
- // optional int32 optional_int32 = 1;
- public bool HasOptionalInt32 {
- get { return result.HasOptionalInt32; }
- }
- public int OptionalInt32 {
- get { return result.OptionalInt32; }
- set { SetOptionalInt32(value); }
- }
- public Builder SetOptionalInt32(int value) {
- result.hasOptionalInt32 = true;
- result.optionalInt32_ = value;
- return this;
- }
- public Builder ClearOptionalInt32() {
- result.hasOptionalInt32 = false;
- result.optionalInt32_ = 0;
- return this;
- }
-
- // optional int64 optional_int64 = 2;
- public bool HasOptionalInt64 {
- get { return result.HasOptionalInt64; }
- }
- public long OptionalInt64 {
- get { return result.OptionalInt64; }
- set { SetOptionalInt64(value); }
- }
- public Builder SetOptionalInt64(long value) {
- result.hasOptionalInt64 = true;
- result.optionalInt64_ = value;
- return this;
- }
- public Builder ClearOptionalInt64() {
- result.hasOptionalInt64 = false;
- result.optionalInt64_ = 0L;
- return this;
- }
-
- // optional uint32 optional_uint32 = 3;
- public bool HasOptionalUint32 {
- get { return result.HasOptionalUint32; }
- }
- public uint OptionalUint32 {
- get { return result.OptionalUint32; }
- set { SetOptionalUint32(value); }
- }
- public Builder SetOptionalUint32(uint value) {
- result.hasOptionalUint32 = true;
- result.optionalUint32_ = value;
- return this;
- }
- public Builder ClearOptionalUint32() {
- result.hasOptionalUint32 = false;
- result.optionalUint32_ = 0;
- return this;
- }
-
- // optional uint64 optional_uint64 = 4;
- public bool HasOptionalUint64 {
- get { return result.HasOptionalUint64; }
- }
- public ulong OptionalUint64 {
- get { return result.OptionalUint64; }
- set { SetOptionalUint64(value); }
- }
- public Builder SetOptionalUint64(ulong value) {
- result.hasOptionalUint64 = true;
- result.optionalUint64_ = value;
- return this;
- }
- public Builder ClearOptionalUint64() {
- result.hasOptionalUint64 = false;
- result.optionalUint64_ = 0UL;
- return this;
- }
-
- // optional sint32 optional_sint32 = 5;
- public bool HasOptionalSint32 {
- get { return result.HasOptionalSint32; }
- }
- public int OptionalSint32 {
- get { return result.OptionalSint32; }
- set { SetOptionalSint32(value); }
- }
- public Builder SetOptionalSint32(int value) {
- result.hasOptionalSint32 = true;
- result.optionalSint32_ = value;
- return this;
- }
- public Builder ClearOptionalSint32() {
- result.hasOptionalSint32 = false;
- result.optionalSint32_ = 0;
- return this;
- }
-
- // optional sint64 optional_sint64 = 6;
- public bool HasOptionalSint64 {
- get { return result.HasOptionalSint64; }
- }
- public long OptionalSint64 {
- get { return result.OptionalSint64; }
- set { SetOptionalSint64(value); }
- }
- public Builder SetOptionalSint64(long value) {
- result.hasOptionalSint64 = true;
- result.optionalSint64_ = value;
- return this;
- }
- public Builder ClearOptionalSint64() {
- result.hasOptionalSint64 = false;
- result.optionalSint64_ = 0L;
- return this;
- }
-
- // optional fixed32 optional_fixed32 = 7;
- public bool HasOptionalFixed32 {
- get { return result.HasOptionalFixed32; }
- }
- public uint OptionalFixed32 {
- get { return result.OptionalFixed32; }
- set { SetOptionalFixed32(value); }
- }
- public Builder SetOptionalFixed32(uint value) {
- result.hasOptionalFixed32 = true;
- result.optionalFixed32_ = value;
- return this;
- }
- public Builder ClearOptionalFixed32() {
- result.hasOptionalFixed32 = false;
- result.optionalFixed32_ = 0;
- return this;
- }
-
- // optional fixed64 optional_fixed64 = 8;
- public bool HasOptionalFixed64 {
- get { return result.HasOptionalFixed64; }
- }
- public ulong OptionalFixed64 {
- get { return result.OptionalFixed64; }
- set { SetOptionalFixed64(value); }
- }
- public Builder SetOptionalFixed64(ulong value) {
- result.hasOptionalFixed64 = true;
- result.optionalFixed64_ = value;
- return this;
- }
- public Builder ClearOptionalFixed64() {
- result.hasOptionalFixed64 = false;
- result.optionalFixed64_ = 0UL;
- return this;
- }
-
- // optional sfixed32 optional_sfixed32 = 9;
- public bool HasOptionalSfixed32 {
- get { return result.HasOptionalSfixed32; }
- }
- public int OptionalSfixed32 {
- get { return result.OptionalSfixed32; }
- set { SetOptionalSfixed32(value); }
- }
- public Builder SetOptionalSfixed32(int value) {
- result.hasOptionalSfixed32 = true;
- result.optionalSfixed32_ = value;
- return this;
- }
- public Builder ClearOptionalSfixed32() {
- result.hasOptionalSfixed32 = false;
- result.optionalSfixed32_ = 0;
- return this;
- }
-
- // optional sfixed64 optional_sfixed64 = 10;
- public bool HasOptionalSfixed64 {
- get { return result.HasOptionalSfixed64; }
- }
- public long OptionalSfixed64 {
- get { return result.OptionalSfixed64; }
- set { SetOptionalSfixed64(value); }
- }
- public Builder SetOptionalSfixed64(long value) {
- result.hasOptionalSfixed64 = true;
- result.optionalSfixed64_ = value;
- return this;
- }
- public Builder ClearOptionalSfixed64() {
- result.hasOptionalSfixed64 = false;
- result.optionalSfixed64_ = 0L;
- return this;
- }
-
- // optional float optional_float = 11;
- public bool HasOptionalFloat {
- get { return result.HasOptionalFloat; }
- }
- public float OptionalFloat {
- get { return result.OptionalFloat; }
- set { SetOptionalFloat(value); }
- }
- public Builder SetOptionalFloat(float value) {
- result.hasOptionalFloat = true;
- result.optionalFloat_ = value;
- return this;
- }
- public Builder ClearOptionalFloat() {
- result.hasOptionalFloat = false;
- result.optionalFloat_ = 0F;
- return this;
- }
-
- // optional double optional_double = 12;
- public bool HasOptionalDouble {
- get { return result.HasOptionalDouble; }
- }
- public double OptionalDouble {
- get { return result.OptionalDouble; }
- set { SetOptionalDouble(value); }
- }
- public Builder SetOptionalDouble(double value) {
- result.hasOptionalDouble = true;
- result.optionalDouble_ = value;
- return this;
- }
- public Builder ClearOptionalDouble() {
- result.hasOptionalDouble = false;
- result.optionalDouble_ = 0D;
- return this;
- }
-
- // optional bool optional_bool = 13;
- public bool HasOptionalBool {
- get { return result.HasOptionalBool; }
- }
- public bool OptionalBool {
- get { return result.OptionalBool; }
- set { SetOptionalBool(value); }
- }
- public Builder SetOptionalBool(bool value) {
- result.hasOptionalBool = true;
- result.optionalBool_ = value;
- return this;
- }
- public Builder ClearOptionalBool() {
- result.hasOptionalBool = false;
- result.optionalBool_ = false;
- return this;
- }
-
- // optional string optional_string = 14;
- public bool HasOptionalString {
- get { return result.HasOptionalString; }
- }
- public string OptionalString {
- get { return result.OptionalString; }
- set { SetOptionalString(value); }
- }
- public Builder SetOptionalString(string value) {
- result.hasOptionalString = true;
- result.optionalString_ = value;
- return this;
- }
- public Builder ClearOptionalString() {
- result.hasOptionalString = false;
- result.optionalString_ = "";
- return this;
- }
-
- // optional bytes optional_bytes = 15;
- public bool HasOptionalBytes {
- get { return result.HasOptionalBytes; }
- }
- public pb::ByteString OptionalBytes {
- get { return result.OptionalBytes; }
- set { SetOptionalBytes(value); }
- }
- public Builder SetOptionalBytes(pb::ByteString value) {
- result.hasOptionalBytes = true;
- result.optionalBytes_ = value;
- return this;
- }
- public Builder ClearOptionalBytes() {
- result.hasOptionalBytes = false;
- result.optionalBytes_ = pb::ByteString.Empty;
- return this;
- }
-
- // optional group OptionalGroup = 16 {
- public bool HasOptionalGroup {
- get { return result.HasOptionalGroup; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup {
- get { return result.OptionalGroup; }
- set { SetOptionalGroup(value); }
- }
- public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) {
- result.hasOptionalGroup = true;
- result.optionalGroup_ = value;
- return this;
- }
- public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder builderForValue) {
- result.hasOptionalGroup = true;
- result.optionalGroup_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) {
- if (result.HasOptionalGroup &&
- result.optionalGroup_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) {
- result.optionalGroup_ =
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(result.optionalGroup_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalGroup_ = value;
- }
- result.hasOptionalGroup = true;
- return this;
- }
- public Builder ClearOptionalGroup() {
- result.hasOptionalGroup = false;
- result.optionalGroup_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance;
- return this;
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
- public bool HasOptionalNestedMessage {
- get { return result.HasOptionalNestedMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage {
- get { return result.OptionalNestedMessage; }
- set { SetOptionalNestedMessage(value); }
- }
- public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) {
- result.hasOptionalNestedMessage = true;
- result.optionalNestedMessage_ = value;
- return this;
- }
- public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
- result.hasOptionalNestedMessage = true;
- result.optionalNestedMessage_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) {
- if (result.HasOptionalNestedMessage &&
- result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) {
- result.optionalNestedMessage_ =
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalNestedMessage_ = value;
- }
- result.hasOptionalNestedMessage = true;
- return this;
- }
- public Builder ClearOptionalNestedMessage() {
- result.hasOptionalNestedMessage = false;
- result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance;
- return this;
- }
-
- // optional .protobuf_unittest.ForeignMessage optional_foreign_message = 19;
- public bool HasOptionalForeignMessage {
- get { return result.HasOptionalForeignMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage {
- get { return result.OptionalForeignMessage; }
- set { SetOptionalForeignMessage(value); }
- }
- public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.hasOptionalForeignMessage = true;
- result.optionalForeignMessage_ = value;
- return this;
- }
- public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.hasOptionalForeignMessage = true;
- result.optionalForeignMessage_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- if (result.HasOptionalForeignMessage &&
- result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) {
- result.optionalForeignMessage_ =
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalForeignMessage_ = value;
- }
- result.hasOptionalForeignMessage = true;
- return this;
- }
- public Builder ClearOptionalForeignMessage() {
- result.hasOptionalForeignMessage = false;
- result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
- return this;
- }
-
- // optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
- public bool HasOptionalImportMessage {
- get { return result.HasOptionalImportMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage {
- get { return result.OptionalImportMessage; }
- set { SetOptionalImportMessage(value); }
- }
- public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) {
- result.hasOptionalImportMessage = true;
- result.optionalImportMessage_ = value;
- return this;
- }
- public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) {
- result.hasOptionalImportMessage = true;
- result.optionalImportMessage_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) {
- if (result.HasOptionalImportMessage &&
- result.optionalImportMessage_ != global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) {
- result.optionalImportMessage_ =
- global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(result.optionalImportMessage_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalImportMessage_ = value;
- }
- result.hasOptionalImportMessage = true;
- return this;
- }
- public Builder ClearOptionalImportMessage() {
- result.hasOptionalImportMessage = false;
- result.optionalImportMessage_ = global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance;
- return this;
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
- public bool HasOptionalNestedEnum {
- get { return result.HasOptionalNestedEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum {
- get { return result.OptionalNestedEnum; }
- set { SetOptionalNestedEnum(value); }
- }
- public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) {
- result.hasOptionalNestedEnum = true;
- result.optionalNestedEnum_ = value;
- return this;
- }
- public Builder ClearOptionalNestedEnum() {
- result.hasOptionalNestedEnum = false;
- result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO;
- return this;
- }
-
- // optional .protobuf_unittest.ForeignEnum optional_foreign_enum = 22;
- public bool HasOptionalForeignEnum {
- get { return result.HasOptionalForeignEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum {
- get { return result.OptionalForeignEnum; }
- set { SetOptionalForeignEnum(value); }
- }
- public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- result.hasOptionalForeignEnum = true;
- result.optionalForeignEnum_ = value;
- return this;
- }
- public Builder ClearOptionalForeignEnum() {
- result.hasOptionalForeignEnum = false;
- result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO;
- return this;
- }
-
- // optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
- public bool HasOptionalImportEnum {
- get { return result.HasOptionalImportEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum {
- get { return result.OptionalImportEnum; }
- set { SetOptionalImportEnum(value); }
- }
- public Builder SetOptionalImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) {
- result.hasOptionalImportEnum = true;
- result.optionalImportEnum_ = value;
- return this;
- }
- public Builder ClearOptionalImportEnum() {
- result.hasOptionalImportEnum = false;
- result.optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO;
- return this;
- }
-
- // optional string optional_string_piece = 24 [ctype = STRING_PIECE];
- public bool HasOptionalStringPiece {
- get { return result.HasOptionalStringPiece; }
- }
- public string OptionalStringPiece {
- get { return result.OptionalStringPiece; }
- set { SetOptionalStringPiece(value); }
- }
- public Builder SetOptionalStringPiece(string value) {
- result.hasOptionalStringPiece = true;
- result.optionalStringPiece_ = value;
- return this;
- }
- public Builder ClearOptionalStringPiece() {
- result.hasOptionalStringPiece = false;
- result.optionalStringPiece_ = "";
- return this;
- }
-
- // optional string optional_cord = 25 [ctype = CORD];
- public bool HasOptionalCord {
- get { return result.HasOptionalCord; }
- }
- public string OptionalCord {
- get { return result.OptionalCord; }
- set { SetOptionalCord(value); }
- }
- public Builder SetOptionalCord(string value) {
- result.hasOptionalCord = true;
- result.optionalCord_ = value;
- return this;
- }
- public Builder ClearOptionalCord() {
- result.hasOptionalCord = false;
- result.optionalCord_ = "";
- return this;
- }
-
- // repeated int32 repeated_int32 = 31;
- public scg::IList<int> RepeatedInt32List {
- get { return result.repeatedInt32_; }
- }
- public int RepeatedInt32Count {
- get { return result.RepeatedInt32Count; }
- }
- public int GetRepeatedInt32(int index) {
- return result.GetRepeatedInt32(index);
- }
- public Builder SetRepeatedInt32(int index, int value) {
- result.repeatedInt32_[index] = value;
- return this;
- }
- public Builder AddRepeatedInt32(int value) {
- result.repeatedInt32_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedInt32_);
- return this;
- }
- public Builder ClearRepeatedInt32() {
- result.repeatedInt32_.Clear();
- return this;
- }
-
- // repeated int64 repeated_int64 = 32;
- public scg::IList<long> RepeatedInt64List {
- get { return result.repeatedInt64_; }
- }
- public int RepeatedInt64Count {
- get { return result.RepeatedInt64Count; }
- }
- public long GetRepeatedInt64(int index) {
- return result.GetRepeatedInt64(index);
- }
- public Builder SetRepeatedInt64(int index, long value) {
- result.repeatedInt64_[index] = value;
- return this;
- }
- public Builder AddRepeatedInt64(long value) {
- result.repeatedInt64_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedInt64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedInt64_);
- return this;
- }
- public Builder ClearRepeatedInt64() {
- result.repeatedInt64_.Clear();
- return this;
- }
-
- // repeated uint32 repeated_uint32 = 33;
- public scg::IList<uint> RepeatedUint32List {
- get { return result.repeatedUint32_; }
- }
- public int RepeatedUint32Count {
- get { return result.RepeatedUint32Count; }
- }
- public uint GetRepeatedUint32(int index) {
- return result.GetRepeatedUint32(index);
- }
- public Builder SetRepeatedUint32(int index, uint value) {
- result.repeatedUint32_[index] = value;
- return this;
- }
- public Builder AddRepeatedUint32(uint value) {
- result.repeatedUint32_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedUint32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.repeatedUint32_);
- return this;
- }
- public Builder ClearRepeatedUint32() {
- result.repeatedUint32_.Clear();
- return this;
- }
-
- // repeated uint64 repeated_uint64 = 34;
- public scg::IList<ulong> RepeatedUint64List {
- get { return result.repeatedUint64_; }
- }
- public int RepeatedUint64Count {
- get { return result.RepeatedUint64Count; }
- }
- public ulong GetRepeatedUint64(int index) {
- return result.GetRepeatedUint64(index);
- }
- public Builder SetRepeatedUint64(int index, ulong value) {
- result.repeatedUint64_[index] = value;
- return this;
- }
- public Builder AddRepeatedUint64(ulong value) {
- result.repeatedUint64_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.repeatedUint64_);
- return this;
- }
- public Builder ClearRepeatedUint64() {
- result.repeatedUint64_.Clear();
- return this;
- }
-
- // repeated sint32 repeated_sint32 = 35;
- public scg::IList<int> RepeatedSint32List {
- get { return result.repeatedSint32_; }
- }
- public int RepeatedSint32Count {
- get { return result.RepeatedSint32Count; }
- }
- public int GetRepeatedSint32(int index) {
- return result.GetRepeatedSint32(index);
- }
- public Builder SetRepeatedSint32(int index, int value) {
- result.repeatedSint32_[index] = value;
- return this;
- }
- public Builder AddRepeatedSint32(int value) {
- result.repeatedSint32_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedSint32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedSint32_);
- return this;
- }
- public Builder ClearRepeatedSint32() {
- result.repeatedSint32_.Clear();
- return this;
- }
-
- // repeated sint64 repeated_sint64 = 36;
- public scg::IList<long> RepeatedSint64List {
- get { return result.repeatedSint64_; }
- }
- public int RepeatedSint64Count {
- get { return result.RepeatedSint64Count; }
- }
- public long GetRepeatedSint64(int index) {
- return result.GetRepeatedSint64(index);
- }
- public Builder SetRepeatedSint64(int index, long value) {
- result.repeatedSint64_[index] = value;
- return this;
- }
- public Builder AddRepeatedSint64(long value) {
- result.repeatedSint64_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedSint64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedSint64_);
- return this;
- }
- public Builder ClearRepeatedSint64() {
- result.repeatedSint64_.Clear();
- return this;
- }
-
- // repeated fixed32 repeated_fixed32 = 37;
- public scg::IList<uint> RepeatedFixed32List {
- get { return result.repeatedFixed32_; }
- }
- public int RepeatedFixed32Count {
- get { return result.RepeatedFixed32Count; }
- }
- public uint GetRepeatedFixed32(int index) {
- return result.GetRepeatedFixed32(index);
- }
- public Builder SetRepeatedFixed32(int index, uint value) {
- result.repeatedFixed32_[index] = value;
- return this;
- }
- public Builder AddRepeatedFixed32(uint value) {
- result.repeatedFixed32_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.repeatedFixed32_);
- return this;
- }
- public Builder ClearRepeatedFixed32() {
- result.repeatedFixed32_.Clear();
- return this;
- }
-
- // repeated fixed64 repeated_fixed64 = 38;
- public scg::IList<ulong> RepeatedFixed64List {
- get { return result.repeatedFixed64_; }
- }
- public int RepeatedFixed64Count {
- get { return result.RepeatedFixed64Count; }
- }
- public ulong GetRepeatedFixed64(int index) {
- return result.GetRepeatedFixed64(index);
- }
- public Builder SetRepeatedFixed64(int index, ulong value) {
- result.repeatedFixed64_[index] = value;
- return this;
- }
- public Builder AddRepeatedFixed64(ulong value) {
- result.repeatedFixed64_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.repeatedFixed64_);
- return this;
- }
- public Builder ClearRepeatedFixed64() {
- result.repeatedFixed64_.Clear();
- return this;
- }
-
- // repeated sfixed32 repeated_sfixed32 = 39;
- public scg::IList<int> RepeatedSfixed32List {
- get { return result.repeatedSfixed32_; }
- }
- public int RepeatedSfixed32Count {
- get { return result.RepeatedSfixed32Count; }
- }
- public int GetRepeatedSfixed32(int index) {
- return result.GetRepeatedSfixed32(index);
- }
- public Builder SetRepeatedSfixed32(int index, int value) {
- result.repeatedSfixed32_[index] = value;
- return this;
- }
- public Builder AddRepeatedSfixed32(int value) {
- result.repeatedSfixed32_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedSfixed32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedSfixed32_);
- return this;
- }
- public Builder ClearRepeatedSfixed32() {
- result.repeatedSfixed32_.Clear();
- return this;
- }
-
- // repeated sfixed64 repeated_sfixed64 = 40;
- public scg::IList<long> RepeatedSfixed64List {
- get { return result.repeatedSfixed64_; }
- }
- public int RepeatedSfixed64Count {
- get { return result.RepeatedSfixed64Count; }
- }
- public long GetRepeatedSfixed64(int index) {
- return result.GetRepeatedSfixed64(index);
- }
- public Builder SetRepeatedSfixed64(int index, long value) {
- result.repeatedSfixed64_[index] = value;
- return this;
- }
- public Builder AddRepeatedSfixed64(long value) {
- result.repeatedSfixed64_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedSfixed64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedSfixed64_);
- return this;
- }
- public Builder ClearRepeatedSfixed64() {
- result.repeatedSfixed64_.Clear();
- return this;
- }
-
- // repeated float repeated_float = 41;
- public scg::IList<float> RepeatedFloatList {
- get { return result.repeatedFloat_; }
- }
- public int RepeatedFloatCount {
- get { return result.RepeatedFloatCount; }
- }
- public float GetRepeatedFloat(int index) {
- return result.GetRepeatedFloat(index);
- }
- public Builder SetRepeatedFloat(int index, float value) {
- result.repeatedFloat_[index] = value;
- return this;
- }
- public Builder AddRepeatedFloat(float value) {
- result.repeatedFloat_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedFloat(scg::IEnumerable<float> values) {
- base.AddRange(values, result.repeatedFloat_);
- return this;
- }
- public Builder ClearRepeatedFloat() {
- result.repeatedFloat_.Clear();
- return this;
- }
-
- // repeated double repeated_double = 42;
- public scg::IList<double> RepeatedDoubleList {
- get { return result.repeatedDouble_; }
- }
- public int RepeatedDoubleCount {
- get { return result.RepeatedDoubleCount; }
- }
- public double GetRepeatedDouble(int index) {
- return result.GetRepeatedDouble(index);
- }
- public Builder SetRepeatedDouble(int index, double value) {
- result.repeatedDouble_[index] = value;
- return this;
- }
- public Builder AddRepeatedDouble(double value) {
- result.repeatedDouble_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedDouble(scg::IEnumerable<double> values) {
- base.AddRange(values, result.repeatedDouble_);
- return this;
- }
- public Builder ClearRepeatedDouble() {
- result.repeatedDouble_.Clear();
- return this;
- }
-
- // repeated bool repeated_bool = 43;
- public scg::IList<bool> RepeatedBoolList {
- get { return result.repeatedBool_; }
- }
- public int RepeatedBoolCount {
- get { return result.RepeatedBoolCount; }
- }
- public bool GetRepeatedBool(int index) {
- return result.GetRepeatedBool(index);
- }
- public Builder SetRepeatedBool(int index, bool value) {
- result.repeatedBool_[index] = value;
- return this;
- }
- public Builder AddRepeatedBool(bool value) {
- result.repeatedBool_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedBool(scg::IEnumerable<bool> values) {
- base.AddRange(values, result.repeatedBool_);
- return this;
- }
- public Builder ClearRepeatedBool() {
- result.repeatedBool_.Clear();
- return this;
- }
-
- // repeated string repeated_string = 44;
- public scg::IList<string> RepeatedStringList {
- get { return result.repeatedString_; }
- }
- public int RepeatedStringCount {
- get { return result.RepeatedStringCount; }
- }
- public string GetRepeatedString(int index) {
- return result.GetRepeatedString(index);
- }
- public Builder SetRepeatedString(int index, string value) {
- result.repeatedString_[index] = value;
- return this;
- }
- public Builder AddRepeatedString(string value) {
- result.repeatedString_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedString(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedString_);
- return this;
- }
- public Builder ClearRepeatedString() {
- result.repeatedString_.Clear();
- return this;
- }
-
- // repeated bytes repeated_bytes = 45;
- public scg::IList<pb::ByteString> RepeatedBytesList {
- get { return result.repeatedBytes_; }
- }
- public int RepeatedBytesCount {
- get { return result.RepeatedBytesCount; }
- }
- public pb::ByteString GetRepeatedBytes(int index) {
- return result.GetRepeatedBytes(index);
- }
- public Builder SetRepeatedBytes(int index, pb::ByteString value) {
- result.repeatedBytes_[index] = value;
- return this;
- }
- public Builder AddRepeatedBytes(pb::ByteString value) {
- result.repeatedBytes_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedBytes(scg::IEnumerable<pb::ByteString> values) {
- base.AddRange(values, result.repeatedBytes_);
- return this;
- }
- public Builder ClearRepeatedBytes() {
- result.repeatedBytes_.Clear();
- return this;
- }
-
- // repeated group RepeatedGroup = 46 {
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup> RepeatedGroupList {
- get { return result.repeatedGroup_; }
- }
- public int RepeatedGroupCount {
- get { return result.RepeatedGroupCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) {
- return result.GetRepeatedGroup(index);
- }
- public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) {
- result.repeatedGroup_[index] = value;
- return this;
- }
- public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) {
- result.repeatedGroup_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) {
- result.repeatedGroup_.Add(value);
- return this;
- }
- public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) {
- result.repeatedGroup_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedGroup(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup> values) {
- base.AddRange(values, result.repeatedGroup_);
- return this;
- }
- public Builder ClearRepeatedGroup() {
- result.repeatedGroup_.Clear();
- return this;
- }
-
- // repeated .protobuf_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage> RepeatedNestedMessageList {
- get { return result.repeatedNestedMessage_; }
- }
- public int RepeatedNestedMessageCount {
- get { return result.RepeatedNestedMessageCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) {
- return result.GetRepeatedNestedMessage(index);
- }
- public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) {
- result.repeatedNestedMessage_[index] = value;
- return this;
- }
- public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
- result.repeatedNestedMessage_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) {
- result.repeatedNestedMessage_.Add(value);
- return this;
- }
- public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
- result.repeatedNestedMessage_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage> values) {
- base.AddRange(values, result.repeatedNestedMessage_);
- return this;
- }
- public Builder ClearRepeatedNestedMessage() {
- result.repeatedNestedMessage_.Clear();
- return this;
- }
-
- // repeated .protobuf_unittest.ForeignMessage repeated_foreign_message = 49;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> RepeatedForeignMessageList {
- get { return result.repeatedForeignMessage_; }
- }
- public int RepeatedForeignMessageCount {
- get { return result.RepeatedForeignMessageCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) {
- return result.GetRepeatedForeignMessage(index);
- }
- public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.repeatedForeignMessage_[index] = value;
- return this;
- }
- public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.repeatedForeignMessage_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.repeatedForeignMessage_.Add(value);
- return this;
- }
- public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.repeatedForeignMessage_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> values) {
- base.AddRange(values, result.repeatedForeignMessage_);
- return this;
- }
- public Builder ClearRepeatedForeignMessage() {
- result.repeatedForeignMessage_.Clear();
- return this;
- }
-
- // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ImportMessage> RepeatedImportMessageList {
- get { return result.repeatedImportMessage_; }
- }
- public int RepeatedImportMessageCount {
- get { return result.RepeatedImportMessageCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) {
- return result.GetRepeatedImportMessage(index);
- }
- public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage value) {
- result.repeatedImportMessage_[index] = value;
- return this;
- }
- public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) {
- result.repeatedImportMessage_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) {
- result.repeatedImportMessage_.Add(value);
- return this;
- }
- public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) {
- result.repeatedImportMessage_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedImportMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ImportMessage> values) {
- base.AddRange(values, result.repeatedImportMessage_);
- return this;
- }
- public Builder ClearRepeatedImportMessage() {
- result.repeatedImportMessage_.Clear();
- return this;
- }
-
- // repeated .protobuf_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> RepeatedNestedEnumList {
- get { return pbc::Lists.AsReadOnly(result.repeatedNestedEnum_); }
- }
- public int RepeatedNestedEnumCount {
- get { return result.RepeatedNestedEnumCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) {
- return result.GetRepeatedNestedEnum(index);
- }
- public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) {
- result.repeatedNestedEnum_[index] = value;
- return this;
- }
- public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) {
- if (result.repeatedNestedEnum_.Count == 0) {
- result.repeatedNestedEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>();
- }
- result.repeatedNestedEnum_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> values) {
- if (result.repeatedNestedEnum_.Count == 0) {
- result.repeatedNestedEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>();
- }
- base.AddRange(values, result.repeatedNestedEnum_);
- return this;
- }
- public Builder ClearRepeatedNestedEnum() {
- result.repeatedNestedEnum_ = pbc::Lists<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum>.Empty;
- return this;
- }
-
- // repeated .protobuf_unittest.ForeignEnum repeated_foreign_enum = 52;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> RepeatedForeignEnumList {
- get { return pbc::Lists.AsReadOnly(result.repeatedForeignEnum_); }
- }
- public int RepeatedForeignEnumCount {
- get { return result.RepeatedForeignEnumCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) {
- return result.GetRepeatedForeignEnum(index);
- }
- public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- result.repeatedForeignEnum_[index] = value;
- return this;
- }
- public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- if (result.repeatedForeignEnum_.Count == 0) {
- result.repeatedForeignEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>();
- }
- result.repeatedForeignEnum_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> values) {
- if (result.repeatedForeignEnum_.Count == 0) {
- result.repeatedForeignEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>();
- }
- base.AddRange(values, result.repeatedForeignEnum_);
- return this;
- }
- public Builder ClearRepeatedForeignEnum() {
- result.repeatedForeignEnum_ = pbc::Lists<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>.Empty;
- return this;
- }
-
- // repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ImportEnum> RepeatedImportEnumList {
- get { return pbc::Lists.AsReadOnly(result.repeatedImportEnum_); }
- }
- public int RepeatedImportEnumCount {
- get { return result.RepeatedImportEnumCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) {
- return result.GetRepeatedImportEnum(index);
- }
- public Builder SetRepeatedImportEnum(int index, global::Google.ProtocolBuffers.TestProtos.ImportEnum value) {
- result.repeatedImportEnum_[index] = value;
- return this;
- }
- public Builder AddRepeatedImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) {
- if (result.repeatedImportEnum_.Count == 0) {
- result.repeatedImportEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ImportEnum>();
- }
- result.repeatedImportEnum_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedImportEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ImportEnum> values) {
- if (result.repeatedImportEnum_.Count == 0) {
- result.repeatedImportEnum_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ImportEnum>();
- }
- base.AddRange(values, result.repeatedImportEnum_);
- return this;
- }
- public Builder ClearRepeatedImportEnum() {
- result.repeatedImportEnum_ = pbc::Lists<global::Google.ProtocolBuffers.TestProtos.ImportEnum>.Empty;
- return this;
- }
-
- // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
- public scg::IList<string> RepeatedStringPieceList {
- get { return result.repeatedStringPiece_; }
- }
- public int RepeatedStringPieceCount {
- get { return result.RepeatedStringPieceCount; }
- }
- public string GetRepeatedStringPiece(int index) {
- return result.GetRepeatedStringPiece(index);
- }
- public Builder SetRepeatedStringPiece(int index, string value) {
- result.repeatedStringPiece_[index] = value;
- return this;
- }
- public Builder AddRepeatedStringPiece(string value) {
- result.repeatedStringPiece_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedStringPiece(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedStringPiece_);
- return this;
- }
- public Builder ClearRepeatedStringPiece() {
- result.repeatedStringPiece_.Clear();
- return this;
- }
-
- // repeated string repeated_cord = 55 [ctype = CORD];
- public scg::IList<string> RepeatedCordList {
- get { return result.repeatedCord_; }
- }
- public int RepeatedCordCount {
- get { return result.RepeatedCordCount; }
- }
- public string GetRepeatedCord(int index) {
- return result.GetRepeatedCord(index);
- }
- public Builder SetRepeatedCord(int index, string value) {
- result.repeatedCord_[index] = value;
- return this;
- }
- public Builder AddRepeatedCord(string value) {
- result.repeatedCord_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedCord(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedCord_);
- return this;
- }
- public Builder ClearRepeatedCord() {
- result.repeatedCord_.Clear();
- return this;
- }
-
- // optional int32 default_int32 = 61 [default = 41];
- public bool HasDefaultInt32 {
- get { return result.HasDefaultInt32; }
- }
- public int DefaultInt32 {
- get { return result.DefaultInt32; }
- set { SetDefaultInt32(value); }
- }
- public Builder SetDefaultInt32(int value) {
- result.hasDefaultInt32 = true;
- result.defaultInt32_ = value;
- return this;
- }
- public Builder ClearDefaultInt32() {
- result.hasDefaultInt32 = false;
- result.defaultInt32_ = 41;
- return this;
- }
-
- // optional int64 default_int64 = 62 [default = 42];
- public bool HasDefaultInt64 {
- get { return result.HasDefaultInt64; }
- }
- public long DefaultInt64 {
- get { return result.DefaultInt64; }
- set { SetDefaultInt64(value); }
- }
- public Builder SetDefaultInt64(long value) {
- result.hasDefaultInt64 = true;
- result.defaultInt64_ = value;
- return this;
- }
- public Builder ClearDefaultInt64() {
- result.hasDefaultInt64 = false;
- result.defaultInt64_ = 42L;
- return this;
- }
-
- // optional uint32 default_uint32 = 63 [default = 43];
- public bool HasDefaultUint32 {
- get { return result.HasDefaultUint32; }
- }
- public uint DefaultUint32 {
- get { return result.DefaultUint32; }
- set { SetDefaultUint32(value); }
- }
- public Builder SetDefaultUint32(uint value) {
- result.hasDefaultUint32 = true;
- result.defaultUint32_ = value;
- return this;
- }
- public Builder ClearDefaultUint32() {
- result.hasDefaultUint32 = false;
- result.defaultUint32_ = 43;
- return this;
- }
-
- // optional uint64 default_uint64 = 64 [default = 44];
- public bool HasDefaultUint64 {
- get { return result.HasDefaultUint64; }
- }
- public ulong DefaultUint64 {
- get { return result.DefaultUint64; }
- set { SetDefaultUint64(value); }
- }
- public Builder SetDefaultUint64(ulong value) {
- result.hasDefaultUint64 = true;
- result.defaultUint64_ = value;
- return this;
- }
- public Builder ClearDefaultUint64() {
- result.hasDefaultUint64 = false;
- result.defaultUint64_ = 44UL;
- return this;
- }
-
- // optional sint32 default_sint32 = 65 [default = -45];
- public bool HasDefaultSint32 {
- get { return result.HasDefaultSint32; }
- }
- public int DefaultSint32 {
- get { return result.DefaultSint32; }
- set { SetDefaultSint32(value); }
- }
- public Builder SetDefaultSint32(int value) {
- result.hasDefaultSint32 = true;
- result.defaultSint32_ = value;
- return this;
- }
- public Builder ClearDefaultSint32() {
- result.hasDefaultSint32 = false;
- result.defaultSint32_ = -45;
- return this;
- }
-
- // optional sint64 default_sint64 = 66 [default = 46];
- public bool HasDefaultSint64 {
- get { return result.HasDefaultSint64; }
- }
- public long DefaultSint64 {
- get { return result.DefaultSint64; }
- set { SetDefaultSint64(value); }
- }
- public Builder SetDefaultSint64(long value) {
- result.hasDefaultSint64 = true;
- result.defaultSint64_ = value;
- return this;
- }
- public Builder ClearDefaultSint64() {
- result.hasDefaultSint64 = false;
- result.defaultSint64_ = 46L;
- return this;
- }
-
- // optional fixed32 default_fixed32 = 67 [default = 47];
- public bool HasDefaultFixed32 {
- get { return result.HasDefaultFixed32; }
- }
- public uint DefaultFixed32 {
- get { return result.DefaultFixed32; }
- set { SetDefaultFixed32(value); }
- }
- public Builder SetDefaultFixed32(uint value) {
- result.hasDefaultFixed32 = true;
- result.defaultFixed32_ = value;
- return this;
- }
- public Builder ClearDefaultFixed32() {
- result.hasDefaultFixed32 = false;
- result.defaultFixed32_ = 47;
- return this;
- }
-
- // optional fixed64 default_fixed64 = 68 [default = 48];
- public bool HasDefaultFixed64 {
- get { return result.HasDefaultFixed64; }
- }
- public ulong DefaultFixed64 {
- get { return result.DefaultFixed64; }
- set { SetDefaultFixed64(value); }
- }
- public Builder SetDefaultFixed64(ulong value) {
- result.hasDefaultFixed64 = true;
- result.defaultFixed64_ = value;
- return this;
- }
- public Builder ClearDefaultFixed64() {
- result.hasDefaultFixed64 = false;
- result.defaultFixed64_ = 48UL;
- return this;
- }
-
- // optional sfixed32 default_sfixed32 = 69 [default = 49];
- public bool HasDefaultSfixed32 {
- get { return result.HasDefaultSfixed32; }
- }
- public int DefaultSfixed32 {
- get { return result.DefaultSfixed32; }
- set { SetDefaultSfixed32(value); }
- }
- public Builder SetDefaultSfixed32(int value) {
- result.hasDefaultSfixed32 = true;
- result.defaultSfixed32_ = value;
- return this;
- }
- public Builder ClearDefaultSfixed32() {
- result.hasDefaultSfixed32 = false;
- result.defaultSfixed32_ = 49;
- return this;
- }
-
- // optional sfixed64 default_sfixed64 = 70 [default = -50];
- public bool HasDefaultSfixed64 {
- get { return result.HasDefaultSfixed64; }
- }
- public long DefaultSfixed64 {
- get { return result.DefaultSfixed64; }
- set { SetDefaultSfixed64(value); }
- }
- public Builder SetDefaultSfixed64(long value) {
- result.hasDefaultSfixed64 = true;
- result.defaultSfixed64_ = value;
- return this;
- }
- public Builder ClearDefaultSfixed64() {
- result.hasDefaultSfixed64 = false;
- result.defaultSfixed64_ = -50L;
- return this;
- }
-
- // optional float default_float = 71 [default = 51.5];
- public bool HasDefaultFloat {
- get { return result.HasDefaultFloat; }
- }
- public float DefaultFloat {
- get { return result.DefaultFloat; }
- set { SetDefaultFloat(value); }
- }
- public Builder SetDefaultFloat(float value) {
- result.hasDefaultFloat = true;
- result.defaultFloat_ = value;
- return this;
- }
- public Builder ClearDefaultFloat() {
- result.hasDefaultFloat = false;
- result.defaultFloat_ = 51.5F;
- return this;
- }
-
- // optional double default_double = 72 [default = 52000];
- public bool HasDefaultDouble {
- get { return result.HasDefaultDouble; }
- }
- public double DefaultDouble {
- get { return result.DefaultDouble; }
- set { SetDefaultDouble(value); }
- }
- public Builder SetDefaultDouble(double value) {
- result.hasDefaultDouble = true;
- result.defaultDouble_ = value;
- return this;
- }
- public Builder ClearDefaultDouble() {
- result.hasDefaultDouble = false;
- result.defaultDouble_ = 52000D;
- return this;
- }
-
- // optional bool default_bool = 73 [default = true];
- public bool HasDefaultBool {
- get { return result.HasDefaultBool; }
- }
- public bool DefaultBool {
- get { return result.DefaultBool; }
- set { SetDefaultBool(value); }
- }
- public Builder SetDefaultBool(bool value) {
- result.hasDefaultBool = true;
- result.defaultBool_ = value;
- return this;
- }
- public Builder ClearDefaultBool() {
- result.hasDefaultBool = false;
- result.defaultBool_ = true;
- return this;
- }
-
- // optional string default_string = 74 [default = "hello"];
- public bool HasDefaultString {
- get { return result.HasDefaultString; }
- }
- public string DefaultString {
- get { return result.DefaultString; }
- set { SetDefaultString(value); }
- }
- public Builder SetDefaultString(string value) {
- result.hasDefaultString = true;
- result.defaultString_ = value;
- return this;
- }
- public Builder ClearDefaultString() {
- result.hasDefaultString = false;
- result.defaultString_ = "hello";
- return this;
- }
-
- // optional bytes default_bytes = 75 [default = "world"];
- public bool HasDefaultBytes {
- get { return result.HasDefaultBytes; }
- }
- public pb::ByteString DefaultBytes {
- get { return result.DefaultBytes; }
- set { SetDefaultBytes(value); }
- }
- public Builder SetDefaultBytes(pb::ByteString value) {
- result.hasDefaultBytes = true;
- result.defaultBytes_ = value;
- return this;
- }
- public Builder ClearDefaultBytes() {
- result.hasDefaultBytes = false;
- result.defaultBytes_ = ((pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue);
- return this;
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
- public bool HasDefaultNestedEnum {
- get { return result.HasDefaultNestedEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum {
- get { return result.DefaultNestedEnum; }
- set { SetDefaultNestedEnum(value); }
- }
- public Builder SetDefaultNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) {
- result.hasDefaultNestedEnum = true;
- result.defaultNestedEnum_ = value;
- return this;
- }
- public Builder ClearDefaultNestedEnum() {
- result.hasDefaultNestedEnum = false;
- result.defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR;
- return this;
- }
-
- // optional .protobuf_unittest.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
- public bool HasDefaultForeignEnum {
- get { return result.HasDefaultForeignEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum {
- get { return result.DefaultForeignEnum; }
- set { SetDefaultForeignEnum(value); }
- }
- public Builder SetDefaultForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- result.hasDefaultForeignEnum = true;
- result.defaultForeignEnum_ = value;
- return this;
- }
- public Builder ClearDefaultForeignEnum() {
- result.hasDefaultForeignEnum = false;
- result.defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR;
- return this;
- }
-
- // optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
- public bool HasDefaultImportEnum {
- get { return result.HasDefaultImportEnum; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum {
- get { return result.DefaultImportEnum; }
- set { SetDefaultImportEnum(value); }
- }
- public Builder SetDefaultImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) {
- result.hasDefaultImportEnum = true;
- result.defaultImportEnum_ = value;
- return this;
- }
- public Builder ClearDefaultImportEnum() {
- result.hasDefaultImportEnum = false;
- result.defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR;
- return this;
- }
-
- // optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
- public bool HasDefaultStringPiece {
- get { return result.HasDefaultStringPiece; }
- }
- public string DefaultStringPiece {
- get { return result.DefaultStringPiece; }
- set { SetDefaultStringPiece(value); }
- }
- public Builder SetDefaultStringPiece(string value) {
- result.hasDefaultStringPiece = true;
- result.defaultStringPiece_ = value;
- return this;
- }
- public Builder ClearDefaultStringPiece() {
- result.hasDefaultStringPiece = false;
- result.defaultStringPiece_ = "abc";
- return this;
- }
-
- // optional string default_cord = 85 [default = "123", ctype = CORD];
- public bool HasDefaultCord {
- get { return result.HasDefaultCord; }
- }
- public string DefaultCord {
- get { return result.DefaultCord; }
- set { SetDefaultCord(value); }
- }
- public Builder SetDefaultCord(string value) {
- result.hasDefaultCord = true;
- result.defaultCord_ = value;
- return this;
- }
- public Builder ClearDefaultCord() {
- result.hasDefaultCord = false;
- result.defaultCord_ = "123";
- return this;
- }
- }
- }
-
- public sealed partial class ForeignMessage : pb::GeneratedMessage<ForeignMessage, ForeignMessage.Builder> {
- private static readonly ForeignMessage defaultInstance = new Builder().BuildPartial();
- public static ForeignMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override ForeignMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override ForeignMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<ForeignMessage, ForeignMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; }
- }
-
- // optional int32 c = 1;
- private bool hasC;
- private int c_ = 0;
- public bool HasC {
- get { return hasC; }
- }
- public int C {
- get { return c_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasC) {
- output.WriteInt32(1, C);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasC) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, C);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.ForeignMessage ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.ForeignMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.ForeignMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage result = new global::Google.ProtocolBuffers.TestProtos.ForeignMessage();
-
- protected override global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.ForeignMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.ForeignMessage DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.ForeignMessage BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.ForeignMessage) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.ForeignMessage) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.ForeignMessage other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) return this;
- if (other.HasC) {
- C = other.C;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- C = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 c = 1;
- public bool HasC {
- get { return result.HasC; }
- }
- public int C {
- get { return result.C; }
- set { SetC(value); }
- }
- public Builder SetC(int value) {
- result.hasC = true;
- result.c_ = value;
- return this;
- }
- public Builder ClearC() {
- result.hasC = false;
- result.c_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestAllExtensions : pb::ExtendableMessage<TestAllExtensions, TestAllExtensions.Builder> {
- private static readonly TestAllExtensions defaultInstance = new Builder().BuildPartial();
- public static TestAllExtensions DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestAllExtensions DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestAllExtensions ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestAllExtensions, TestAllExtensions.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- if (!ExtensionsAreInitialized) return false;
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- pb::ExtendableMessage<TestAllExtensions, TestAllExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
- extensionWriter.WriteUntil(536870912, output);
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += ExtensionsSerializedSize;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestAllExtensions ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestAllExtensions prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::ExtendableBuilder<global::Google.ProtocolBuffers.TestProtos.TestAllExtensions, global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestAllExtensions result = new global::Google.ProtocolBuffers.TestProtos.TestAllExtensions();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestAllExtensions MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestAllExtensions();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllExtensions DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestAllExtensions BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestAllExtensions returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestAllExtensions) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestAllExtensions) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestAllExtensions other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class OptionalGroup_extension : pb::GeneratedMessage<OptionalGroup_extension, OptionalGroup_extension.Builder> {
- private static readonly OptionalGroup_extension defaultInstance = new Builder().BuildPartial();
- public static OptionalGroup_extension DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override OptionalGroup_extension DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override OptionalGroup_extension ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<OptionalGroup_extension, OptionalGroup_extension.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; }
- }
-
- // optional int32 a = 17;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(17, A);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(17, A);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension result = new global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension();
-
- protected override global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 136: {
- A = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 17;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class RepeatedGroup_extension : pb::GeneratedMessage<RepeatedGroup_extension, RepeatedGroup_extension.Builder> {
- private static readonly RepeatedGroup_extension defaultInstance = new Builder().BuildPartial();
- public static RepeatedGroup_extension DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override RepeatedGroup_extension DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override RepeatedGroup_extension ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<RepeatedGroup_extension, RepeatedGroup_extension.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; }
- }
-
- // optional int32 a = 47;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(47, A);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(47, A);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension result = new global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension();
-
- protected override global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 376: {
- A = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 47;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestRequired : pb::GeneratedMessage<TestRequired, TestRequired.Builder> {
- private static readonly TestRequired defaultInstance = new Builder().BuildPartial();
- public static TestRequired DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestRequired DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestRequired ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestRequired, TestRequired.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; }
- }
-
- public static readonly pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestRequired> Single =
- pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestRequired>.CreateInstance(Descriptor.Extensions[0]);
- public static readonly
- pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.TestRequired>> Multi =
- pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.TestRequired>.CreateInstance(Descriptor.Extensions[1]);
- #region Nested types
- public static class Types {
- }
- #endregion
-
- // required int32 a = 1;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- // optional int32 dummy2 = 2;
- private bool hasDummy2;
- private int dummy2_ = 0;
- public bool HasDummy2 {
- get { return hasDummy2; }
- }
- public int Dummy2 {
- get { return dummy2_; }
- }
-
- // required int32 b = 3;
- private bool hasB;
- private int b_ = 0;
- public bool HasB {
- get { return hasB; }
- }
- public int B {
- get { return b_; }
- }
-
- // optional int32 dummy4 = 4;
- private bool hasDummy4;
- private int dummy4_ = 0;
- public bool HasDummy4 {
- get { return hasDummy4; }
- }
- public int Dummy4 {
- get { return dummy4_; }
- }
-
- // optional int32 dummy5 = 5;
- private bool hasDummy5;
- private int dummy5_ = 0;
- public bool HasDummy5 {
- get { return hasDummy5; }
- }
- public int Dummy5 {
- get { return dummy5_; }
- }
-
- // optional int32 dummy6 = 6;
- private bool hasDummy6;
- private int dummy6_ = 0;
- public bool HasDummy6 {
- get { return hasDummy6; }
- }
- public int Dummy6 {
- get { return dummy6_; }
- }
-
- // optional int32 dummy7 = 7;
- private bool hasDummy7;
- private int dummy7_ = 0;
- public bool HasDummy7 {
- get { return hasDummy7; }
- }
- public int Dummy7 {
- get { return dummy7_; }
- }
-
- // optional int32 dummy8 = 8;
- private bool hasDummy8;
- private int dummy8_ = 0;
- public bool HasDummy8 {
- get { return hasDummy8; }
- }
- public int Dummy8 {
- get { return dummy8_; }
- }
-
- // optional int32 dummy9 = 9;
- private bool hasDummy9;
- private int dummy9_ = 0;
- public bool HasDummy9 {
- get { return hasDummy9; }
- }
- public int Dummy9 {
- get { return dummy9_; }
- }
-
- // optional int32 dummy10 = 10;
- private bool hasDummy10;
- private int dummy10_ = 0;
- public bool HasDummy10 {
- get { return hasDummy10; }
- }
- public int Dummy10 {
- get { return dummy10_; }
- }
-
- // optional int32 dummy11 = 11;
- private bool hasDummy11;
- private int dummy11_ = 0;
- public bool HasDummy11 {
- get { return hasDummy11; }
- }
- public int Dummy11 {
- get { return dummy11_; }
- }
-
- // optional int32 dummy12 = 12;
- private bool hasDummy12;
- private int dummy12_ = 0;
- public bool HasDummy12 {
- get { return hasDummy12; }
- }
- public int Dummy12 {
- get { return dummy12_; }
- }
-
- // optional int32 dummy13 = 13;
- private bool hasDummy13;
- private int dummy13_ = 0;
- public bool HasDummy13 {
- get { return hasDummy13; }
- }
- public int Dummy13 {
- get { return dummy13_; }
- }
-
- // optional int32 dummy14 = 14;
- private bool hasDummy14;
- private int dummy14_ = 0;
- public bool HasDummy14 {
- get { return hasDummy14; }
- }
- public int Dummy14 {
- get { return dummy14_; }
- }
-
- // optional int32 dummy15 = 15;
- private bool hasDummy15;
- private int dummy15_ = 0;
- public bool HasDummy15 {
- get { return hasDummy15; }
- }
- public int Dummy15 {
- get { return dummy15_; }
- }
-
- // optional int32 dummy16 = 16;
- private bool hasDummy16;
- private int dummy16_ = 0;
- public bool HasDummy16 {
- get { return hasDummy16; }
- }
- public int Dummy16 {
- get { return dummy16_; }
- }
-
- // optional int32 dummy17 = 17;
- private bool hasDummy17;
- private int dummy17_ = 0;
- public bool HasDummy17 {
- get { return hasDummy17; }
- }
- public int Dummy17 {
- get { return dummy17_; }
- }
-
- // optional int32 dummy18 = 18;
- private bool hasDummy18;
- private int dummy18_ = 0;
- public bool HasDummy18 {
- get { return hasDummy18; }
- }
- public int Dummy18 {
- get { return dummy18_; }
- }
-
- // optional int32 dummy19 = 19;
- private bool hasDummy19;
- private int dummy19_ = 0;
- public bool HasDummy19 {
- get { return hasDummy19; }
- }
- public int Dummy19 {
- get { return dummy19_; }
- }
-
- // optional int32 dummy20 = 20;
- private bool hasDummy20;
- private int dummy20_ = 0;
- public bool HasDummy20 {
- get { return hasDummy20; }
- }
- public int Dummy20 {
- get { return dummy20_; }
- }
-
- // optional int32 dummy21 = 21;
- private bool hasDummy21;
- private int dummy21_ = 0;
- public bool HasDummy21 {
- get { return hasDummy21; }
- }
- public int Dummy21 {
- get { return dummy21_; }
- }
-
- // optional int32 dummy22 = 22;
- private bool hasDummy22;
- private int dummy22_ = 0;
- public bool HasDummy22 {
- get { return hasDummy22; }
- }
- public int Dummy22 {
- get { return dummy22_; }
- }
-
- // optional int32 dummy23 = 23;
- private bool hasDummy23;
- private int dummy23_ = 0;
- public bool HasDummy23 {
- get { return hasDummy23; }
- }
- public int Dummy23 {
- get { return dummy23_; }
- }
-
- // optional int32 dummy24 = 24;
- private bool hasDummy24;
- private int dummy24_ = 0;
- public bool HasDummy24 {
- get { return hasDummy24; }
- }
- public int Dummy24 {
- get { return dummy24_; }
- }
-
- // optional int32 dummy25 = 25;
- private bool hasDummy25;
- private int dummy25_ = 0;
- public bool HasDummy25 {
- get { return hasDummy25; }
- }
- public int Dummy25 {
- get { return dummy25_; }
- }
-
- // optional int32 dummy26 = 26;
- private bool hasDummy26;
- private int dummy26_ = 0;
- public bool HasDummy26 {
- get { return hasDummy26; }
- }
- public int Dummy26 {
- get { return dummy26_; }
- }
-
- // optional int32 dummy27 = 27;
- private bool hasDummy27;
- private int dummy27_ = 0;
- public bool HasDummy27 {
- get { return hasDummy27; }
- }
- public int Dummy27 {
- get { return dummy27_; }
- }
-
- // optional int32 dummy28 = 28;
- private bool hasDummy28;
- private int dummy28_ = 0;
- public bool HasDummy28 {
- get { return hasDummy28; }
- }
- public int Dummy28 {
- get { return dummy28_; }
- }
-
- // optional int32 dummy29 = 29;
- private bool hasDummy29;
- private int dummy29_ = 0;
- public bool HasDummy29 {
- get { return hasDummy29; }
- }
- public int Dummy29 {
- get { return dummy29_; }
- }
-
- // optional int32 dummy30 = 30;
- private bool hasDummy30;
- private int dummy30_ = 0;
- public bool HasDummy30 {
- get { return hasDummy30; }
- }
- public int Dummy30 {
- get { return dummy30_; }
- }
-
- // optional int32 dummy31 = 31;
- private bool hasDummy31;
- private int dummy31_ = 0;
- public bool HasDummy31 {
- get { return hasDummy31; }
- }
- public int Dummy31 {
- get { return dummy31_; }
- }
-
- // optional int32 dummy32 = 32;
- private bool hasDummy32;
- private int dummy32_ = 0;
- public bool HasDummy32 {
- get { return hasDummy32; }
- }
- public int Dummy32 {
- get { return dummy32_; }
- }
-
- // required int32 c = 33;
- private bool hasC;
- private int c_ = 0;
- public bool HasC {
- get { return hasC; }
- }
- public int C {
- get { return c_; }
- }
-
- public override bool IsInitialized {
- get {
- if (!hasA) return false;
- if (!hasB) return false;
- if (!hasC) return false;
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(1, A);
- }
- if (HasDummy2) {
- output.WriteInt32(2, Dummy2);
- }
- if (HasB) {
- output.WriteInt32(3, B);
- }
- if (HasDummy4) {
- output.WriteInt32(4, Dummy4);
- }
- if (HasDummy5) {
- output.WriteInt32(5, Dummy5);
- }
- if (HasDummy6) {
- output.WriteInt32(6, Dummy6);
- }
- if (HasDummy7) {
- output.WriteInt32(7, Dummy7);
- }
- if (HasDummy8) {
- output.WriteInt32(8, Dummy8);
- }
- if (HasDummy9) {
- output.WriteInt32(9, Dummy9);
- }
- if (HasDummy10) {
- output.WriteInt32(10, Dummy10);
- }
- if (HasDummy11) {
- output.WriteInt32(11, Dummy11);
- }
- if (HasDummy12) {
- output.WriteInt32(12, Dummy12);
- }
- if (HasDummy13) {
- output.WriteInt32(13, Dummy13);
- }
- if (HasDummy14) {
- output.WriteInt32(14, Dummy14);
- }
- if (HasDummy15) {
- output.WriteInt32(15, Dummy15);
- }
- if (HasDummy16) {
- output.WriteInt32(16, Dummy16);
- }
- if (HasDummy17) {
- output.WriteInt32(17, Dummy17);
- }
- if (HasDummy18) {
- output.WriteInt32(18, Dummy18);
- }
- if (HasDummy19) {
- output.WriteInt32(19, Dummy19);
- }
- if (HasDummy20) {
- output.WriteInt32(20, Dummy20);
- }
- if (HasDummy21) {
- output.WriteInt32(21, Dummy21);
- }
- if (HasDummy22) {
- output.WriteInt32(22, Dummy22);
- }
- if (HasDummy23) {
- output.WriteInt32(23, Dummy23);
- }
- if (HasDummy24) {
- output.WriteInt32(24, Dummy24);
- }
- if (HasDummy25) {
- output.WriteInt32(25, Dummy25);
- }
- if (HasDummy26) {
- output.WriteInt32(26, Dummy26);
- }
- if (HasDummy27) {
- output.WriteInt32(27, Dummy27);
- }
- if (HasDummy28) {
- output.WriteInt32(28, Dummy28);
- }
- if (HasDummy29) {
- output.WriteInt32(29, Dummy29);
- }
- if (HasDummy30) {
- output.WriteInt32(30, Dummy30);
- }
- if (HasDummy31) {
- output.WriteInt32(31, Dummy31);
- }
- if (HasDummy32) {
- output.WriteInt32(32, Dummy32);
- }
- if (HasC) {
- output.WriteInt32(33, C);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, A);
- }
- if (HasDummy2) {
- size += pb::CodedOutputStream.ComputeInt32Size(2, Dummy2);
- }
- if (HasB) {
- size += pb::CodedOutputStream.ComputeInt32Size(3, B);
- }
- if (HasDummy4) {
- size += pb::CodedOutputStream.ComputeInt32Size(4, Dummy4);
- }
- if (HasDummy5) {
- size += pb::CodedOutputStream.ComputeInt32Size(5, Dummy5);
- }
- if (HasDummy6) {
- size += pb::CodedOutputStream.ComputeInt32Size(6, Dummy6);
- }
- if (HasDummy7) {
- size += pb::CodedOutputStream.ComputeInt32Size(7, Dummy7);
- }
- if (HasDummy8) {
- size += pb::CodedOutputStream.ComputeInt32Size(8, Dummy8);
- }
- if (HasDummy9) {
- size += pb::CodedOutputStream.ComputeInt32Size(9, Dummy9);
- }
- if (HasDummy10) {
- size += pb::CodedOutputStream.ComputeInt32Size(10, Dummy10);
- }
- if (HasDummy11) {
- size += pb::CodedOutputStream.ComputeInt32Size(11, Dummy11);
- }
- if (HasDummy12) {
- size += pb::CodedOutputStream.ComputeInt32Size(12, Dummy12);
- }
- if (HasDummy13) {
- size += pb::CodedOutputStream.ComputeInt32Size(13, Dummy13);
- }
- if (HasDummy14) {
- size += pb::CodedOutputStream.ComputeInt32Size(14, Dummy14);
- }
- if (HasDummy15) {
- size += pb::CodedOutputStream.ComputeInt32Size(15, Dummy15);
- }
- if (HasDummy16) {
- size += pb::CodedOutputStream.ComputeInt32Size(16, Dummy16);
- }
- if (HasDummy17) {
- size += pb::CodedOutputStream.ComputeInt32Size(17, Dummy17);
- }
- if (HasDummy18) {
- size += pb::CodedOutputStream.ComputeInt32Size(18, Dummy18);
- }
- if (HasDummy19) {
- size += pb::CodedOutputStream.ComputeInt32Size(19, Dummy19);
- }
- if (HasDummy20) {
- size += pb::CodedOutputStream.ComputeInt32Size(20, Dummy20);
- }
- if (HasDummy21) {
- size += pb::CodedOutputStream.ComputeInt32Size(21, Dummy21);
- }
- if (HasDummy22) {
- size += pb::CodedOutputStream.ComputeInt32Size(22, Dummy22);
- }
- if (HasDummy23) {
- size += pb::CodedOutputStream.ComputeInt32Size(23, Dummy23);
- }
- if (HasDummy24) {
- size += pb::CodedOutputStream.ComputeInt32Size(24, Dummy24);
- }
- if (HasDummy25) {
- size += pb::CodedOutputStream.ComputeInt32Size(25, Dummy25);
- }
- if (HasDummy26) {
- size += pb::CodedOutputStream.ComputeInt32Size(26, Dummy26);
- }
- if (HasDummy27) {
- size += pb::CodedOutputStream.ComputeInt32Size(27, Dummy27);
- }
- if (HasDummy28) {
- size += pb::CodedOutputStream.ComputeInt32Size(28, Dummy28);
- }
- if (HasDummy29) {
- size += pb::CodedOutputStream.ComputeInt32Size(29, Dummy29);
- }
- if (HasDummy30) {
- size += pb::CodedOutputStream.ComputeInt32Size(30, Dummy30);
- }
- if (HasDummy31) {
- size += pb::CodedOutputStream.ComputeInt32Size(31, Dummy31);
- }
- if (HasDummy32) {
- size += pb::CodedOutputStream.ComputeInt32Size(32, Dummy32);
- }
- if (HasC) {
- size += pb::CodedOutputStream.ComputeInt32Size(33, C);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequired ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestRequired prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestRequired, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestRequired result = new global::Google.ProtocolBuffers.TestProtos.TestRequired();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestRequired MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestRequired();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRequired DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRequired BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestRequired returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestRequired) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestRequired) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestRequired other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- if (other.HasDummy2) {
- Dummy2 = other.Dummy2;
- }
- if (other.HasB) {
- B = other.B;
- }
- if (other.HasDummy4) {
- Dummy4 = other.Dummy4;
- }
- if (other.HasDummy5) {
- Dummy5 = other.Dummy5;
- }
- if (other.HasDummy6) {
- Dummy6 = other.Dummy6;
- }
- if (other.HasDummy7) {
- Dummy7 = other.Dummy7;
- }
- if (other.HasDummy8) {
- Dummy8 = other.Dummy8;
- }
- if (other.HasDummy9) {
- Dummy9 = other.Dummy9;
- }
- if (other.HasDummy10) {
- Dummy10 = other.Dummy10;
- }
- if (other.HasDummy11) {
- Dummy11 = other.Dummy11;
- }
- if (other.HasDummy12) {
- Dummy12 = other.Dummy12;
- }
- if (other.HasDummy13) {
- Dummy13 = other.Dummy13;
- }
- if (other.HasDummy14) {
- Dummy14 = other.Dummy14;
- }
- if (other.HasDummy15) {
- Dummy15 = other.Dummy15;
- }
- if (other.HasDummy16) {
- Dummy16 = other.Dummy16;
- }
- if (other.HasDummy17) {
- Dummy17 = other.Dummy17;
- }
- if (other.HasDummy18) {
- Dummy18 = other.Dummy18;
- }
- if (other.HasDummy19) {
- Dummy19 = other.Dummy19;
- }
- if (other.HasDummy20) {
- Dummy20 = other.Dummy20;
- }
- if (other.HasDummy21) {
- Dummy21 = other.Dummy21;
- }
- if (other.HasDummy22) {
- Dummy22 = other.Dummy22;
- }
- if (other.HasDummy23) {
- Dummy23 = other.Dummy23;
- }
- if (other.HasDummy24) {
- Dummy24 = other.Dummy24;
- }
- if (other.HasDummy25) {
- Dummy25 = other.Dummy25;
- }
- if (other.HasDummy26) {
- Dummy26 = other.Dummy26;
- }
- if (other.HasDummy27) {
- Dummy27 = other.Dummy27;
- }
- if (other.HasDummy28) {
- Dummy28 = other.Dummy28;
- }
- if (other.HasDummy29) {
- Dummy29 = other.Dummy29;
- }
- if (other.HasDummy30) {
- Dummy30 = other.Dummy30;
- }
- if (other.HasDummy31) {
- Dummy31 = other.Dummy31;
- }
- if (other.HasDummy32) {
- Dummy32 = other.Dummy32;
- }
- if (other.HasC) {
- C = other.C;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- A = input.ReadInt32();
- break;
- }
- case 16: {
- Dummy2 = input.ReadInt32();
- break;
- }
- case 24: {
- B = input.ReadInt32();
- break;
- }
- case 32: {
- Dummy4 = input.ReadInt32();
- break;
- }
- case 40: {
- Dummy5 = input.ReadInt32();
- break;
- }
- case 48: {
- Dummy6 = input.ReadInt32();
- break;
- }
- case 56: {
- Dummy7 = input.ReadInt32();
- break;
- }
- case 64: {
- Dummy8 = input.ReadInt32();
- break;
- }
- case 72: {
- Dummy9 = input.ReadInt32();
- break;
- }
- case 80: {
- Dummy10 = input.ReadInt32();
- break;
- }
- case 88: {
- Dummy11 = input.ReadInt32();
- break;
- }
- case 96: {
- Dummy12 = input.ReadInt32();
- break;
- }
- case 104: {
- Dummy13 = input.ReadInt32();
- break;
- }
- case 112: {
- Dummy14 = input.ReadInt32();
- break;
- }
- case 120: {
- Dummy15 = input.ReadInt32();
- break;
- }
- case 128: {
- Dummy16 = input.ReadInt32();
- break;
- }
- case 136: {
- Dummy17 = input.ReadInt32();
- break;
- }
- case 144: {
- Dummy18 = input.ReadInt32();
- break;
- }
- case 152: {
- Dummy19 = input.ReadInt32();
- break;
- }
- case 160: {
- Dummy20 = input.ReadInt32();
- break;
- }
- case 168: {
- Dummy21 = input.ReadInt32();
- break;
- }
- case 176: {
- Dummy22 = input.ReadInt32();
- break;
- }
- case 184: {
- Dummy23 = input.ReadInt32();
- break;
- }
- case 192: {
- Dummy24 = input.ReadInt32();
- break;
- }
- case 200: {
- Dummy25 = input.ReadInt32();
- break;
- }
- case 208: {
- Dummy26 = input.ReadInt32();
- break;
- }
- case 216: {
- Dummy27 = input.ReadInt32();
- break;
- }
- case 224: {
- Dummy28 = input.ReadInt32();
- break;
- }
- case 232: {
- Dummy29 = input.ReadInt32();
- break;
- }
- case 240: {
- Dummy30 = input.ReadInt32();
- break;
- }
- case 248: {
- Dummy31 = input.ReadInt32();
- break;
- }
- case 256: {
- Dummy32 = input.ReadInt32();
- break;
- }
- case 264: {
- C = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // required int32 a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
-
- // optional int32 dummy2 = 2;
- public bool HasDummy2 {
- get { return result.HasDummy2; }
- }
- public int Dummy2 {
- get { return result.Dummy2; }
- set { SetDummy2(value); }
- }
- public Builder SetDummy2(int value) {
- result.hasDummy2 = true;
- result.dummy2_ = value;
- return this;
- }
- public Builder ClearDummy2() {
- result.hasDummy2 = false;
- result.dummy2_ = 0;
- return this;
- }
-
- // required int32 b = 3;
- public bool HasB {
- get { return result.HasB; }
- }
- public int B {
- get { return result.B; }
- set { SetB(value); }
- }
- public Builder SetB(int value) {
- result.hasB = true;
- result.b_ = value;
- return this;
- }
- public Builder ClearB() {
- result.hasB = false;
- result.b_ = 0;
- return this;
- }
-
- // optional int32 dummy4 = 4;
- public bool HasDummy4 {
- get { return result.HasDummy4; }
- }
- public int Dummy4 {
- get { return result.Dummy4; }
- set { SetDummy4(value); }
- }
- public Builder SetDummy4(int value) {
- result.hasDummy4 = true;
- result.dummy4_ = value;
- return this;
- }
- public Builder ClearDummy4() {
- result.hasDummy4 = false;
- result.dummy4_ = 0;
- return this;
- }
-
- // optional int32 dummy5 = 5;
- public bool HasDummy5 {
- get { return result.HasDummy5; }
- }
- public int Dummy5 {
- get { return result.Dummy5; }
- set { SetDummy5(value); }
- }
- public Builder SetDummy5(int value) {
- result.hasDummy5 = true;
- result.dummy5_ = value;
- return this;
- }
- public Builder ClearDummy5() {
- result.hasDummy5 = false;
- result.dummy5_ = 0;
- return this;
- }
-
- // optional int32 dummy6 = 6;
- public bool HasDummy6 {
- get { return result.HasDummy6; }
- }
- public int Dummy6 {
- get { return result.Dummy6; }
- set { SetDummy6(value); }
- }
- public Builder SetDummy6(int value) {
- result.hasDummy6 = true;
- result.dummy6_ = value;
- return this;
- }
- public Builder ClearDummy6() {
- result.hasDummy6 = false;
- result.dummy6_ = 0;
- return this;
- }
-
- // optional int32 dummy7 = 7;
- public bool HasDummy7 {
- get { return result.HasDummy7; }
- }
- public int Dummy7 {
- get { return result.Dummy7; }
- set { SetDummy7(value); }
- }
- public Builder SetDummy7(int value) {
- result.hasDummy7 = true;
- result.dummy7_ = value;
- return this;
- }
- public Builder ClearDummy7() {
- result.hasDummy7 = false;
- result.dummy7_ = 0;
- return this;
- }
-
- // optional int32 dummy8 = 8;
- public bool HasDummy8 {
- get { return result.HasDummy8; }
- }
- public int Dummy8 {
- get { return result.Dummy8; }
- set { SetDummy8(value); }
- }
- public Builder SetDummy8(int value) {
- result.hasDummy8 = true;
- result.dummy8_ = value;
- return this;
- }
- public Builder ClearDummy8() {
- result.hasDummy8 = false;
- result.dummy8_ = 0;
- return this;
- }
-
- // optional int32 dummy9 = 9;
- public bool HasDummy9 {
- get { return result.HasDummy9; }
- }
- public int Dummy9 {
- get { return result.Dummy9; }
- set { SetDummy9(value); }
- }
- public Builder SetDummy9(int value) {
- result.hasDummy9 = true;
- result.dummy9_ = value;
- return this;
- }
- public Builder ClearDummy9() {
- result.hasDummy9 = false;
- result.dummy9_ = 0;
- return this;
- }
-
- // optional int32 dummy10 = 10;
- public bool HasDummy10 {
- get { return result.HasDummy10; }
- }
- public int Dummy10 {
- get { return result.Dummy10; }
- set { SetDummy10(value); }
- }
- public Builder SetDummy10(int value) {
- result.hasDummy10 = true;
- result.dummy10_ = value;
- return this;
- }
- public Builder ClearDummy10() {
- result.hasDummy10 = false;
- result.dummy10_ = 0;
- return this;
- }
-
- // optional int32 dummy11 = 11;
- public bool HasDummy11 {
- get { return result.HasDummy11; }
- }
- public int Dummy11 {
- get { return result.Dummy11; }
- set { SetDummy11(value); }
- }
- public Builder SetDummy11(int value) {
- result.hasDummy11 = true;
- result.dummy11_ = value;
- return this;
- }
- public Builder ClearDummy11() {
- result.hasDummy11 = false;
- result.dummy11_ = 0;
- return this;
- }
-
- // optional int32 dummy12 = 12;
- public bool HasDummy12 {
- get { return result.HasDummy12; }
- }
- public int Dummy12 {
- get { return result.Dummy12; }
- set { SetDummy12(value); }
- }
- public Builder SetDummy12(int value) {
- result.hasDummy12 = true;
- result.dummy12_ = value;
- return this;
- }
- public Builder ClearDummy12() {
- result.hasDummy12 = false;
- result.dummy12_ = 0;
- return this;
- }
-
- // optional int32 dummy13 = 13;
- public bool HasDummy13 {
- get { return result.HasDummy13; }
- }
- public int Dummy13 {
- get { return result.Dummy13; }
- set { SetDummy13(value); }
- }
- public Builder SetDummy13(int value) {
- result.hasDummy13 = true;
- result.dummy13_ = value;
- return this;
- }
- public Builder ClearDummy13() {
- result.hasDummy13 = false;
- result.dummy13_ = 0;
- return this;
- }
-
- // optional int32 dummy14 = 14;
- public bool HasDummy14 {
- get { return result.HasDummy14; }
- }
- public int Dummy14 {
- get { return result.Dummy14; }
- set { SetDummy14(value); }
- }
- public Builder SetDummy14(int value) {
- result.hasDummy14 = true;
- result.dummy14_ = value;
- return this;
- }
- public Builder ClearDummy14() {
- result.hasDummy14 = false;
- result.dummy14_ = 0;
- return this;
- }
-
- // optional int32 dummy15 = 15;
- public bool HasDummy15 {
- get { return result.HasDummy15; }
- }
- public int Dummy15 {
- get { return result.Dummy15; }
- set { SetDummy15(value); }
- }
- public Builder SetDummy15(int value) {
- result.hasDummy15 = true;
- result.dummy15_ = value;
- return this;
- }
- public Builder ClearDummy15() {
- result.hasDummy15 = false;
- result.dummy15_ = 0;
- return this;
- }
-
- // optional int32 dummy16 = 16;
- public bool HasDummy16 {
- get { return result.HasDummy16; }
- }
- public int Dummy16 {
- get { return result.Dummy16; }
- set { SetDummy16(value); }
- }
- public Builder SetDummy16(int value) {
- result.hasDummy16 = true;
- result.dummy16_ = value;
- return this;
- }
- public Builder ClearDummy16() {
- result.hasDummy16 = false;
- result.dummy16_ = 0;
- return this;
- }
-
- // optional int32 dummy17 = 17;
- public bool HasDummy17 {
- get { return result.HasDummy17; }
- }
- public int Dummy17 {
- get { return result.Dummy17; }
- set { SetDummy17(value); }
- }
- public Builder SetDummy17(int value) {
- result.hasDummy17 = true;
- result.dummy17_ = value;
- return this;
- }
- public Builder ClearDummy17() {
- result.hasDummy17 = false;
- result.dummy17_ = 0;
- return this;
- }
-
- // optional int32 dummy18 = 18;
- public bool HasDummy18 {
- get { return result.HasDummy18; }
- }
- public int Dummy18 {
- get { return result.Dummy18; }
- set { SetDummy18(value); }
- }
- public Builder SetDummy18(int value) {
- result.hasDummy18 = true;
- result.dummy18_ = value;
- return this;
- }
- public Builder ClearDummy18() {
- result.hasDummy18 = false;
- result.dummy18_ = 0;
- return this;
- }
-
- // optional int32 dummy19 = 19;
- public bool HasDummy19 {
- get { return result.HasDummy19; }
- }
- public int Dummy19 {
- get { return result.Dummy19; }
- set { SetDummy19(value); }
- }
- public Builder SetDummy19(int value) {
- result.hasDummy19 = true;
- result.dummy19_ = value;
- return this;
- }
- public Builder ClearDummy19() {
- result.hasDummy19 = false;
- result.dummy19_ = 0;
- return this;
- }
-
- // optional int32 dummy20 = 20;
- public bool HasDummy20 {
- get { return result.HasDummy20; }
- }
- public int Dummy20 {
- get { return result.Dummy20; }
- set { SetDummy20(value); }
- }
- public Builder SetDummy20(int value) {
- result.hasDummy20 = true;
- result.dummy20_ = value;
- return this;
- }
- public Builder ClearDummy20() {
- result.hasDummy20 = false;
- result.dummy20_ = 0;
- return this;
- }
-
- // optional int32 dummy21 = 21;
- public bool HasDummy21 {
- get { return result.HasDummy21; }
- }
- public int Dummy21 {
- get { return result.Dummy21; }
- set { SetDummy21(value); }
- }
- public Builder SetDummy21(int value) {
- result.hasDummy21 = true;
- result.dummy21_ = value;
- return this;
- }
- public Builder ClearDummy21() {
- result.hasDummy21 = false;
- result.dummy21_ = 0;
- return this;
- }
-
- // optional int32 dummy22 = 22;
- public bool HasDummy22 {
- get { return result.HasDummy22; }
- }
- public int Dummy22 {
- get { return result.Dummy22; }
- set { SetDummy22(value); }
- }
- public Builder SetDummy22(int value) {
- result.hasDummy22 = true;
- result.dummy22_ = value;
- return this;
- }
- public Builder ClearDummy22() {
- result.hasDummy22 = false;
- result.dummy22_ = 0;
- return this;
- }
-
- // optional int32 dummy23 = 23;
- public bool HasDummy23 {
- get { return result.HasDummy23; }
- }
- public int Dummy23 {
- get { return result.Dummy23; }
- set { SetDummy23(value); }
- }
- public Builder SetDummy23(int value) {
- result.hasDummy23 = true;
- result.dummy23_ = value;
- return this;
- }
- public Builder ClearDummy23() {
- result.hasDummy23 = false;
- result.dummy23_ = 0;
- return this;
- }
-
- // optional int32 dummy24 = 24;
- public bool HasDummy24 {
- get { return result.HasDummy24; }
- }
- public int Dummy24 {
- get { return result.Dummy24; }
- set { SetDummy24(value); }
- }
- public Builder SetDummy24(int value) {
- result.hasDummy24 = true;
- result.dummy24_ = value;
- return this;
- }
- public Builder ClearDummy24() {
- result.hasDummy24 = false;
- result.dummy24_ = 0;
- return this;
- }
-
- // optional int32 dummy25 = 25;
- public bool HasDummy25 {
- get { return result.HasDummy25; }
- }
- public int Dummy25 {
- get { return result.Dummy25; }
- set { SetDummy25(value); }
- }
- public Builder SetDummy25(int value) {
- result.hasDummy25 = true;
- result.dummy25_ = value;
- return this;
- }
- public Builder ClearDummy25() {
- result.hasDummy25 = false;
- result.dummy25_ = 0;
- return this;
- }
-
- // optional int32 dummy26 = 26;
- public bool HasDummy26 {
- get { return result.HasDummy26; }
- }
- public int Dummy26 {
- get { return result.Dummy26; }
- set { SetDummy26(value); }
- }
- public Builder SetDummy26(int value) {
- result.hasDummy26 = true;
- result.dummy26_ = value;
- return this;
- }
- public Builder ClearDummy26() {
- result.hasDummy26 = false;
- result.dummy26_ = 0;
- return this;
- }
-
- // optional int32 dummy27 = 27;
- public bool HasDummy27 {
- get { return result.HasDummy27; }
- }
- public int Dummy27 {
- get { return result.Dummy27; }
- set { SetDummy27(value); }
- }
- public Builder SetDummy27(int value) {
- result.hasDummy27 = true;
- result.dummy27_ = value;
- return this;
- }
- public Builder ClearDummy27() {
- result.hasDummy27 = false;
- result.dummy27_ = 0;
- return this;
- }
-
- // optional int32 dummy28 = 28;
- public bool HasDummy28 {
- get { return result.HasDummy28; }
- }
- public int Dummy28 {
- get { return result.Dummy28; }
- set { SetDummy28(value); }
- }
- public Builder SetDummy28(int value) {
- result.hasDummy28 = true;
- result.dummy28_ = value;
- return this;
- }
- public Builder ClearDummy28() {
- result.hasDummy28 = false;
- result.dummy28_ = 0;
- return this;
- }
-
- // optional int32 dummy29 = 29;
- public bool HasDummy29 {
- get { return result.HasDummy29; }
- }
- public int Dummy29 {
- get { return result.Dummy29; }
- set { SetDummy29(value); }
- }
- public Builder SetDummy29(int value) {
- result.hasDummy29 = true;
- result.dummy29_ = value;
- return this;
- }
- public Builder ClearDummy29() {
- result.hasDummy29 = false;
- result.dummy29_ = 0;
- return this;
- }
-
- // optional int32 dummy30 = 30;
- public bool HasDummy30 {
- get { return result.HasDummy30; }
- }
- public int Dummy30 {
- get { return result.Dummy30; }
- set { SetDummy30(value); }
- }
- public Builder SetDummy30(int value) {
- result.hasDummy30 = true;
- result.dummy30_ = value;
- return this;
- }
- public Builder ClearDummy30() {
- result.hasDummy30 = false;
- result.dummy30_ = 0;
- return this;
- }
-
- // optional int32 dummy31 = 31;
- public bool HasDummy31 {
- get { return result.HasDummy31; }
- }
- public int Dummy31 {
- get { return result.Dummy31; }
- set { SetDummy31(value); }
- }
- public Builder SetDummy31(int value) {
- result.hasDummy31 = true;
- result.dummy31_ = value;
- return this;
- }
- public Builder ClearDummy31() {
- result.hasDummy31 = false;
- result.dummy31_ = 0;
- return this;
- }
-
- // optional int32 dummy32 = 32;
- public bool HasDummy32 {
- get { return result.HasDummy32; }
- }
- public int Dummy32 {
- get { return result.Dummy32; }
- set { SetDummy32(value); }
- }
- public Builder SetDummy32(int value) {
- result.hasDummy32 = true;
- result.dummy32_ = value;
- return this;
- }
- public Builder ClearDummy32() {
- result.hasDummy32 = false;
- result.dummy32_ = 0;
- return this;
- }
-
- // required int32 c = 33;
- public bool HasC {
- get { return result.HasC; }
- }
- public int C {
- get { return result.C; }
- set { SetC(value); }
- }
- public Builder SetC(int value) {
- result.hasC = true;
- result.c_ = value;
- return this;
- }
- public Builder ClearC() {
- result.hasC = false;
- result.c_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestRequiredForeign : pb::GeneratedMessage<TestRequiredForeign, TestRequiredForeign.Builder> {
- private static readonly TestRequiredForeign defaultInstance = new Builder().BuildPartial();
- public static TestRequiredForeign DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestRequiredForeign DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestRequiredForeign ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestRequiredForeign, TestRequiredForeign.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestRequired optional_message = 1;
- private bool hasOptionalMessage;
- private global::Google.ProtocolBuffers.TestProtos.TestRequired optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance;
- public bool HasOptionalMessage {
- get { return hasOptionalMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage {
- get { return optionalMessage_; }
- }
-
- // repeated .protobuf_unittest.TestRequired repeated_message = 2;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestRequired> repeatedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestRequired>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestRequired> RepeatedMessageList {
- get { return repeatedMessage_; }
- }
- public int RepeatedMessageCount
- { get { return repeatedMessage_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) {
- return repeatedMessage_ [index];
- }
-
- // optional int32 dummy = 3;
- private bool hasDummy;
- private int dummy_ = 0;
- public bool HasDummy {
- get { return hasDummy; }
- }
- public int Dummy {
- get { return dummy_; }
- }
-
- public override bool IsInitialized {
- get {
- if (HasOptionalMessage) {
- if (!OptionalMessage.IsInitialized) return false;
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) {
- if (!element.IsInitialized) return false;
- }
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasOptionalMessage) {
- output.WriteMessage(1, OptionalMessage);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) {
- output.WriteMessage(2, element);
- }
- if (HasDummy) {
- output.WriteInt32(3, Dummy);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasOptionalMessage) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) {
- size += pb::CodedOutputStream.ComputeMessageSize(2, element);
- }
- if (HasDummy) {
- size += pb::CodedOutputStream.ComputeInt32Size(3, Dummy);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign result = new global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign BuildPartial() {
- result.repeatedMessage_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance) return this;
- if (other.HasOptionalMessage) {
- MergeOptionalMessage(other.OptionalMessage);
- }
- if (other.repeatedMessage_.Count != 0) {
- base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
- }
- if (other.HasDummy) {
- Dummy = other.Dummy;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder();
- if (HasOptionalMessage) {
- subBuilder.MergeFrom(OptionalMessage);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- OptionalMessage = subBuilder.BuildPartial();
- break;
- }
- case 18: {
- global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddRepeatedMessage(subBuilder.BuildPartial());
- break;
- }
- case 24: {
- Dummy = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestRequired optional_message = 1;
- public bool HasOptionalMessage {
- get { return result.HasOptionalMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage {
- get { return result.OptionalMessage; }
- set { SetOptionalMessage(value); }
- }
- public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) {
- result.hasOptionalMessage = true;
- result.optionalMessage_ = value;
- return this;
- }
- public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) {
- result.hasOptionalMessage = true;
- result.optionalMessage_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) {
- if (result.HasOptionalMessage &&
- result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) {
- result.optionalMessage_ =
- global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalMessage_ = value;
- }
- result.hasOptionalMessage = true;
- return this;
- }
- public Builder ClearOptionalMessage() {
- result.hasOptionalMessage = false;
- result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance;
- return this;
- }
-
- // repeated .protobuf_unittest.TestRequired repeated_message = 2;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestRequired> RepeatedMessageList {
- get { return result.repeatedMessage_; }
- }
- public int RepeatedMessageCount {
- get { return result.RepeatedMessageCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) {
- return result.GetRepeatedMessage(index);
- }
- public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired value) {
- result.repeatedMessage_[index] = value;
- return this;
- }
- public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) {
- result.repeatedMessage_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) {
- result.repeatedMessage_.Add(value);
- return this;
- }
- public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) {
- result.repeatedMessage_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestRequired> values) {
- base.AddRange(values, result.repeatedMessage_);
- return this;
- }
- public Builder ClearRepeatedMessage() {
- result.repeatedMessage_.Clear();
- return this;
- }
-
- // optional int32 dummy = 3;
- public bool HasDummy {
- get { return result.HasDummy; }
- }
- public int Dummy {
- get { return result.Dummy; }
- set { SetDummy(value); }
- }
- public Builder SetDummy(int value) {
- result.hasDummy = true;
- result.dummy_ = value;
- return this;
- }
- public Builder ClearDummy() {
- result.hasDummy = false;
- result.dummy_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestForeignNested : pb::GeneratedMessage<TestForeignNested, TestForeignNested.Builder> {
- private static readonly TestForeignNested defaultInstance = new Builder().BuildPartial();
- public static TestForeignNested DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestForeignNested DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestForeignNested ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestForeignNested, TestForeignNested.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestAllTypes.NestedMessage foreign_nested = 1;
- private bool hasForeignNested;
- private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance;
- public bool HasForeignNested {
- get { return hasForeignNested; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested {
- get { return foreignNested_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasForeignNested) {
- output.WriteMessage(1, ForeignNested);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasForeignNested) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, ForeignNested);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestForeignNested ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestForeignNested prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestForeignNested, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestForeignNested.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestForeignNested result = new global::Google.ProtocolBuffers.TestProtos.TestForeignNested();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestForeignNested MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestForeignNested();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestForeignNested DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestForeignNested BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestForeignNested returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestForeignNested) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestForeignNested) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestForeignNested other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance) return this;
- if (other.HasForeignNested) {
- MergeForeignNested(other.ForeignNested);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder();
- if (HasForeignNested) {
- subBuilder.MergeFrom(ForeignNested);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- ForeignNested = subBuilder.BuildPartial();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestAllTypes.NestedMessage foreign_nested = 1;
- public bool HasForeignNested {
- get { return result.HasForeignNested; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested {
- get { return result.ForeignNested; }
- set { SetForeignNested(value); }
- }
- public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) {
- result.hasForeignNested = true;
- result.foreignNested_ = value;
- return this;
- }
- public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
- result.hasForeignNested = true;
- result.foreignNested_ = builderForValue.Build();
- return this;
- }
- public Builder MergeForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) {
- if (result.HasForeignNested &&
- result.foreignNested_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) {
- result.foreignNested_ =
- global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.foreignNested_).MergeFrom(value).BuildPartial();
- } else {
- result.foreignNested_ = value;
- }
- result.hasForeignNested = true;
- return this;
- }
- public Builder ClearForeignNested() {
- result.hasForeignNested = false;
- result.foreignNested_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance;
- return this;
- }
- }
- }
-
- public sealed partial class TestEmptyMessage : pb::GeneratedMessage<TestEmptyMessage, TestEmptyMessage.Builder> {
- private static readonly TestEmptyMessage defaultInstance = new Builder().BuildPartial();
- public static TestEmptyMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestEmptyMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestEmptyMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestEmptyMessage, TestEmptyMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage result = new global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class TestEmptyMessageWithExtensions : pb::ExtendableMessage<TestEmptyMessageWithExtensions, TestEmptyMessageWithExtensions.Builder> {
- private static readonly TestEmptyMessageWithExtensions defaultInstance = new Builder().BuildPartial();
- public static TestEmptyMessageWithExtensions DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestEmptyMessageWithExtensions DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestEmptyMessageWithExtensions ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestEmptyMessageWithExtensions, TestEmptyMessageWithExtensions.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- if (!ExtensionsAreInitialized) return false;
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- pb::ExtendableMessage<TestEmptyMessageWithExtensions, TestEmptyMessageWithExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
- extensionWriter.WriteUntil(536870912, output);
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += ExtensionsSerializedSize;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::ExtendableBuilder<global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions, global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions result = new global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class TestReallyLargeTagNumber : pb::GeneratedMessage<TestReallyLargeTagNumber, TestReallyLargeTagNumber.Builder> {
- private static readonly TestReallyLargeTagNumber defaultInstance = new Builder().BuildPartial();
- public static TestReallyLargeTagNumber DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestReallyLargeTagNumber DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestReallyLargeTagNumber ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestReallyLargeTagNumber, TestReallyLargeTagNumber.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; }
- }
-
- // optional int32 a = 1;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- // optional int32 bb = 268435455;
- private bool hasBb;
- private int bb_ = 0;
- public bool HasBb {
- get { return hasBb; }
- }
- public int Bb {
- get { return bb_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(1, A);
- }
- if (HasBb) {
- output.WriteInt32(268435455, Bb);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, A);
- }
- if (HasBb) {
- size += pb::CodedOutputStream.ComputeInt32Size(268435455, Bb);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber result = new global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- if (other.HasBb) {
- Bb = other.Bb;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- A = input.ReadInt32();
- break;
- }
- case 2147483640: {
- Bb = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
-
- // optional int32 bb = 268435455;
- public bool HasBb {
- get { return result.HasBb; }
- }
- public int Bb {
- get { return result.Bb; }
- set { SetBb(value); }
- }
- public Builder SetBb(int value) {
- result.hasBb = true;
- result.bb_ = value;
- return this;
- }
- public Builder ClearBb() {
- result.hasBb = false;
- result.bb_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestRecursiveMessage : pb::GeneratedMessage<TestRecursiveMessage, TestRecursiveMessage.Builder> {
- private static readonly TestRecursiveMessage defaultInstance = new Builder().BuildPartial();
- public static TestRecursiveMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestRecursiveMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestRecursiveMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestRecursiveMessage, TestRecursiveMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestRecursiveMessage a = 1;
- private bool hasA;
- private global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage a_ = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance;
- public bool HasA {
- get { return hasA; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A {
- get { return a_; }
- }
-
- // optional int32 i = 2;
- private bool hasI;
- private int i_ = 0;
- public bool HasI {
- get { return hasI; }
- }
- public int I {
- get { return i_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteMessage(1, A);
- }
- if (HasI) {
- output.WriteInt32(2, I);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, A);
- }
- if (HasI) {
- size += pb::CodedOutputStream.ComputeInt32Size(2, I);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage result = new global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) return this;
- if (other.HasA) {
- MergeA(other.A);
- }
- if (other.HasI) {
- I = other.I;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder();
- if (HasA) {
- subBuilder.MergeFrom(A);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- A = subBuilder.BuildPartial();
- break;
- }
- case 16: {
- I = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestRecursiveMessage a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder builderForValue) {
- result.hasA = true;
- result.a_ = builderForValue.Build();
- return this;
- }
- public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) {
- if (result.HasA &&
- result.a_ != global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) {
- result.a_ =
- global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(result.a_).MergeFrom(value).BuildPartial();
- } else {
- result.a_ = value;
- }
- result.hasA = true;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance;
- return this;
- }
-
- // optional int32 i = 2;
- public bool HasI {
- get { return result.HasI; }
- }
- public int I {
- get { return result.I; }
- set { SetI(value); }
- }
- public Builder SetI(int value) {
- result.hasI = true;
- result.i_ = value;
- return this;
- }
- public Builder ClearI() {
- result.hasI = false;
- result.i_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestMutualRecursionA : pb::GeneratedMessage<TestMutualRecursionA, TestMutualRecursionA.Builder> {
- private static readonly TestMutualRecursionA defaultInstance = new Builder().BuildPartial();
- public static TestMutualRecursionA DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestMutualRecursionA DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestMutualRecursionA ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestMutualRecursionA, TestMutualRecursionA.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestMutualRecursionB bb = 1;
- private bool hasBb;
- private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB bb_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance;
- public bool HasBb {
- get { return hasBb; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb {
- get { return bb_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasBb) {
- output.WriteMessage(1, Bb);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasBb) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, Bb);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA result = new global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) return this;
- if (other.HasBb) {
- MergeBb(other.Bb);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder();
- if (HasBb) {
- subBuilder.MergeFrom(Bb);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- Bb = subBuilder.BuildPartial();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestMutualRecursionB bb = 1;
- public bool HasBb {
- get { return result.HasBb; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb {
- get { return result.Bb; }
- set { SetBb(value); }
- }
- public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) {
- result.hasBb = true;
- result.bb_ = value;
- return this;
- }
- public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder builderForValue) {
- result.hasBb = true;
- result.bb_ = builderForValue.Build();
- return this;
- }
- public Builder MergeBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) {
- if (result.HasBb &&
- result.bb_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) {
- result.bb_ =
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(result.bb_).MergeFrom(value).BuildPartial();
- } else {
- result.bb_ = value;
- }
- result.hasBb = true;
- return this;
- }
- public Builder ClearBb() {
- result.hasBb = false;
- result.bb_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance;
- return this;
- }
- }
- }
-
- public sealed partial class TestMutualRecursionB : pb::GeneratedMessage<TestMutualRecursionB, TestMutualRecursionB.Builder> {
- private static readonly TestMutualRecursionB defaultInstance = new Builder().BuildPartial();
- public static TestMutualRecursionB DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestMutualRecursionB DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestMutualRecursionB ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestMutualRecursionB, TestMutualRecursionB.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; }
- }
-
- // optional .protobuf_unittest.TestMutualRecursionA a = 1;
- private bool hasA;
- private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA a_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance;
- public bool HasA {
- get { return hasA; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A {
- get { return a_; }
- }
-
- // optional int32 optional_int32 = 2;
- private bool hasOptionalInt32;
- private int optionalInt32_ = 0;
- public bool HasOptionalInt32 {
- get { return hasOptionalInt32; }
- }
- public int OptionalInt32 {
- get { return optionalInt32_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteMessage(1, A);
- }
- if (HasOptionalInt32) {
- output.WriteInt32(2, OptionalInt32);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, A);
- }
- if (HasOptionalInt32) {
- size += pb::CodedOutputStream.ComputeInt32Size(2, OptionalInt32);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB result = new global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) return this;
- if (other.HasA) {
- MergeA(other.A);
- }
- if (other.HasOptionalInt32) {
- OptionalInt32 = other.OptionalInt32;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder();
- if (HasA) {
- subBuilder.MergeFrom(A);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- A = subBuilder.BuildPartial();
- break;
- }
- case 16: {
- OptionalInt32 = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestMutualRecursionA a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder builderForValue) {
- result.hasA = true;
- result.a_ = builderForValue.Build();
- return this;
- }
- public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) {
- if (result.HasA &&
- result.a_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) {
- result.a_ =
- global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(result.a_).MergeFrom(value).BuildPartial();
- } else {
- result.a_ = value;
- }
- result.hasA = true;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance;
- return this;
- }
-
- // optional int32 optional_int32 = 2;
- public bool HasOptionalInt32 {
- get { return result.HasOptionalInt32; }
- }
- public int OptionalInt32 {
- get { return result.OptionalInt32; }
- set { SetOptionalInt32(value); }
- }
- public Builder SetOptionalInt32(int value) {
- result.hasOptionalInt32 = true;
- result.optionalInt32_ = value;
- return this;
- }
- public Builder ClearOptionalInt32() {
- result.hasOptionalInt32 = false;
- result.optionalInt32_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class TestDupFieldNumber : pb::GeneratedMessage<TestDupFieldNumber, TestDupFieldNumber.Builder> {
- private static readonly TestDupFieldNumber defaultInstance = new Builder().BuildPartial();
- public static TestDupFieldNumber DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestDupFieldNumber DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestDupFieldNumber ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestDupFieldNumber, TestDupFieldNumber.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; }
- }
-
- #region Nested types
- public static class Types {
- public sealed partial class Foo : pb::GeneratedMessage<Foo, Foo.Builder> {
- private static readonly Foo defaultInstance = new Builder().BuildPartial();
- public static Foo DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override Foo DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override Foo ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<Foo, Foo.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; }
- }
-
- // optional int32 a = 1;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(1, A);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, A);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo result = new global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- A = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
- }
- }
-
- public sealed partial class Bar : pb::GeneratedMessage<Bar, Bar.Builder> {
- private static readonly Bar defaultInstance = new Builder().BuildPartial();
- public static Bar DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override Bar DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override Bar ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<Bar, Bar.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; }
- }
-
- // optional int32 a = 1;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(1, A);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, A);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar result = new global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- A = input.ReadInt32();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
- }
- }
-
- }
- #endregion
-
- // optional int32 a = 1;
- private bool hasA;
- private int a_ = 0;
- public bool HasA {
- get { return hasA; }
- }
- public int A {
- get { return a_; }
- }
-
- // optional group Foo = 2 {
- private bool hasFoo;
- private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo foo_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance;
- public bool HasFoo {
- get { return hasFoo; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo {
- get { return foo_; }
- }
-
- // optional group Bar = 3 {
- private bool hasBar;
- private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar bar_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance;
- public bool HasBar {
- get { return hasBar; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar {
- get { return bar_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasA) {
- output.WriteInt32(1, A);
- }
- if (HasFoo) {
- output.WriteGroup(2, Foo);
- }
- if (HasBar) {
- output.WriteGroup(3, Bar);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasA) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, A);
- }
- if (HasFoo) {
- size += pb::CodedOutputStream.ComputeGroupSize(2, Foo);
- }
- if (HasBar) {
- size += pb::CodedOutputStream.ComputeGroupSize(3, Bar);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber result = new global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance) return this;
- if (other.HasA) {
- A = other.A;
- }
- if (other.HasFoo) {
- MergeFoo(other.Foo);
- }
- if (other.HasBar) {
- MergeBar(other.Bar);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- A = input.ReadInt32();
- break;
- }
- case 19: {
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder();
- if (HasFoo) {
- subBuilder.MergeFrom(Foo);
- }
- input.ReadGroup(2, subBuilder, extensionRegistry);
- Foo = subBuilder.BuildPartial();
- break;
- }
- case 27: {
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder();
- if (HasBar) {
- subBuilder.MergeFrom(Bar);
- }
- input.ReadGroup(3, subBuilder, extensionRegistry);
- Bar = subBuilder.BuildPartial();
- break;
- }
- }
- }
- }
-
-
- // optional int32 a = 1;
- public bool HasA {
- get { return result.HasA; }
- }
- public int A {
- get { return result.A; }
- set { SetA(value); }
- }
- public Builder SetA(int value) {
- result.hasA = true;
- result.a_ = value;
- return this;
- }
- public Builder ClearA() {
- result.hasA = false;
- result.a_ = 0;
- return this;
- }
-
- // optional group Foo = 2 {
- public bool HasFoo {
- get { return result.HasFoo; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo {
- get { return result.Foo; }
- set { SetFoo(value); }
- }
- public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) {
- result.hasFoo = true;
- result.foo_ = value;
- return this;
- }
- public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder builderForValue) {
- result.hasFoo = true;
- result.foo_ = builderForValue.Build();
- return this;
- }
- public Builder MergeFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) {
- if (result.HasFoo &&
- result.foo_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) {
- result.foo_ =
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(result.foo_).MergeFrom(value).BuildPartial();
- } else {
- result.foo_ = value;
- }
- result.hasFoo = true;
- return this;
- }
- public Builder ClearFoo() {
- result.hasFoo = false;
- result.foo_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance;
- return this;
- }
-
- // optional group Bar = 3 {
- public bool HasBar {
- get { return result.HasBar; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar {
- get { return result.Bar; }
- set { SetBar(value); }
- }
- public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) {
- result.hasBar = true;
- result.bar_ = value;
- return this;
- }
- public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder builderForValue) {
- result.hasBar = true;
- result.bar_ = builderForValue.Build();
- return this;
- }
- public Builder MergeBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) {
- if (result.HasBar &&
- result.bar_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) {
- result.bar_ =
- global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(result.bar_).MergeFrom(value).BuildPartial();
- } else {
- result.bar_ = value;
- }
- result.hasBar = true;
- return this;
- }
- public Builder ClearBar() {
- result.hasBar = false;
- result.bar_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance;
- return this;
- }
- }
- }
-
- public sealed partial class TestNestedMessageHasBits : pb::GeneratedMessage<TestNestedMessageHasBits, TestNestedMessageHasBits.Builder> {
- private static readonly TestNestedMessageHasBits defaultInstance = new Builder().BuildPartial();
- public static TestNestedMessageHasBits DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestNestedMessageHasBits DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestNestedMessageHasBits ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestNestedMessageHasBits, TestNestedMessageHasBits.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; }
- }
-
- #region Nested types
- public static class Types {
- public sealed partial class NestedMessage : pb::GeneratedMessage<NestedMessage, NestedMessage.Builder> {
- private static readonly NestedMessage defaultInstance = new Builder().BuildPartial();
- public static NestedMessage DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override NestedMessage DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override NestedMessage ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<NestedMessage, NestedMessage.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; }
- }
-
- // repeated int32 nestedmessage_repeated_int32 = 1;
- private pbc::PopsicleList<int> nestedmessageRepeatedInt32_ = new pbc::PopsicleList<int>();
- public scg::IList<int> NestedmessageRepeatedInt32List {
- get { return nestedmessageRepeatedInt32_; }
- }
- public int NestedmessageRepeatedInt32Count {
- get { return nestedmessageRepeatedInt32_.Count; }
- }
- public int GetNestedmessageRepeatedInt32(int index) {
- return nestedmessageRepeatedInt32_[index];
- }
-
- // repeated .protobuf_unittest.ForeignMessage nestedmessage_repeated_foreignmessage = 2;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> nestedmessageRepeatedForeignmessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> NestedmessageRepeatedForeignmessageList {
- get { return nestedmessageRepeatedForeignmessage_; }
- }
- public int NestedmessageRepeatedForeignmessageCount
- { get { return nestedmessageRepeatedForeignmessage_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) {
- return nestedmessageRepeatedForeignmessage_ [index];
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- foreach (int element in NestedmessageRepeatedInt32List) {
- output.WriteInt32(1, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in NestedmessageRepeatedForeignmessageList) {
- output.WriteMessage(2, element);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- foreach (int element in NestedmessageRepeatedInt32List) {
- size += pb::CodedOutputStream
- .ComputeInt32Size(1, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in NestedmessageRepeatedForeignmessageList) {
- size += pb::CodedOutputStream.ComputeMessageSize(2, element);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage result = new global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage BuildPartial() {
- result.nestedmessageRepeatedInt32_.MakeReadOnly();
- result.nestedmessageRepeatedForeignmessage_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) return this;
- if (other.nestedmessageRepeatedInt32_.Count != 0) {
- base.AddRange(other.nestedmessageRepeatedInt32_, result.nestedmessageRepeatedInt32_);
- }
- if (other.nestedmessageRepeatedForeignmessage_.Count != 0) {
- base.AddRange(other.nestedmessageRepeatedForeignmessage_, result.nestedmessageRepeatedForeignmessage_);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- AddNestedmessageRepeatedInt32(input.ReadInt32());
- break;
- }
- case 18: {
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddNestedmessageRepeatedForeignmessage(subBuilder.BuildPartial());
- break;
- }
- }
- }
- }
-
-
- // repeated int32 nestedmessage_repeated_int32 = 1;
- public scg::IList<int> NestedmessageRepeatedInt32List {
- get { return result.nestedmessageRepeatedInt32_; }
- }
- public int NestedmessageRepeatedInt32Count {
- get { return result.NestedmessageRepeatedInt32Count; }
- }
- public int GetNestedmessageRepeatedInt32(int index) {
- return result.GetNestedmessageRepeatedInt32(index);
- }
- public Builder SetNestedmessageRepeatedInt32(int index, int value) {
- result.nestedmessageRepeatedInt32_[index] = value;
- return this;
- }
- public Builder AddNestedmessageRepeatedInt32(int value) {
- result.nestedmessageRepeatedInt32_.Add(value);
- return this;
- }
- public Builder AddRangeNestedmessageRepeatedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.nestedmessageRepeatedInt32_);
- return this;
- }
- public Builder ClearNestedmessageRepeatedInt32() {
- result.nestedmessageRepeatedInt32_.Clear();
- return this;
- }
-
- // repeated .protobuf_unittest.ForeignMessage nestedmessage_repeated_foreignmessage = 2;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> NestedmessageRepeatedForeignmessageList {
- get { return result.nestedmessageRepeatedForeignmessage_; }
- }
- public int NestedmessageRepeatedForeignmessageCount {
- get { return result.NestedmessageRepeatedForeignmessageCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) {
- return result.GetNestedmessageRepeatedForeignmessage(index);
- }
- public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.nestedmessageRepeatedForeignmessage_[index] = value;
- return this;
- }
- public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.nestedmessageRepeatedForeignmessage_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.nestedmessageRepeatedForeignmessage_.Add(value);
- return this;
- }
- public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.nestedmessageRepeatedForeignmessage_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeNestedmessageRepeatedForeignmessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> values) {
- base.AddRange(values, result.nestedmessageRepeatedForeignmessage_);
- return this;
- }
- public Builder ClearNestedmessageRepeatedForeignmessage() {
- result.nestedmessageRepeatedForeignmessage_.Clear();
- return this;
- }
- }
- }
-
- }
- #endregion
-
- // optional .protobuf_unittest.TestNestedMessageHasBits.NestedMessage optional_nested_message = 1;
- private bool hasOptionalNestedMessage;
- private global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance;
- public bool HasOptionalNestedMessage {
- get { return hasOptionalNestedMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage {
- get { return optionalNestedMessage_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasOptionalNestedMessage) {
- output.WriteMessage(1, OptionalNestedMessage);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasOptionalNestedMessage) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalNestedMessage);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits result = new global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance) return this;
- if (other.HasOptionalNestedMessage) {
- MergeOptionalNestedMessage(other.OptionalNestedMessage);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder();
- if (HasOptionalNestedMessage) {
- subBuilder.MergeFrom(OptionalNestedMessage);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- OptionalNestedMessage = subBuilder.BuildPartial();
- break;
- }
- }
- }
- }
-
-
- // optional .protobuf_unittest.TestNestedMessageHasBits.NestedMessage optional_nested_message = 1;
- public bool HasOptionalNestedMessage {
- get { return result.HasOptionalNestedMessage; }
- }
- public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage {
- get { return result.OptionalNestedMessage; }
- set { SetOptionalNestedMessage(value); }
- }
- public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) {
- result.hasOptionalNestedMessage = true;
- result.optionalNestedMessage_ = value;
- return this;
- }
- public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder builderForValue) {
- result.hasOptionalNestedMessage = true;
- result.optionalNestedMessage_ = builderForValue.Build();
- return this;
- }
- public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) {
- if (result.HasOptionalNestedMessage &&
- result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) {
- result.optionalNestedMessage_ =
- global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial();
- } else {
- result.optionalNestedMessage_ = value;
- }
- result.hasOptionalNestedMessage = true;
- return this;
- }
- public Builder ClearOptionalNestedMessage() {
- result.hasOptionalNestedMessage = false;
- result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance;
- return this;
- }
- }
- }
-
- public sealed partial class TestCamelCaseFieldNames : pb::GeneratedMessage<TestCamelCaseFieldNames, TestCamelCaseFieldNames.Builder> {
- private static readonly TestCamelCaseFieldNames defaultInstance = new Builder().BuildPartial();
- public static TestCamelCaseFieldNames DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestCamelCaseFieldNames DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestCamelCaseFieldNames ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestCamelCaseFieldNames, TestCamelCaseFieldNames.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; }
- }
-
- // optional int32 PrimitiveField = 1;
- private bool hasPrimitiveField;
- private int primitiveField_ = 0;
- public bool HasPrimitiveField {
- get { return hasPrimitiveField; }
- }
- public int PrimitiveField {
- get { return primitiveField_; }
- }
-
- // optional string StringField = 2;
- private bool hasStringField;
- private string stringField_ = "";
- public bool HasStringField {
- get { return hasStringField; }
- }
- public string StringField {
- get { return stringField_; }
- }
-
- // optional .protobuf_unittest.ForeignEnum EnumField = 3;
- private bool hasEnumField;
- private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO;
- public bool HasEnumField {
- get { return hasEnumField; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { get { return enumField_; }}
-
- // optional .protobuf_unittest.ForeignMessage MessageField = 4;
- private bool hasMessageField;
- private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageField_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
- public bool HasMessageField {
- get { return hasMessageField; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField {
- get { return messageField_; }
- }
-
- // optional string StringPieceField = 5 [ctype = STRING_PIECE];
- private bool hasStringPieceField;
- private string stringPieceField_ = "";
- public bool HasStringPieceField {
- get { return hasStringPieceField; }
- }
- public string StringPieceField {
- get { return stringPieceField_; }
- }
-
- // optional string CordField = 6 [ctype = CORD];
- private bool hasCordField;
- private string cordField_ = "";
- public bool HasCordField {
- get { return hasCordField; }
- }
- public string CordField {
- get { return cordField_; }
- }
-
- // repeated int32 RepeatedPrimitiveField = 7;
- private pbc::PopsicleList<int> repeatedPrimitiveField_ = new pbc::PopsicleList<int>();
- public scg::IList<int> RepeatedPrimitiveFieldList {
- get { return repeatedPrimitiveField_; }
- }
- public int RepeatedPrimitiveFieldCount {
- get { return repeatedPrimitiveField_.Count; }
- }
- public int GetRepeatedPrimitiveField(int index) {
- return repeatedPrimitiveField_[index];
- }
-
- // repeated string RepeatedStringField = 8;
- private pbc::PopsicleList<string> repeatedStringField_ = new pbc::PopsicleList<string>();
- public scg::IList<string> RepeatedStringFieldList {
- get { return repeatedStringField_; }
- }
- public int RepeatedStringFieldCount {
- get { return repeatedStringField_.Count; }
- }
- public string GetRepeatedStringField(int index) {
- return repeatedStringField_[index];
- }
-
- // repeated .protobuf_unittest.ForeignEnum RepeatedEnumField = 9;
- private scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> repeatedEnumField_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> ();
- public scg.IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> RepeatedEnumFieldList {
- get { return pbc::Lists.AsReadOnly(repeatedEnumField_); }
- }
- public int RepeatedEnumFieldCount {
- get { return repeatedEnumField_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) {
- return repeatedEnumField_[index];
- }
-
- // repeated .protobuf_unittest.ForeignMessage RepeatedMessageField = 10;
- private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> repeatedMessageField_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage>();
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> RepeatedMessageFieldList {
- get { return repeatedMessageField_; }
- }
- public int RepeatedMessageFieldCount
- { get { return repeatedMessageField_.Count; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) {
- return repeatedMessageField_ [index];
- }
-
- // repeated string RepeatedStringPieceField = 11 [ctype = STRING_PIECE];
- private pbc::PopsicleList<string> repeatedStringPieceField_ = new pbc::PopsicleList<string>();
- public scg::IList<string> RepeatedStringPieceFieldList {
- get { return repeatedStringPieceField_; }
- }
- public int RepeatedStringPieceFieldCount {
- get { return repeatedStringPieceField_.Count; }
- }
- public string GetRepeatedStringPieceField(int index) {
- return repeatedStringPieceField_[index];
- }
-
- // repeated string RepeatedCordField = 12 [ctype = CORD];
- private pbc::PopsicleList<string> repeatedCordField_ = new pbc::PopsicleList<string>();
- public scg::IList<string> RepeatedCordFieldList {
- get { return repeatedCordField_; }
- }
- public int RepeatedCordFieldCount {
- get { return repeatedCordField_.Count; }
- }
- public string GetRepeatedCordField(int index) {
- return repeatedCordField_[index];
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasPrimitiveField) {
- output.WriteInt32(1, PrimitiveField);
- }
- if (HasStringField) {
- output.WriteString(2, StringField);
- }
- if (HasEnumField) {
- output.WriteEnum(3, (int) EnumField);
- }
- if (HasMessageField) {
- output.WriteMessage(4, MessageField);
- }
- if (HasStringPieceField) {
- output.WriteString(5, StringPieceField);
- }
- if (HasCordField) {
- output.WriteString(6, CordField);
- }
- foreach (int element in RepeatedPrimitiveFieldList) {
- output.WriteInt32(7, element);
- }
- foreach (string element in RepeatedStringFieldList) {
- output.WriteString(8, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in RepeatedEnumFieldList) {
- output.WriteEnum(9, (int) element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedMessageFieldList) {
- output.WriteMessage(10, element);
- }
- foreach (string element in RepeatedStringPieceFieldList) {
- output.WriteString(11, element);
- }
- foreach (string element in RepeatedCordFieldList) {
- output.WriteString(12, element);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasPrimitiveField) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveField);
- }
- if (HasStringField) {
- size += pb::CodedOutputStream.ComputeStringSize(2, StringField);
- }
- if (HasEnumField) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(3, (int) EnumField);
- }
- if (HasMessageField) {
- size += pb::CodedOutputStream.ComputeMessageSize(4, MessageField);
- }
- if (HasStringPieceField) {
- size += pb::CodedOutputStream.ComputeStringSize(5, StringPieceField);
- }
- if (HasCordField) {
- size += pb::CodedOutputStream.ComputeStringSize(6, CordField);
- }
- foreach (int element in RepeatedPrimitiveFieldList) {
- size += pb::CodedOutputStream
- .ComputeInt32Size(7, element);
- }
- foreach (string element in RepeatedStringFieldList) {
- size += pb::CodedOutputStream
- .ComputeStringSize(8, element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in RepeatedEnumFieldList) {
- size += pb::CodedOutputStream
- .ComputeEnumSize(9, (int) element);
- }
- foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedMessageFieldList) {
- size += pb::CodedOutputStream.ComputeMessageSize(10, element);
- }
- foreach (string element in RepeatedStringPieceFieldList) {
- size += pb::CodedOutputStream
- .ComputeStringSize(11, element);
- }
- foreach (string element in RepeatedCordFieldList) {
- size += pb::CodedOutputStream
- .ComputeStringSize(12, element);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames result = new global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames BuildPartial() {
- result.repeatedPrimitiveField_.MakeReadOnly();
- result.repeatedStringField_.MakeReadOnly();
- result.repeatedEnumField_ = pbc::Lists.AsReadOnly(result.repeatedEnumField_);
- result.repeatedMessageField_.MakeReadOnly();
- result.repeatedStringPieceField_.MakeReadOnly();
- result.repeatedCordField_.MakeReadOnly();
- global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance) return this;
- if (other.HasPrimitiveField) {
- PrimitiveField = other.PrimitiveField;
- }
- if (other.HasStringField) {
- StringField = other.StringField;
- }
- if (other.HasEnumField) {
- EnumField = other.EnumField;
- }
- if (other.HasMessageField) {
- MergeMessageField(other.MessageField);
- }
- if (other.HasStringPieceField) {
- StringPieceField = other.StringPieceField;
- }
- if (other.HasCordField) {
- CordField = other.CordField;
- }
- if (other.repeatedPrimitiveField_.Count != 0) {
- base.AddRange(other.repeatedPrimitiveField_, result.repeatedPrimitiveField_);
- }
- if (other.repeatedStringField_.Count != 0) {
- base.AddRange(other.repeatedStringField_, result.repeatedStringField_);
- }
- if (other.repeatedEnumField_.Count != 0) {
- if (result.repeatedEnumField_.Count == 0) {
- result.repeatedEnumField_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>();
- }
- base.AddRange(other.repeatedEnumField_, result.repeatedEnumField_);
- }
- if (other.repeatedMessageField_.Count != 0) {
- base.AddRange(other.repeatedMessageField_, result.repeatedMessageField_);
- }
- if (other.repeatedStringPieceField_.Count != 0) {
- base.AddRange(other.repeatedStringPieceField_, result.repeatedStringPieceField_);
- }
- if (other.repeatedCordField_.Count != 0) {
- base.AddRange(other.repeatedCordField_, result.repeatedCordField_);
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- PrimitiveField = input.ReadInt32();
- break;
- }
- case 18: {
- StringField = input.ReadString();
- break;
- }
- case 24: {
- int rawValue = input.ReadEnum();
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ForeignEnum), rawValue)) {
- unknownFields.MergeVarintField(3, (ulong) rawValue);
- } else {
- EnumField = (global::Google.ProtocolBuffers.TestProtos.ForeignEnum) rawValue;
- }
- break;
- }
- case 34: {
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder();
- if (HasMessageField) {
- subBuilder.MergeFrom(MessageField);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- MessageField = subBuilder.BuildPartial();
- break;
- }
- case 42: {
- StringPieceField = input.ReadString();
- break;
- }
- case 50: {
- CordField = input.ReadString();
- break;
- }
- case 56: {
- AddRepeatedPrimitiveField(input.ReadInt32());
- break;
- }
- case 66: {
- AddRepeatedStringField(input.ReadString());
- break;
- }
- case 72: {
- int rawValue = input.ReadEnum();
- global::Google.ProtocolBuffers.TestProtos.ForeignEnum value = (global::Google.ProtocolBuffers.TestProtos.ForeignEnum) rawValue;
- if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.ForeignEnum), value)) {
- unknownFields.MergeVarintField(9, (ulong) rawValue);
- } else {
- AddRepeatedEnumField(value);
- }
- break;
- }
- case 82: {
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder();
- input.ReadMessage(subBuilder, extensionRegistry);
- AddRepeatedMessageField(subBuilder.BuildPartial());
- break;
- }
- case 90: {
- AddRepeatedStringPieceField(input.ReadString());
- break;
- }
- case 98: {
- AddRepeatedCordField(input.ReadString());
- break;
- }
- }
- }
- }
-
-
- // optional int32 PrimitiveField = 1;
- public bool HasPrimitiveField {
- get { return result.HasPrimitiveField; }
- }
- public int PrimitiveField {
- get { return result.PrimitiveField; }
- set { SetPrimitiveField(value); }
- }
- public Builder SetPrimitiveField(int value) {
- result.hasPrimitiveField = true;
- result.primitiveField_ = value;
- return this;
- }
- public Builder ClearPrimitiveField() {
- result.hasPrimitiveField = false;
- result.primitiveField_ = 0;
- return this;
- }
-
- // optional string StringField = 2;
- public bool HasStringField {
- get { return result.HasStringField; }
- }
- public string StringField {
- get { return result.StringField; }
- set { SetStringField(value); }
- }
- public Builder SetStringField(string value) {
- result.hasStringField = true;
- result.stringField_ = value;
- return this;
- }
- public Builder ClearStringField() {
- result.hasStringField = false;
- result.stringField_ = "";
- return this;
- }
-
- // optional .protobuf_unittest.ForeignEnum EnumField = 3;
- public bool HasEnumField {
- get { return result.HasEnumField; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField {
- get { return result.EnumField; }
- set { SetEnumField(value); }
- }
- public Builder SetEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- result.hasEnumField = true;
- result.enumField_ = value;
- return this;
- }
- public Builder ClearEnumField() {
- result.hasEnumField = false;
- result.enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO;
- return this;
- }
-
- // optional .protobuf_unittest.ForeignMessage MessageField = 4;
- public bool HasMessageField {
- get { return result.HasMessageField; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField {
- get { return result.MessageField; }
- set { SetMessageField(value); }
- }
- public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.hasMessageField = true;
- result.messageField_ = value;
- return this;
- }
- public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.hasMessageField = true;
- result.messageField_ = builderForValue.Build();
- return this;
- }
- public Builder MergeMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- if (result.HasMessageField &&
- result.messageField_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) {
- result.messageField_ =
- global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageField_).MergeFrom(value).BuildPartial();
- } else {
- result.messageField_ = value;
- }
- result.hasMessageField = true;
- return this;
- }
- public Builder ClearMessageField() {
- result.hasMessageField = false;
- result.messageField_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
- return this;
- }
-
- // optional string StringPieceField = 5 [ctype = STRING_PIECE];
- public bool HasStringPieceField {
- get { return result.HasStringPieceField; }
- }
- public string StringPieceField {
- get { return result.StringPieceField; }
- set { SetStringPieceField(value); }
- }
- public Builder SetStringPieceField(string value) {
- result.hasStringPieceField = true;
- result.stringPieceField_ = value;
- return this;
- }
- public Builder ClearStringPieceField() {
- result.hasStringPieceField = false;
- result.stringPieceField_ = "";
- return this;
- }
-
- // optional string CordField = 6 [ctype = CORD];
- public bool HasCordField {
- get { return result.HasCordField; }
- }
- public string CordField {
- get { return result.CordField; }
- set { SetCordField(value); }
- }
- public Builder SetCordField(string value) {
- result.hasCordField = true;
- result.cordField_ = value;
- return this;
- }
- public Builder ClearCordField() {
- result.hasCordField = false;
- result.cordField_ = "";
- return this;
- }
-
- // repeated int32 RepeatedPrimitiveField = 7;
- public scg::IList<int> RepeatedPrimitiveFieldList {
- get { return result.repeatedPrimitiveField_; }
- }
- public int RepeatedPrimitiveFieldCount {
- get { return result.RepeatedPrimitiveFieldCount; }
- }
- public int GetRepeatedPrimitiveField(int index) {
- return result.GetRepeatedPrimitiveField(index);
- }
- public Builder SetRepeatedPrimitiveField(int index, int value) {
- result.repeatedPrimitiveField_[index] = value;
- return this;
- }
- public Builder AddRepeatedPrimitiveField(int value) {
- result.repeatedPrimitiveField_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedPrimitiveField(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedPrimitiveField_);
- return this;
- }
- public Builder ClearRepeatedPrimitiveField() {
- result.repeatedPrimitiveField_.Clear();
- return this;
- }
-
- // repeated string RepeatedStringField = 8;
- public scg::IList<string> RepeatedStringFieldList {
- get { return result.repeatedStringField_; }
- }
- public int RepeatedStringFieldCount {
- get { return result.RepeatedStringFieldCount; }
- }
- public string GetRepeatedStringField(int index) {
- return result.GetRepeatedStringField(index);
- }
- public Builder SetRepeatedStringField(int index, string value) {
- result.repeatedStringField_[index] = value;
- return this;
- }
- public Builder AddRepeatedStringField(string value) {
- result.repeatedStringField_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedStringField(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedStringField_);
- return this;
- }
- public Builder ClearRepeatedStringField() {
- result.repeatedStringField_.Clear();
- return this;
- }
-
- // repeated .protobuf_unittest.ForeignEnum RepeatedEnumField = 9;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> RepeatedEnumFieldList {
- get { return pbc::Lists.AsReadOnly(result.repeatedEnumField_); }
- }
- public int RepeatedEnumFieldCount {
- get { return result.RepeatedEnumFieldCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) {
- return result.GetRepeatedEnumField(index);
- }
- public Builder SetRepeatedEnumField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- result.repeatedEnumField_[index] = value;
- return this;
- }
- public Builder AddRepeatedEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) {
- if (result.repeatedEnumField_.Count == 0) {
- result.repeatedEnumField_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>();
- }
- result.repeatedEnumField_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedEnumField(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> values) {
- if (result.repeatedEnumField_.Count == 0) {
- result.repeatedEnumField_ = new scg::List<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>();
- }
- base.AddRange(values, result.repeatedEnumField_);
- return this;
- }
- public Builder ClearRepeatedEnumField() {
- result.repeatedEnumField_ = pbc::Lists<global::Google.ProtocolBuffers.TestProtos.ForeignEnum>.Empty;
- return this;
- }
-
- // repeated .protobuf_unittest.ForeignMessage RepeatedMessageField = 10;
- public scg::IList<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> RepeatedMessageFieldList {
- get { return result.repeatedMessageField_; }
- }
- public int RepeatedMessageFieldCount {
- get { return result.RepeatedMessageFieldCount; }
- }
- public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) {
- return result.GetRepeatedMessageField(index);
- }
- public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.repeatedMessageField_[index] = value;
- return this;
- }
- public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.repeatedMessageField_[index] = builderForValue.Build();
- return this;
- }
- public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
- result.repeatedMessageField_.Add(value);
- return this;
- }
- public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
- result.repeatedMessageField_.Add(builderForValue.Build());
- return this;
- }
- public Builder AddRangeRepeatedMessageField(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> values) {
- base.AddRange(values, result.repeatedMessageField_);
- return this;
- }
- public Builder ClearRepeatedMessageField() {
- result.repeatedMessageField_.Clear();
- return this;
- }
-
- // repeated string RepeatedStringPieceField = 11 [ctype = STRING_PIECE];
- public scg::IList<string> RepeatedStringPieceFieldList {
- get { return result.repeatedStringPieceField_; }
- }
- public int RepeatedStringPieceFieldCount {
- get { return result.RepeatedStringPieceFieldCount; }
- }
- public string GetRepeatedStringPieceField(int index) {
- return result.GetRepeatedStringPieceField(index);
- }
- public Builder SetRepeatedStringPieceField(int index, string value) {
- result.repeatedStringPieceField_[index] = value;
- return this;
- }
- public Builder AddRepeatedStringPieceField(string value) {
- result.repeatedStringPieceField_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedStringPieceField(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedStringPieceField_);
- return this;
- }
- public Builder ClearRepeatedStringPieceField() {
- result.repeatedStringPieceField_.Clear();
- return this;
- }
-
- // repeated string RepeatedCordField = 12 [ctype = CORD];
- public scg::IList<string> RepeatedCordFieldList {
- get { return result.repeatedCordField_; }
- }
- public int RepeatedCordFieldCount {
- get { return result.RepeatedCordFieldCount; }
- }
- public string GetRepeatedCordField(int index) {
- return result.GetRepeatedCordField(index);
- }
- public Builder SetRepeatedCordField(int index, string value) {
- result.repeatedCordField_[index] = value;
- return this;
- }
- public Builder AddRepeatedCordField(string value) {
- result.repeatedCordField_.Add(value);
- return this;
- }
- public Builder AddRangeRepeatedCordField(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedCordField_);
- return this;
- }
- public Builder ClearRepeatedCordField() {
- result.repeatedCordField_.Clear();
- return this;
- }
- }
- }
-
- public sealed partial class TestFieldOrderings : pb::ExtendableMessage<TestFieldOrderings, TestFieldOrderings.Builder> {
- private static readonly TestFieldOrderings defaultInstance = new Builder().BuildPartial();
- public static TestFieldOrderings DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestFieldOrderings DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestFieldOrderings ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestFieldOrderings, TestFieldOrderings.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; }
- }
-
- // optional string my_string = 11;
- private bool hasMyString;
- private string myString_ = "";
- public bool HasMyString {
- get { return hasMyString; }
- }
- public string MyString {
- get { return myString_; }
- }
-
- // optional int64 my_int = 1;
- private bool hasMyInt;
- private long myInt_ = 0L;
- public bool HasMyInt {
- get { return hasMyInt; }
- }
- public long MyInt {
- get { return myInt_; }
- }
-
- // optional float my_float = 101;
- private bool hasMyFloat;
- private float myFloat_ = 0F;
- public bool HasMyFloat {
- get { return hasMyFloat; }
- }
- public float MyFloat {
- get { return myFloat_; }
- }
-
- public override bool IsInitialized {
- get {
- if (!ExtensionsAreInitialized) return false;
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- pb::ExtendableMessage<TestFieldOrderings, TestFieldOrderings.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
- if (HasMyInt) {
- output.WriteInt64(1, MyInt);
- }
- extensionWriter.WriteUntil(11, output);
- if (HasMyString) {
- output.WriteString(11, MyString);
- }
- extensionWriter.WriteUntil(101, output);
- if (HasMyFloat) {
- output.WriteFloat(101, MyFloat);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasMyInt) {
- size += pb::CodedOutputStream.ComputeInt64Size(1, MyInt);
- }
- if (HasMyString) {
- size += pb::CodedOutputStream.ComputeStringSize(11, MyString);
- }
- if (HasMyFloat) {
- size += pb::CodedOutputStream.ComputeFloatSize(101, MyFloat);
- }
- size += ExtensionsSerializedSize;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::ExtendableBuilder<global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings, global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings result = new global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance) return this;
- if (other.HasMyString) {
- MyString = other.MyString;
- }
- if (other.HasMyInt) {
- MyInt = other.MyInt;
- }
- if (other.HasMyFloat) {
- MyFloat = other.MyFloat;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 8: {
- MyInt = input.ReadInt64();
- break;
- }
- case 90: {
- MyString = input.ReadString();
- break;
- }
- case 813: {
- MyFloat = input.ReadFloat();
- break;
- }
- }
- }
- }
-
-
- // optional string my_string = 11;
- public bool HasMyString {
- get { return result.HasMyString; }
- }
- public string MyString {
- get { return result.MyString; }
- set { SetMyString(value); }
- }
- public Builder SetMyString(string value) {
- result.hasMyString = true;
- result.myString_ = value;
- return this;
- }
- public Builder ClearMyString() {
- result.hasMyString = false;
- result.myString_ = "";
- return this;
- }
-
- // optional int64 my_int = 1;
- public bool HasMyInt {
- get { return result.HasMyInt; }
- }
- public long MyInt {
- get { return result.MyInt; }
- set { SetMyInt(value); }
- }
- public Builder SetMyInt(long value) {
- result.hasMyInt = true;
- result.myInt_ = value;
- return this;
- }
- public Builder ClearMyInt() {
- result.hasMyInt = false;
- result.myInt_ = 0L;
- return this;
- }
-
- // optional float my_float = 101;
- public bool HasMyFloat {
- get { return result.HasMyFloat; }
- }
- public float MyFloat {
- get { return result.MyFloat; }
- set { SetMyFloat(value); }
- }
- public Builder SetMyFloat(float value) {
- result.hasMyFloat = true;
- result.myFloat_ = value;
- return this;
- }
- public Builder ClearMyFloat() {
- result.hasMyFloat = false;
- result.myFloat_ = 0F;
- return this;
- }
- }
- }
-
- public sealed partial class TestExtremeDefaultValues : pb::GeneratedMessage<TestExtremeDefaultValues, TestExtremeDefaultValues.Builder> {
- private static readonly TestExtremeDefaultValues defaultInstance = new Builder().BuildPartial();
- public static TestExtremeDefaultValues DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override TestExtremeDefaultValues DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override TestExtremeDefaultValues ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<TestExtremeDefaultValues, TestExtremeDefaultValues.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; }
- }
-
- // optional bytes escaped_bytes = 1 [default = "\000\001\007\010\014\n\r\t\013\\\'\"\376"];
- private bool hasEscapedBytes;
- private pb::ByteString escapedBytes_ = ((pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue);
- public bool HasEscapedBytes {
- get { return hasEscapedBytes; }
- }
- public pb::ByteString EscapedBytes {
- get { return escapedBytes_; }
- }
-
- // optional uint32 large_uint32 = 2 [default = 4294967295];
- private bool hasLargeUint32;
- private uint largeUint32_ = 4294967295;
- public bool HasLargeUint32 {
- get { return hasLargeUint32; }
- }
- public uint LargeUint32 {
- get { return largeUint32_; }
- }
-
- // optional uint64 large_uint64 = 3 [default = 18446744073709551615];
- private bool hasLargeUint64;
- private ulong largeUint64_ = 18446744073709551615UL;
- public bool HasLargeUint64 {
- get { return hasLargeUint64; }
- }
- public ulong LargeUint64 {
- get { return largeUint64_; }
- }
-
- // optional int32 small_int32 = 4 [default = -2147483647];
- private bool hasSmallInt32;
- private int smallInt32_ = -2147483647;
- public bool HasSmallInt32 {
- get { return hasSmallInt32; }
- }
- public int SmallInt32 {
- get { return smallInt32_; }
- }
-
- // optional int64 small_int64 = 5 [default = -9223372036854775807];
- private bool hasSmallInt64;
- private long smallInt64_ = -9223372036854775807L;
- public bool HasSmallInt64 {
- get { return hasSmallInt64; }
- }
- public long SmallInt64 {
- get { return smallInt64_; }
- }
-
- // optional string utf8_string = 6 [default = "\341\210\264"];
- private bool hasUtf8String;
- private string utf8String_ = ((string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue);
- public bool HasUtf8String {
- get { return hasUtf8String; }
- }
- public string Utf8String {
- get { return utf8String_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- if (HasEscapedBytes) {
- output.WriteBytes(1, EscapedBytes);
- }
- if (HasLargeUint32) {
- output.WriteUInt32(2, LargeUint32);
- }
- if (HasLargeUint64) {
- output.WriteUInt64(3, LargeUint64);
- }
- if (HasSmallInt32) {
- output.WriteInt32(4, SmallInt32);
- }
- if (HasSmallInt64) {
- output.WriteInt64(5, SmallInt64);
- }
- if (HasUtf8String) {
- output.WriteString(6, Utf8String);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (HasEscapedBytes) {
- size += pb::CodedOutputStream.ComputeBytesSize(1, EscapedBytes);
- }
- if (HasLargeUint32) {
- size += pb::CodedOutputStream.ComputeUInt32Size(2, LargeUint32);
- }
- if (HasLargeUint64) {
- size += pb::CodedOutputStream.ComputeUInt64Size(3, LargeUint64);
- }
- if (HasSmallInt32) {
- size += pb::CodedOutputStream.ComputeInt32Size(4, SmallInt32);
- }
- if (HasSmallInt64) {
- size += pb::CodedOutputStream.ComputeInt64Size(5, SmallInt64);
- }
- if (HasUtf8String) {
- size += pb::CodedOutputStream.ComputeStringSize(6, Utf8String);
- }
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues result = new global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues();
-
- protected override global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance) return this;
- if (other.HasEscapedBytes) {
- EscapedBytes = other.EscapedBytes;
- }
- if (other.HasLargeUint32) {
- LargeUint32 = other.LargeUint32;
- }
- if (other.HasLargeUint64) {
- LargeUint64 = other.LargeUint64;
- }
- if (other.HasSmallInt32) {
- SmallInt32 = other.SmallInt32;
- }
- if (other.HasSmallInt64) {
- SmallInt64 = other.SmallInt64;
- }
- if (other.HasUtf8String) {
- Utf8String = other.Utf8String;
- }
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- case 10: {
- EscapedBytes = input.ReadBytes();
- break;
- }
- case 16: {
- LargeUint32 = input.ReadUInt32();
- break;
- }
- case 24: {
- LargeUint64 = input.ReadUInt64();
- break;
- }
- case 32: {
- SmallInt32 = input.ReadInt32();
- break;
- }
- case 40: {
- SmallInt64 = input.ReadInt64();
- break;
- }
- case 50: {
- Utf8String = input.ReadString();
- break;
- }
- }
- }
- }
-
-
- // optional bytes escaped_bytes = 1 [default = "\000\001\007\010\014\n\r\t\013\\\'\"\376"];
- public bool HasEscapedBytes {
- get { return result.HasEscapedBytes; }
- }
- public pb::ByteString EscapedBytes {
- get { return result.EscapedBytes; }
- set { SetEscapedBytes(value); }
- }
- public Builder SetEscapedBytes(pb::ByteString value) {
- result.hasEscapedBytes = true;
- result.escapedBytes_ = value;
- return this;
- }
- public Builder ClearEscapedBytes() {
- result.hasEscapedBytes = false;
- result.escapedBytes_ = ((pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue);
- return this;
- }
-
- // optional uint32 large_uint32 = 2 [default = 4294967295];
- public bool HasLargeUint32 {
- get { return result.HasLargeUint32; }
- }
- public uint LargeUint32 {
- get { return result.LargeUint32; }
- set { SetLargeUint32(value); }
- }
- public Builder SetLargeUint32(uint value) {
- result.hasLargeUint32 = true;
- result.largeUint32_ = value;
- return this;
- }
- public Builder ClearLargeUint32() {
- result.hasLargeUint32 = false;
- result.largeUint32_ = 4294967295;
- return this;
- }
-
- // optional uint64 large_uint64 = 3 [default = 18446744073709551615];
- public bool HasLargeUint64 {
- get { return result.HasLargeUint64; }
- }
- public ulong LargeUint64 {
- get { return result.LargeUint64; }
- set { SetLargeUint64(value); }
- }
- public Builder SetLargeUint64(ulong value) {
- result.hasLargeUint64 = true;
- result.largeUint64_ = value;
- return this;
- }
- public Builder ClearLargeUint64() {
- result.hasLargeUint64 = false;
- result.largeUint64_ = 18446744073709551615UL;
- return this;
- }
-
- // optional int32 small_int32 = 4 [default = -2147483647];
- public bool HasSmallInt32 {
- get { return result.HasSmallInt32; }
- }
- public int SmallInt32 {
- get { return result.SmallInt32; }
- set { SetSmallInt32(value); }
- }
- public Builder SetSmallInt32(int value) {
- result.hasSmallInt32 = true;
- result.smallInt32_ = value;
- return this;
- }
- public Builder ClearSmallInt32() {
- result.hasSmallInt32 = false;
- result.smallInt32_ = -2147483647;
- return this;
- }
-
- // optional int64 small_int64 = 5 [default = -9223372036854775807];
- public bool HasSmallInt64 {
- get { return result.HasSmallInt64; }
- }
- public long SmallInt64 {
- get { return result.SmallInt64; }
- set { SetSmallInt64(value); }
- }
- public Builder SetSmallInt64(long value) {
- result.hasSmallInt64 = true;
- result.smallInt64_ = value;
- return this;
- }
- public Builder ClearSmallInt64() {
- result.hasSmallInt64 = false;
- result.smallInt64_ = -9223372036854775807L;
- return this;
- }
-
- // optional string utf8_string = 6 [default = "\341\210\264"];
- public bool HasUtf8String {
- get { return result.HasUtf8String; }
- }
- public string Utf8String {
- get { return result.Utf8String; }
- set { SetUtf8String(value); }
- }
- public Builder SetUtf8String(string value) {
- result.hasUtf8String = true;
- result.utf8String_ = value;
- return this;
- }
- public Builder ClearUtf8String() {
- result.hasUtf8String = false;
- result.utf8String_ = ((string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue);
- return this;
- }
- }
- }
-
- public sealed partial class FooRequest : pb::GeneratedMessage<FooRequest, FooRequest.Builder> {
- private static readonly FooRequest defaultInstance = new Builder().BuildPartial();
- public static FooRequest DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override FooRequest DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override FooRequest ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<FooRequest, FooRequest.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooRequest ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.FooRequest prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.FooRequest, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.FooRequest.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.FooRequest result = new global::Google.ProtocolBuffers.TestProtos.FooRequest();
-
- protected override global::Google.ProtocolBuffers.TestProtos.FooRequest MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.FooRequest();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.FooRequest DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.FooRequest BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.FooRequest returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.FooRequest) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.FooRequest) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.FooRequest other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class FooResponse : pb::GeneratedMessage<FooResponse, FooResponse.Builder> {
- private static readonly FooResponse defaultInstance = new Builder().BuildPartial();
- public static FooResponse DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override FooResponse DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override FooResponse ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<FooResponse, FooResponse.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.FooResponse ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.FooResponse prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.FooResponse, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.FooResponse.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.FooResponse result = new global::Google.ProtocolBuffers.TestProtos.FooResponse();
-
- protected override global::Google.ProtocolBuffers.TestProtos.FooResponse MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.FooResponse();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.FooResponse DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.FooResponse BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.FooResponse returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.FooResponse) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.FooResponse) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.FooResponse other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class BarRequest : pb::GeneratedMessage<BarRequest, BarRequest.Builder> {
- private static readonly BarRequest defaultInstance = new Builder().BuildPartial();
- public static BarRequest DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override BarRequest DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override BarRequest ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<BarRequest, BarRequest.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarRequest ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.BarRequest prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.BarRequest, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.BarRequest.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.BarRequest result = new global::Google.ProtocolBuffers.TestProtos.BarRequest();
-
- protected override global::Google.ProtocolBuffers.TestProtos.BarRequest MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.BarRequest();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.BarRequest DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.BarRequest BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.BarRequest returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.BarRequest) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.BarRequest) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.BarRequest other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- public sealed partial class BarResponse : pb::GeneratedMessage<BarResponse, BarResponse.Builder> {
- private static readonly BarResponse defaultInstance = new Builder().BuildPartial();
- public static BarResponse DefaultInstance {
- get { return defaultInstance; }
- }
-
- public override BarResponse DefaultInstanceForType {
- get { return defaultInstance; }
- }
-
- protected override BarResponse ThisMessage {
- get { return this; }
- }
-
- public static pbd::MessageDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__Descriptor; }
- }
-
- protected override pb::FieldAccess.FieldAccessorTable<BarResponse, BarResponse.Builder> InternalFieldAccessors {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
- }
- }
-
- public override void WriteTo(pb::CodedOutputStream output) {
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- }
-
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(pb::ByteString data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(byte[] data,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(
- global::System.IO.Stream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(pb::CodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static global::Google.ProtocolBuffers.TestProtos.BarResponse ParseFrom(pb::CodedInputStream input,
- pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
- .BuildParsed();
- }
-
- public static Builder CreateBuilder() { return new Builder(); }
- public override Builder CreateBuilderForType() { return new Builder(); }
- public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.BarResponse prototype) {
- return (Builder) new Builder().MergeFrom(prototype);
- }
-
- public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.BarResponse, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
-
- // Construct using global::Google.ProtocolBuffers.TestProtos.BarResponse.CreateBuilder()
- public Builder() {}
-
- global::Google.ProtocolBuffers.TestProtos.BarResponse result = new global::Google.ProtocolBuffers.TestProtos.BarResponse();
-
- protected override global::Google.ProtocolBuffers.TestProtos.BarResponse MessageBeingBuilt {
- get { return result; }
- }
-
- public override Builder Clear() {
- result = new global::Google.ProtocolBuffers.TestProtos.BarResponse();
- return this;
- }
-
- public override Builder Clone() {
- return new Builder().MergeFrom(result);
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.Descriptor; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.BarResponse DefaultInstanceForType {
- get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance; }
- }
-
- public override global::Google.ProtocolBuffers.TestProtos.BarResponse BuildPartial() {
- global::Google.ProtocolBuffers.TestProtos.BarResponse returnMe = result;
- result = null;
- return returnMe;
- }
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is global::Google.ProtocolBuffers.TestProtos.BarResponse) {
- return MergeFrom((global::Google.ProtocolBuffers.TestProtos.BarResponse) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
- }
-
- public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.BarResponse other) {
- if (other == global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance) return this;
- this.MergeUnknownFields(other.UnknownFields);
- return this;
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input) {
- return MergeFrom(input, pb::ExtensionRegistry.Empty);
- }
-
- public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- pb::UnknownFieldSet.Builder unknownFields =
- pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- while (true) {
- uint tag = input.ReadTag();
- switch (tag) {
- case 0:
- this.UnknownFields = unknownFields.Build();
- return this;
- default: {
- if (!ParseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.UnknownFields = unknownFields.Build();
- return this;
- }
- break;
- }
- }
- }
- }
-
- }
- }
-
- #endregion
-
- #region Services
- public abstract class TestService : pb::IService {
- public abstract void Foo(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.FooRequest request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done);
- public abstract void Bar(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.BarRequest request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done);
-
- public static pbd::ServiceDescriptor Descriptor {
- get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Services[0]; }
- }
- public pbd::ServiceDescriptor DescriptorForType {
- get { return Descriptor; }
- }
-
- public void CallMethod(
- pbd::MethodDescriptor method,
- pb::IRpcController controller,
- pb::IMessage request,
- global::System.Action<pb::IMessage> done) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.CallMethod() given method descriptor for wrong " +
- "service type.");
- }
- switch(method.Index) {
- case 0:
- this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.FooRequest)request,
- pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse>(
- done));
- return;
- case 1:
- this.Bar(controller, (global::Google.ProtocolBuffers.TestProtos.BarRequest)request,
- pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse>(
- done));
- return;
- default:
- throw new global::System.InvalidOperationException("Can't get here.");
- }
- }
-
- public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.GetRequestPrototype() given method " +
- "descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance;
- case 1:
- return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance;
- default:
- throw new global::System.ArgumentException("Can't get here.");
- }
- }
-
- public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.GetResponsePrototype() given method " +
- "descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance;
- case 1:
- return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance;
- default:
- throw new global::System.ArgumentException("Can't get here.");
- }
- }
-
- public static Stub CreateStub(
- pb::IRpcChannel channel) {
- return new Stub(channel);
- }
-
- public class Stub : global::Google.ProtocolBuffers.TestProtos.TestService {
- internal Stub(pb::IRpcChannel channel) {
- this.channel = channel;
- }
-
- private readonly pb::IRpcChannel channel;
-
- public pb::IRpcChannel Channel {
- get { return channel; }
- }
-
- public override void Foo(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.FooRequest request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done) {
- channel.CallMethod(
- Descriptor.Methods[0],
- controller,
- request,
- global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance,
- pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse, global::Google.ProtocolBuffers.TestProtos.FooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance));
- }
-
- public override void Bar(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.BarRequest request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done) {
- channel.CallMethod(
- Descriptor.Methods[1],
- controller,
- request,
- global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance,
- pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse, global::Google.ProtocolBuffers.TestProtos.BarResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance));
- }
- }
- }
-
- #endregion
-}
diff --git a/csharp/ProtocolBuffers.Test/TestUtil.cs b/csharp/ProtocolBuffers.Test/TestUtil.cs
deleted file mode 100644
index f884b3d2..00000000
--- a/csharp/ProtocolBuffers.Test/TestUtil.cs
+++ /dev/null
@@ -1,1371 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- internal static class TestUtil {
-
- private static string testDataDirectory;
- private static ByteString goldenMessage = null;
-
- internal static string TestDataDirectory {
- get {
- if (testDataDirectory != null) {
- return testDataDirectory;
- }
-
- DirectoryInfo ancestor = new DirectoryInfo(".");
- // Search each parent directory looking for "src/google/protobuf".
- while (ancestor != null) {
- string candidate = Path.Combine(ancestor.FullName, "src/google/protobuf");
- if (Directory.Exists(candidate)) {
- testDataDirectory = Path.Combine(ancestor.FullName, "src/google/protobuf/testdata");
- return testDataDirectory;
- }
- ancestor = ancestor.Parent;
- }
- // TODO(jonskeet): Come up with a better exception to throw
- throw new Exception("Unable to find directory containing test files");
- }
- }
-
- internal static ByteString GoldenMessage {
- get {
- if (goldenMessage == null) {
- goldenMessage = ReadBytesFromFile("golden_message");
- }
- return goldenMessage;
- }
- }
-
- /// <summary>
- /// Creates an unmodifiable ExtensionRegistry containing all the extensions
- /// of TestAllExtensions.
- /// </summary>
- /// <returns></returns>
- internal static ExtensionRegistry CreateExtensionRegistry() {
- ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- RegisterAllExtensions(registry);
- return registry.AsReadOnly();
- }
-
- /// <summary>
- /// Registers all of the extensions in TestAllExtensions with the given
- /// ExtensionRegistry.
- /// </summary>
- internal static void RegisterAllExtensions(ExtensionRegistry registry) {
- registry.Add(UnitTestProtoFile.OptionalInt32Extension);
- registry.Add(UnitTestProtoFile.OptionalInt64Extension);
- registry.Add(UnitTestProtoFile.OptionalUint32Extension);
- registry.Add(UnitTestProtoFile.OptionalUint64Extension);
- registry.Add(UnitTestProtoFile.OptionalSint32Extension);
- registry.Add(UnitTestProtoFile.OptionalSint64Extension);
- registry.Add(UnitTestProtoFile.OptionalFixed32Extension);
- registry.Add(UnitTestProtoFile.OptionalFixed64Extension);
- registry.Add(UnitTestProtoFile.OptionalSfixed32Extension);
- registry.Add(UnitTestProtoFile.OptionalSfixed64Extension);
- registry.Add(UnitTestProtoFile.OptionalFloatExtension);
- registry.Add(UnitTestProtoFile.OptionalDoubleExtension);
- registry.Add(UnitTestProtoFile.OptionalBoolExtension);
- registry.Add(UnitTestProtoFile.OptionalStringExtension);
- registry.Add(UnitTestProtoFile.OptionalBytesExtension);
- registry.Add(UnitTestProtoFile.OptionalGroupExtension);
- registry.Add(UnitTestProtoFile.OptionalNestedMessageExtension);
- registry.Add(UnitTestProtoFile.OptionalForeignMessageExtension);
- registry.Add(UnitTestProtoFile.OptionalImportMessageExtension);
- registry.Add(UnitTestProtoFile.OptionalNestedEnumExtension);
- registry.Add(UnitTestProtoFile.OptionalForeignEnumExtension);
- registry.Add(UnitTestProtoFile.OptionalImportEnumExtension);
- registry.Add(UnitTestProtoFile.OptionalStringPieceExtension);
- registry.Add(UnitTestProtoFile.OptionalCordExtension);
-
- registry.Add(UnitTestProtoFile.RepeatedInt32Extension);
- registry.Add(UnitTestProtoFile.RepeatedInt64Extension);
- registry.Add(UnitTestProtoFile.RepeatedUint32Extension);
- registry.Add(UnitTestProtoFile.RepeatedUint64Extension);
- registry.Add(UnitTestProtoFile.RepeatedSint32Extension);
- registry.Add(UnitTestProtoFile.RepeatedSint64Extension);
- registry.Add(UnitTestProtoFile.RepeatedFixed32Extension);
- registry.Add(UnitTestProtoFile.RepeatedFixed64Extension);
- registry.Add(UnitTestProtoFile.RepeatedSfixed32Extension);
- registry.Add(UnitTestProtoFile.RepeatedSfixed64Extension);
- registry.Add(UnitTestProtoFile.RepeatedFloatExtension);
- registry.Add(UnitTestProtoFile.RepeatedDoubleExtension);
- registry.Add(UnitTestProtoFile.RepeatedBoolExtension);
- registry.Add(UnitTestProtoFile.RepeatedStringExtension);
- registry.Add(UnitTestProtoFile.RepeatedBytesExtension);
- registry.Add(UnitTestProtoFile.RepeatedGroupExtension);
- registry.Add(UnitTestProtoFile.RepeatedNestedMessageExtension);
- registry.Add(UnitTestProtoFile.RepeatedForeignMessageExtension);
- registry.Add(UnitTestProtoFile.RepeatedImportMessageExtension);
- registry.Add(UnitTestProtoFile.RepeatedNestedEnumExtension);
- registry.Add(UnitTestProtoFile.RepeatedForeignEnumExtension);
- registry.Add(UnitTestProtoFile.RepeatedImportEnumExtension);
- registry.Add(UnitTestProtoFile.RepeatedStringPieceExtension);
- registry.Add(UnitTestProtoFile.RepeatedCordExtension);
-
- registry.Add(UnitTestProtoFile.DefaultInt32Extension);
- registry.Add(UnitTestProtoFile.DefaultInt64Extension);
- registry.Add(UnitTestProtoFile.DefaultUint32Extension);
- registry.Add(UnitTestProtoFile.DefaultUint64Extension);
- registry.Add(UnitTestProtoFile.DefaultSint32Extension);
- registry.Add(UnitTestProtoFile.DefaultSint64Extension);
- registry.Add(UnitTestProtoFile.DefaultFixed32Extension);
- registry.Add(UnitTestProtoFile.DefaultFixed64Extension);
- registry.Add(UnitTestProtoFile.DefaultSfixed32Extension);
- registry.Add(UnitTestProtoFile.DefaultSfixed64Extension);
- registry.Add(UnitTestProtoFile.DefaultFloatExtension);
- registry.Add(UnitTestProtoFile.DefaultDoubleExtension);
- registry.Add(UnitTestProtoFile.DefaultBoolExtension);
- registry.Add(UnitTestProtoFile.DefaultStringExtension);
- registry.Add(UnitTestProtoFile.DefaultBytesExtension);
- registry.Add(UnitTestProtoFile.DefaultNestedEnumExtension);
- registry.Add(UnitTestProtoFile.DefaultForeignEnumExtension);
- registry.Add(UnitTestProtoFile.DefaultImportEnumExtension);
- registry.Add(UnitTestProtoFile.DefaultStringPieceExtension);
- registry.Add(UnitTestProtoFile.DefaultCordExtension);
- }
-
- internal static string ReadTextFromFile(string filePath) {
- return ReadBytesFromFile(filePath).ToStringUtf8();
- }
-
- internal static ByteString ReadBytesFromFile(String filename) {
- byte[] data = File.ReadAllBytes(Path.Combine(TestDataDirectory, filename));
- return ByteString.CopyFrom(data);
- }
-
- /// <summary>
- /// Helper to convert a String to ByteString.
- /// </summary>
- internal static ByteString ToBytes(String str) {
- return ByteString.CopyFrom(Encoding.UTF8.GetBytes(str));
- }
-
- internal static TestAllTypes GetAllSet() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- SetAllFields(builder);
- return builder.Build();
- }
-
- /// <summary>
- /// Sets every field of the specified message to the values expected by
- /// AssertAllFieldsSet.
- /// </summary>
- internal static void SetAllFields(TestAllTypes.Builder message) {
- message.SetOptionalInt32(101);
- message.SetOptionalInt64(102);
- message.SetOptionalUint32(103);
- message.SetOptionalUint64(104);
- message.SetOptionalSint32(105);
- message.SetOptionalSint64(106);
- message.SetOptionalFixed32(107);
- message.SetOptionalFixed64(108);
- message.SetOptionalSfixed32(109);
- message.SetOptionalSfixed64(110);
- message.SetOptionalFloat(111);
- message.SetOptionalDouble(112);
- message.SetOptionalBool(true);
- message.SetOptionalString("115");
- message.SetOptionalBytes(ToBytes("116"));
-
- message.SetOptionalGroup(TestAllTypes.Types.OptionalGroup.CreateBuilder().SetA(117).Build());
- message.SetOptionalNestedMessage(TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(118).Build());
- message.SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(119).Build());
- message.SetOptionalImportMessage(ImportMessage.CreateBuilder().SetD(120).Build());
-
- message.SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.BAZ);
- message.SetOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ);
- message.SetOptionalImportEnum(ImportEnum.IMPORT_BAZ);
-
- message.SetOptionalStringPiece("124");
- message.SetOptionalCord("125");
-
- // -----------------------------------------------------------------
-
- message.AddRepeatedInt32(201);
- message.AddRepeatedInt64(202);
- message.AddRepeatedUint32(203);
- message.AddRepeatedUint64(204);
- message.AddRepeatedSint32(205);
- message.AddRepeatedSint64(206);
- message.AddRepeatedFixed32(207);
- message.AddRepeatedFixed64(208);
- message.AddRepeatedSfixed32(209);
- message.AddRepeatedSfixed64(210);
- message.AddRepeatedFloat(211);
- message.AddRepeatedDouble(212);
- message.AddRepeatedBool(true);
- message.AddRepeatedString("215");
- message.AddRepeatedBytes(ToBytes("216"));
-
- message.AddRepeatedGroup(TestAllTypes.Types.RepeatedGroup.CreateBuilder().SetA(217).Build());
- message.AddRepeatedNestedMessage(TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(218).Build());
- message.AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(219).Build());
- message.AddRepeatedImportMessage(ImportMessage.CreateBuilder().SetD(220).Build());
-
- message.AddRepeatedNestedEnum(TestAllTypes.Types.NestedEnum.BAR);
- message.AddRepeatedForeignEnum(ForeignEnum.FOREIGN_BAR);
- message.AddRepeatedImportEnum(ImportEnum.IMPORT_BAR);
-
- message.AddRepeatedStringPiece("224");
- message.AddRepeatedCord("225");
-
- // Add a second one of each field.
- message.AddRepeatedInt32(301);
- message.AddRepeatedInt64(302);
- message.AddRepeatedUint32(303);
- message.AddRepeatedUint64(304);
- message.AddRepeatedSint32(305);
- message.AddRepeatedSint64(306);
- message.AddRepeatedFixed32(307);
- message.AddRepeatedFixed64(308);
- message.AddRepeatedSfixed32(309);
- message.AddRepeatedSfixed64(310);
- message.AddRepeatedFloat(311);
- message.AddRepeatedDouble(312);
- message.AddRepeatedBool(false);
- message.AddRepeatedString("315");
- message.AddRepeatedBytes(ToBytes("316"));
-
- message.AddRepeatedGroup(TestAllTypes.Types.RepeatedGroup.CreateBuilder().SetA(317).Build());
- message.AddRepeatedNestedMessage(TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(318).Build());
- message.AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(319).Build());
- message.AddRepeatedImportMessage(ImportMessage.CreateBuilder().SetD(320).Build());
-
- message.AddRepeatedNestedEnum(TestAllTypes.Types.NestedEnum.BAZ);
- message.AddRepeatedForeignEnum(ForeignEnum.FOREIGN_BAZ);
- message.AddRepeatedImportEnum(ImportEnum.IMPORT_BAZ);
-
- message.AddRepeatedStringPiece("324");
- message.AddRepeatedCord("325");
-
- // -----------------------------------------------------------------
-
- message.SetDefaultInt32(401);
- message.SetDefaultInt64(402);
- message.SetDefaultUint32(403);
- message.SetDefaultUint64(404);
- message.SetDefaultSint32(405);
- message.SetDefaultSint64(406);
- message.SetDefaultFixed32(407);
- message.SetDefaultFixed64(408);
- message.SetDefaultSfixed32(409);
- message.SetDefaultSfixed64(410);
- message.SetDefaultFloat(411);
- message.SetDefaultDouble(412);
- message.SetDefaultBool(false);
- message.SetDefaultString("415");
- message.SetDefaultBytes(ToBytes("416"));
-
- message.SetDefaultNestedEnum(TestAllTypes.Types.NestedEnum.FOO);
- message.SetDefaultForeignEnum(ForeignEnum.FOREIGN_FOO);
- message.SetDefaultImportEnum(ImportEnum.IMPORT_FOO);
-
- message.SetDefaultStringPiece("424");
- message.SetDefaultCord("425");
- }
-
- /// <summary>
- /// Asserts that all fields of the specified message are set to the values
- /// assigned by SetAllFields.
- /// </summary>
- internal static void AssertAllFieldsSet(TestAllTypes message) {
- Assert.IsTrue(message.HasOptionalInt32);
- Assert.IsTrue(message.HasOptionalInt64);
- Assert.IsTrue(message.HasOptionalUint32);
- Assert.IsTrue(message.HasOptionalUint64);
- Assert.IsTrue(message.HasOptionalSint32);
- Assert.IsTrue(message.HasOptionalSint64);
- Assert.IsTrue(message.HasOptionalFixed32);
- Assert.IsTrue(message.HasOptionalFixed64);
- Assert.IsTrue(message.HasOptionalSfixed32);
- Assert.IsTrue(message.HasOptionalSfixed64);
- Assert.IsTrue(message.HasOptionalFloat);
- Assert.IsTrue(message.HasOptionalDouble);
- Assert.IsTrue(message.HasOptionalBool);
- Assert.IsTrue(message.HasOptionalString);
- Assert.IsTrue(message.HasOptionalBytes);
-
- Assert.IsTrue(message.HasOptionalGroup);
- Assert.IsTrue(message.HasOptionalNestedMessage);
- Assert.IsTrue(message.HasOptionalForeignMessage);
- Assert.IsTrue(message.HasOptionalImportMessage);
-
- Assert.IsTrue(message.OptionalGroup.HasA);
- Assert.IsTrue(message.OptionalNestedMessage.HasBb);
- Assert.IsTrue(message.OptionalForeignMessage.HasC);
- Assert.IsTrue(message.OptionalImportMessage.HasD);
-
- Assert.IsTrue(message.HasOptionalNestedEnum);
- Assert.IsTrue(message.HasOptionalForeignEnum);
- Assert.IsTrue(message.HasOptionalImportEnum);
-
- Assert.IsTrue(message.HasOptionalStringPiece);
- Assert.IsTrue(message.HasOptionalCord);
-
- Assert.AreEqual(101, message.OptionalInt32);
- Assert.AreEqual(102, message.OptionalInt64);
- Assert.AreEqual(103, message.OptionalUint32);
- Assert.AreEqual(104, message.OptionalUint64);
- Assert.AreEqual(105, message.OptionalSint32);
- Assert.AreEqual(106, message.OptionalSint64);
- Assert.AreEqual(107, message.OptionalFixed32);
- Assert.AreEqual(108, message.OptionalFixed64);
- Assert.AreEqual(109, message.OptionalSfixed32);
- Assert.AreEqual(110, message.OptionalSfixed64);
- Assert.AreEqual(111, message.OptionalFloat);
- Assert.AreEqual(112, message.OptionalDouble);
- Assert.AreEqual(true, message.OptionalBool);
- Assert.AreEqual("115", message.OptionalString);
- Assert.AreEqual(ToBytes("116"), message.OptionalBytes);
-
- Assert.AreEqual(117, message.OptionalGroup.A);
- Assert.AreEqual(118, message.OptionalNestedMessage.Bb);
- Assert.AreEqual(119, message.OptionalForeignMessage.C);
- Assert.AreEqual(120, message.OptionalImportMessage.D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.OptionalNestedEnum);
- Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.OptionalForeignEnum);
- Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.OptionalImportEnum);
-
- Assert.AreEqual("124", message.OptionalStringPiece);
- Assert.AreEqual("125", message.OptionalCord);
-
- // -----------------------------------------------------------------
-
- Assert.AreEqual(2, message.RepeatedInt32Count);
- Assert.AreEqual(2, message.RepeatedInt64Count);
- Assert.AreEqual(2, message.RepeatedUint32Count);
- Assert.AreEqual(2, message.RepeatedUint64Count);
- Assert.AreEqual(2, message.RepeatedSint32Count);
- Assert.AreEqual(2, message.RepeatedSint64Count);
- Assert.AreEqual(2, message.RepeatedFixed32Count);
- Assert.AreEqual(2, message.RepeatedFixed64Count);
- Assert.AreEqual(2, message.RepeatedSfixed32Count);
- Assert.AreEqual(2, message.RepeatedSfixed64Count);
- Assert.AreEqual(2, message.RepeatedFloatCount);
- Assert.AreEqual(2, message.RepeatedDoubleCount);
- Assert.AreEqual(2, message.RepeatedBoolCount);
- Assert.AreEqual(2, message.RepeatedStringCount);
- Assert.AreEqual(2, message.RepeatedBytesCount);
-
- Assert.AreEqual(2, message.RepeatedGroupCount );
- Assert.AreEqual(2, message.RepeatedNestedMessageCount );
- Assert.AreEqual(2, message.RepeatedForeignMessageCount);
- Assert.AreEqual(2, message.RepeatedImportMessageCount );
- Assert.AreEqual(2, message.RepeatedNestedEnumCount );
- Assert.AreEqual(2, message.RepeatedForeignEnumCount );
- Assert.AreEqual(2, message.RepeatedImportEnumCount );
-
- Assert.AreEqual(2, message.RepeatedStringPieceCount);
- Assert.AreEqual(2, message.RepeatedCordCount);
-
- Assert.AreEqual(201, message.GetRepeatedInt32(0));
- Assert.AreEqual(202, message.GetRepeatedInt64(0));
- Assert.AreEqual(203, message.GetRepeatedUint32(0));
- Assert.AreEqual(204, message.GetRepeatedUint64(0));
- Assert.AreEqual(205, message.GetRepeatedSint32(0));
- Assert.AreEqual(206, message.GetRepeatedSint64(0));
- Assert.AreEqual(207, message.GetRepeatedFixed32(0));
- Assert.AreEqual(208, message.GetRepeatedFixed64(0));
- Assert.AreEqual(209, message.GetRepeatedSfixed32(0));
- Assert.AreEqual(210, message.GetRepeatedSfixed64(0));
- Assert.AreEqual(211, message.GetRepeatedFloat(0));
- Assert.AreEqual(212, message.GetRepeatedDouble(0));
- Assert.AreEqual(true , message.GetRepeatedBool(0));
- Assert.AreEqual("215", message.GetRepeatedString(0));
- Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0));
-
- Assert.AreEqual(217, message.GetRepeatedGroup(0).A);
- Assert.AreEqual(218, message.GetRepeatedNestedMessage (0).Bb);
- Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C);
- Assert.AreEqual(220, message.GetRepeatedImportMessage (0).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum (0));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0));
- Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0));
-
- Assert.AreEqual("224", message.GetRepeatedStringPiece(0));
- Assert.AreEqual("225", message.GetRepeatedCord(0));
-
- Assert.AreEqual(301, message.GetRepeatedInt32 (1));
- Assert.AreEqual(302, message.GetRepeatedInt64 (1));
- Assert.AreEqual(303, message.GetRepeatedUint32 (1));
- Assert.AreEqual(304, message.GetRepeatedUint64 (1));
- Assert.AreEqual(305, message.GetRepeatedSint32 (1));
- Assert.AreEqual(306, message.GetRepeatedSint64 (1));
- Assert.AreEqual(307, message.GetRepeatedFixed32 (1));
- Assert.AreEqual(308, message.GetRepeatedFixed64 (1));
- Assert.AreEqual(309, message.GetRepeatedSfixed32(1));
- Assert.AreEqual(310, message.GetRepeatedSfixed64(1));
- Assert.AreEqual(311, message.GetRepeatedFloat (1), 0.0);
- Assert.AreEqual(312, message.GetRepeatedDouble (1), 0.0);
- Assert.AreEqual(false, message.GetRepeatedBool (1));
- Assert.AreEqual("315", message.GetRepeatedString (1));
- Assert.AreEqual(ToBytes("316"), message.GetRepeatedBytes(1));
-
- Assert.AreEqual(317, message.GetRepeatedGroup (1).A);
- Assert.AreEqual(318, message.GetRepeatedNestedMessage (1).Bb);
- Assert.AreEqual(319, message.GetRepeatedForeignMessage(1).C);
- Assert.AreEqual(320, message.GetRepeatedImportMessage (1).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetRepeatedNestedEnum (1));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetRepeatedForeignEnum(1));
- Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetRepeatedImportEnum(1));
-
- Assert.AreEqual("324", message.GetRepeatedStringPiece(1));
- Assert.AreEqual("325", message.GetRepeatedCord(1));
-
- // -----------------------------------------------------------------
-
- Assert.IsTrue(message.HasDefaultInt32 );
- Assert.IsTrue(message.HasDefaultInt64 );
- Assert.IsTrue(message.HasDefaultUint32 );
- Assert.IsTrue(message.HasDefaultUint64 );
- Assert.IsTrue(message.HasDefaultSint32 );
- Assert.IsTrue(message.HasDefaultSint64 );
- Assert.IsTrue(message.HasDefaultFixed32 );
- Assert.IsTrue(message.HasDefaultFixed64 );
- Assert.IsTrue(message.HasDefaultSfixed32);
- Assert.IsTrue(message.HasDefaultSfixed64);
- Assert.IsTrue(message.HasDefaultFloat );
- Assert.IsTrue(message.HasDefaultDouble );
- Assert.IsTrue(message.HasDefaultBool );
- Assert.IsTrue(message.HasDefaultString );
- Assert.IsTrue(message.HasDefaultBytes );
-
- Assert.IsTrue(message.HasDefaultNestedEnum );
- Assert.IsTrue(message.HasDefaultForeignEnum);
- Assert.IsTrue(message.HasDefaultImportEnum );
-
- Assert.IsTrue(message.HasDefaultStringPiece);
- Assert.IsTrue(message.HasDefaultCord);
-
- Assert.AreEqual(401, message.DefaultInt32);
- Assert.AreEqual(402, message.DefaultInt64);
- Assert.AreEqual(403, message.DefaultUint32);
- Assert.AreEqual(404, message.DefaultUint64);
- Assert.AreEqual(405, message.DefaultSint32);
- Assert.AreEqual(406, message.DefaultSint64);
- Assert.AreEqual(407, message.DefaultFixed32);
- Assert.AreEqual(408, message.DefaultFixed64);
- Assert.AreEqual(409, message.DefaultSfixed32);
- Assert.AreEqual(410, message.DefaultSfixed64);
- Assert.AreEqual(411, message.DefaultFloat);
- Assert.AreEqual(412, message.DefaultDouble);
- Assert.AreEqual(false, message.DefaultBool );
- Assert.AreEqual("415", message.DefaultString );
- Assert.AreEqual(ToBytes("416"), message.DefaultBytes);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.DefaultNestedEnum);
- Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.DefaultForeignEnum);
- Assert.AreEqual(ImportEnum.IMPORT_FOO, message.DefaultImportEnum);
-
- Assert.AreEqual("424", message.DefaultStringPiece);
- Assert.AreEqual("425", message.DefaultCord);
- }
-
- internal static void AssertClear(TestAllTypes message) {
- // HasBlah() should initially be false for all optional fields.
- Assert.IsFalse(message.HasOptionalInt32);
- Assert.IsFalse(message.HasOptionalInt64);
- Assert.IsFalse(message.HasOptionalUint32);
- Assert.IsFalse(message.HasOptionalUint64);
- Assert.IsFalse(message.HasOptionalSint32);
- Assert.IsFalse(message.HasOptionalSint64);
- Assert.IsFalse(message.HasOptionalFixed32);
- Assert.IsFalse(message.HasOptionalFixed64);
- Assert.IsFalse(message.HasOptionalSfixed32);
- Assert.IsFalse(message.HasOptionalSfixed64);
- Assert.IsFalse(message.HasOptionalFloat);
- Assert.IsFalse(message.HasOptionalDouble);
- Assert.IsFalse(message.HasOptionalBool);
- Assert.IsFalse(message.HasOptionalString);
- Assert.IsFalse(message.HasOptionalBytes);
-
- Assert.IsFalse(message.HasOptionalGroup);
- Assert.IsFalse(message.HasOptionalNestedMessage);
- Assert.IsFalse(message.HasOptionalForeignMessage);
- Assert.IsFalse(message.HasOptionalImportMessage);
-
- Assert.IsFalse(message.HasOptionalNestedEnum);
- Assert.IsFalse(message.HasOptionalForeignEnum);
- Assert.IsFalse(message.HasOptionalImportEnum);
-
- Assert.IsFalse(message.HasOptionalStringPiece);
- Assert.IsFalse(message.HasOptionalCord);
-
- // Optional fields without defaults are set to zero or something like it.
- Assert.AreEqual(0, message.OptionalInt32);
- Assert.AreEqual(0, message.OptionalInt64);
- Assert.AreEqual(0, message.OptionalUint32);
- Assert.AreEqual(0, message.OptionalUint64);
- Assert.AreEqual(0, message.OptionalSint32);
- Assert.AreEqual(0, message.OptionalSint64);
- Assert.AreEqual(0, message.OptionalFixed32);
- Assert.AreEqual(0, message.OptionalFixed64);
- Assert.AreEqual(0, message.OptionalSfixed32);
- Assert.AreEqual(0, message.OptionalSfixed64);
- Assert.AreEqual(0, message.OptionalFloat);
- Assert.AreEqual(0, message.OptionalDouble);
- Assert.AreEqual(false, message.OptionalBool);
- Assert.AreEqual("", message.OptionalString);
- Assert.AreEqual(ByteString.Empty, message.OptionalBytes);
-
- // Embedded messages should also be clear.
- Assert.IsFalse(message.OptionalGroup.HasA);
- Assert.IsFalse(message.OptionalNestedMessage.HasBb);
- Assert.IsFalse(message.OptionalForeignMessage.HasC);
- Assert.IsFalse(message.OptionalImportMessage.HasD);
-
- Assert.AreEqual(0, message.OptionalGroup.A);
- Assert.AreEqual(0, message.OptionalNestedMessage.Bb);
- Assert.AreEqual(0, message.OptionalForeignMessage.C);
- Assert.AreEqual(0, message.OptionalImportMessage.D);
-
- // Enums without defaults are set to the first value in the enum.
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum);
- Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.OptionalForeignEnum);
- Assert.AreEqual(ImportEnum.IMPORT_FOO, message.OptionalImportEnum);
-
- Assert.AreEqual("", message.OptionalStringPiece);
- Assert.AreEqual("", message.OptionalCord);
-
- // Repeated fields are empty.
- Assert.AreEqual(0, message.RepeatedInt32Count);
- Assert.AreEqual(0, message.RepeatedInt64Count);
- Assert.AreEqual(0, message.RepeatedUint32Count);
- Assert.AreEqual(0, message.RepeatedUint64Count);
- Assert.AreEqual(0, message.RepeatedSint32Count);
- Assert.AreEqual(0, message.RepeatedSint64Count);
- Assert.AreEqual(0, message.RepeatedFixed32Count);
- Assert.AreEqual(0, message.RepeatedFixed64Count);
- Assert.AreEqual(0, message.RepeatedSfixed32Count);
- Assert.AreEqual(0, message.RepeatedSfixed64Count);
- Assert.AreEqual(0, message.RepeatedFloatCount);
- Assert.AreEqual(0, message.RepeatedDoubleCount);
- Assert.AreEqual(0, message.RepeatedBoolCount);
- Assert.AreEqual(0, message.RepeatedStringCount);
- Assert.AreEqual(0, message.RepeatedBytesCount);
-
- Assert.AreEqual(0, message.RepeatedGroupCount);
- Assert.AreEqual(0, message.RepeatedNestedMessageCount);
- Assert.AreEqual(0, message.RepeatedForeignMessageCount);
- Assert.AreEqual(0, message.RepeatedImportMessageCount);
- Assert.AreEqual(0, message.RepeatedNestedEnumCount);
- Assert.AreEqual(0, message.RepeatedForeignEnumCount);
- Assert.AreEqual(0, message.RepeatedImportEnumCount);
-
- Assert.AreEqual(0, message.RepeatedStringPieceCount);
- Assert.AreEqual(0, message.RepeatedCordCount);
-
- // HasBlah() should also be false for all default fields.
- Assert.IsFalse(message.HasDefaultInt32);
- Assert.IsFalse(message.HasDefaultInt64);
- Assert.IsFalse(message.HasDefaultUint32);
- Assert.IsFalse(message.HasDefaultUint64);
- Assert.IsFalse(message.HasDefaultSint32);
- Assert.IsFalse(message.HasDefaultSint64);
- Assert.IsFalse(message.HasDefaultFixed32);
- Assert.IsFalse(message.HasDefaultFixed64);
- Assert.IsFalse(message.HasDefaultSfixed32);
- Assert.IsFalse(message.HasDefaultSfixed64);
- Assert.IsFalse(message.HasDefaultFloat);
- Assert.IsFalse(message.HasDefaultDouble);
- Assert.IsFalse(message.HasDefaultBool);
- Assert.IsFalse(message.HasDefaultString);
- Assert.IsFalse(message.HasDefaultBytes);
-
- Assert.IsFalse(message.HasDefaultNestedEnum);
- Assert.IsFalse(message.HasDefaultForeignEnum);
- Assert.IsFalse(message.HasDefaultImportEnum);
-
- Assert.IsFalse(message.HasDefaultStringPiece);
- Assert.IsFalse(message.HasDefaultCord);
-
- // Fields with defaults have their default values (duh).
- Assert.AreEqual(41, message.DefaultInt32);
- Assert.AreEqual(42, message.DefaultInt64);
- Assert.AreEqual(43, message.DefaultUint32);
- Assert.AreEqual(44, message.DefaultUint64);
- Assert.AreEqual(-45, message.DefaultSint32);
- Assert.AreEqual(46, message.DefaultSint64);
- Assert.AreEqual(47, message.DefaultFixed32);
- Assert.AreEqual(48, message.DefaultFixed64);
- Assert.AreEqual(49, message.DefaultSfixed32);
- Assert.AreEqual(-50, message.DefaultSfixed64);
- Assert.AreEqual(51.5, message.DefaultFloat, 0.0);
- Assert.AreEqual(52e3, message.DefaultDouble, 0.0);
- Assert.AreEqual(true, message.DefaultBool);
- Assert.AreEqual("hello", message.DefaultString);
- Assert.AreEqual(ToBytes("world"), message.DefaultBytes);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.DefaultNestedEnum);
- Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.DefaultForeignEnum);
- Assert.AreEqual(ImportEnum.IMPORT_BAR, message.DefaultImportEnum);
-
- Assert.AreEqual("abc", message.DefaultStringPiece);
- Assert.AreEqual("123", message.DefaultCord);
- }
-
- /// <summary>
- /// Get a TestAllExtensions with all fields set as they would be by
- /// SetAllExtensions(TestAllExtensions.Builder).
- /// </summary>
- internal static TestAllExtensions GetAllExtensionsSet() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- SetAllExtensions(builder);
- return builder.Build();
- }
-
- /// <summary>
- /// Sets every field of the specified builder to the values expected by
- /// AssertAllExtensionsSet.
- /// </summary>
- internal static void SetAllExtensions(TestAllExtensions.Builder message) {
- message.SetExtension(UnitTestProtoFile.OptionalInt32Extension, 101);
- message.SetExtension(UnitTestProtoFile.OptionalInt64Extension, 102L);
- message.SetExtension(UnitTestProtoFile.OptionalUint32Extension, 103U);
- message.SetExtension(UnitTestProtoFile.OptionalUint64Extension, 104UL);
- message.SetExtension(UnitTestProtoFile.OptionalSint32Extension, 105);
- message.SetExtension(UnitTestProtoFile.OptionalSint64Extension, 106L);
- message.SetExtension(UnitTestProtoFile.OptionalFixed32Extension, 107U);
- message.SetExtension(UnitTestProtoFile.OptionalFixed64Extension, 108UL);
- message.SetExtension(UnitTestProtoFile.OptionalSfixed32Extension, 109);
- message.SetExtension(UnitTestProtoFile.OptionalSfixed64Extension, 110L);
- message.SetExtension(UnitTestProtoFile.OptionalFloatExtension, 111F);
- message.SetExtension(UnitTestProtoFile.OptionalDoubleExtension, 112D);
- message.SetExtension(UnitTestProtoFile.OptionalBoolExtension, true);
- message.SetExtension(UnitTestProtoFile.OptionalStringExtension, "115");
- message.SetExtension(UnitTestProtoFile.OptionalBytesExtension, ToBytes("116"));
-
- message.SetExtension(UnitTestProtoFile.OptionalGroupExtension, OptionalGroup_extension.CreateBuilder().SetA(117).Build());
- message.SetExtension(UnitTestProtoFile.OptionalNestedMessageExtension, TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(118).Build());
- message.SetExtension(UnitTestProtoFile.OptionalForeignMessageExtension, ForeignMessage.CreateBuilder().SetC(119).Build());
- message.SetExtension(UnitTestProtoFile.OptionalImportMessageExtension, ImportMessage.CreateBuilder().SetD(120).Build());
-
- message.SetExtension(UnitTestProtoFile.OptionalNestedEnumExtension, TestAllTypes.Types.NestedEnum.BAZ);
- message.SetExtension(UnitTestProtoFile.OptionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ);
- message.SetExtension(UnitTestProtoFile.OptionalImportEnumExtension, ImportEnum.IMPORT_BAZ);
-
- message.SetExtension(UnitTestProtoFile.OptionalStringPieceExtension, "124");
- message.SetExtension(UnitTestProtoFile.OptionalCordExtension, "125");
-
- // -----------------------------------------------------------------
-
- message.AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 201);
- message.AddExtension(UnitTestProtoFile.RepeatedInt64Extension, 202L);
- message.AddExtension(UnitTestProtoFile.RepeatedUint32Extension, 203U);
- message.AddExtension(UnitTestProtoFile.RepeatedUint64Extension, 204UL);
- message.AddExtension(UnitTestProtoFile.RepeatedSint32Extension, 205);
- message.AddExtension(UnitTestProtoFile.RepeatedSint64Extension, 206L);
- message.AddExtension(UnitTestProtoFile.RepeatedFixed32Extension, 207U);
- message.AddExtension(UnitTestProtoFile.RepeatedFixed64Extension, 208UL);
- message.AddExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 209);
- message.AddExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 210L);
- message.AddExtension(UnitTestProtoFile.RepeatedFloatExtension, 211F);
- message.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 212D);
- message.AddExtension(UnitTestProtoFile.RepeatedBoolExtension, true);
- message.AddExtension(UnitTestProtoFile.RepeatedStringExtension, "215");
- message.AddExtension(UnitTestProtoFile.RepeatedBytesExtension, ToBytes("216"));
-
- message.AddExtension(UnitTestProtoFile.RepeatedGroupExtension, RepeatedGroup_extension.CreateBuilder().SetA(217).Build());
- message.AddExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(218).Build());
- message.AddExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, ForeignMessage.CreateBuilder().SetC(219).Build());
- message.AddExtension(UnitTestProtoFile.RepeatedImportMessageExtension, ImportMessage.CreateBuilder().SetD(220).Build());
-
- message.AddExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.BAR);
- message.AddExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAR);
- message.AddExtension(UnitTestProtoFile.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAR);
-
- message.AddExtension(UnitTestProtoFile.RepeatedStringPieceExtension, "224");
- message.AddExtension(UnitTestProtoFile.RepeatedCordExtension, "225");
-
- // Add a second one of each field.
- message.AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 301);
- message.AddExtension(UnitTestProtoFile.RepeatedInt64Extension, 302L);
- message.AddExtension(UnitTestProtoFile.RepeatedUint32Extension, 303U);
- message.AddExtension(UnitTestProtoFile.RepeatedUint64Extension, 304UL);
- message.AddExtension(UnitTestProtoFile.RepeatedSint32Extension, 305);
- message.AddExtension(UnitTestProtoFile.RepeatedSint64Extension, 306L);
- message.AddExtension(UnitTestProtoFile.RepeatedFixed32Extension, 307U);
- message.AddExtension(UnitTestProtoFile.RepeatedFixed64Extension, 308UL);
- message.AddExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 309);
- message.AddExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 310L);
- message.AddExtension(UnitTestProtoFile.RepeatedFloatExtension, 311F);
- message.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 312D);
- message.AddExtension(UnitTestProtoFile.RepeatedBoolExtension, false);
- message.AddExtension(UnitTestProtoFile.RepeatedStringExtension, "315");
- message.AddExtension(UnitTestProtoFile.RepeatedBytesExtension, ToBytes("316"));
-
- message.AddExtension(UnitTestProtoFile.RepeatedGroupExtension, RepeatedGroup_extension.CreateBuilder().SetA(317).Build());
- message.AddExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(318).Build());
- message.AddExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, ForeignMessage.CreateBuilder().SetC(319).Build());
- message.AddExtension(UnitTestProtoFile.RepeatedImportMessageExtension, ImportMessage.CreateBuilder().SetD(320).Build());
-
- message.AddExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.BAZ);
- message.AddExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAZ);
- message.AddExtension(UnitTestProtoFile.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAZ);
-
- message.AddExtension(UnitTestProtoFile.RepeatedStringPieceExtension, "324");
- message.AddExtension(UnitTestProtoFile.RepeatedCordExtension, "325");
-
- // -----------------------------------------------------------------
-
- message.SetExtension(UnitTestProtoFile.DefaultInt32Extension, 401);
- message.SetExtension(UnitTestProtoFile.DefaultInt64Extension, 402L);
- message.SetExtension(UnitTestProtoFile.DefaultUint32Extension, 403U);
- message.SetExtension(UnitTestProtoFile.DefaultUint64Extension, 404UL);
- message.SetExtension(UnitTestProtoFile.DefaultSint32Extension, 405);
- message.SetExtension(UnitTestProtoFile.DefaultSint64Extension, 406L);
- message.SetExtension(UnitTestProtoFile.DefaultFixed32Extension, 407U);
- message.SetExtension(UnitTestProtoFile.DefaultFixed64Extension, 408UL);
- message.SetExtension(UnitTestProtoFile.DefaultSfixed32Extension, 409);
- message.SetExtension(UnitTestProtoFile.DefaultSfixed64Extension, 410L);
- message.SetExtension(UnitTestProtoFile.DefaultFloatExtension, 411F);
- message.SetExtension(UnitTestProtoFile.DefaultDoubleExtension, 412D);
- message.SetExtension(UnitTestProtoFile.DefaultBoolExtension, false);
- message.SetExtension(UnitTestProtoFile.DefaultStringExtension, "415");
- message.SetExtension(UnitTestProtoFile.DefaultBytesExtension, ToBytes("416"));
-
- message.SetExtension(UnitTestProtoFile.DefaultNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO);
- message.SetExtension(UnitTestProtoFile.DefaultForeignEnumExtension, ForeignEnum.FOREIGN_FOO);
- message.SetExtension(UnitTestProtoFile.DefaultImportEnumExtension, ImportEnum.IMPORT_FOO);
-
- message.SetExtension(UnitTestProtoFile.DefaultStringPieceExtension, "424");
- message.SetExtension(UnitTestProtoFile.DefaultCordExtension, "425");
- }
-
- internal static void ModifyRepeatedFields(TestAllTypes.Builder message) {
- message.SetRepeatedInt32(1, 501);
- message.SetRepeatedInt64(1, 502);
- message.SetRepeatedUint32(1, 503);
- message.SetRepeatedUint64(1, 504);
- message.SetRepeatedSint32(1, 505);
- message.SetRepeatedSint64(1, 506);
- message.SetRepeatedFixed32(1, 507);
- message.SetRepeatedFixed64(1, 508);
- message.SetRepeatedSfixed32(1, 509);
- message.SetRepeatedSfixed64(1, 510);
- message.SetRepeatedFloat(1, 511);
- message.SetRepeatedDouble(1, 512);
- message.SetRepeatedBool(1, true);
- message.SetRepeatedString(1, "515");
- message.SetRepeatedBytes(1, ToBytes("516"));
-
- message.SetRepeatedGroup(1, TestAllTypes.Types.RepeatedGroup.CreateBuilder().SetA(517).Build());
- message.SetRepeatedNestedMessage(1, TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(518).Build());
- message.SetRepeatedForeignMessage(1, ForeignMessage.CreateBuilder().SetC(519).Build());
- message.SetRepeatedImportMessage(1, ImportMessage.CreateBuilder().SetD(520).Build());
-
- message.SetRepeatedNestedEnum(1, TestAllTypes.Types.NestedEnum.FOO);
- message.SetRepeatedForeignEnum(1, ForeignEnum.FOREIGN_FOO);
- message.SetRepeatedImportEnum(1, ImportEnum.IMPORT_FOO);
-
- message.SetRepeatedStringPiece(1, "524");
- message.SetRepeatedCord(1, "525");
- }
-
- internal static void AssertRepeatedFieldsModified(TestAllTypes message) {
- // ModifyRepeatedFields only sets the second repeated element of each
- // field. In addition to verifying this, we also verify that the first
- // element and size were *not* modified.
- Assert.AreEqual(2, message.RepeatedInt32Count);
- Assert.AreEqual(2, message.RepeatedInt64Count);
- Assert.AreEqual(2, message.RepeatedUint32Count);
- Assert.AreEqual(2, message.RepeatedUint64Count);
- Assert.AreEqual(2, message.RepeatedSint32Count);
- Assert.AreEqual(2, message.RepeatedSint64Count);
- Assert.AreEqual(2, message.RepeatedFixed32Count);
- Assert.AreEqual(2, message.RepeatedFixed64Count);
- Assert.AreEqual(2, message.RepeatedSfixed32Count);
- Assert.AreEqual(2, message.RepeatedSfixed64Count);
- Assert.AreEqual(2, message.RepeatedFloatCount);
- Assert.AreEqual(2, message.RepeatedDoubleCount);
- Assert.AreEqual(2, message.RepeatedBoolCount);
- Assert.AreEqual(2, message.RepeatedStringCount);
- Assert.AreEqual(2, message.RepeatedBytesCount);
-
- Assert.AreEqual(2, message.RepeatedGroupCount);
- Assert.AreEqual(2, message.RepeatedNestedMessageCount);
- Assert.AreEqual(2, message.RepeatedForeignMessageCount);
- Assert.AreEqual(2, message.RepeatedImportMessageCount);
- Assert.AreEqual(2, message.RepeatedNestedEnumCount);
- Assert.AreEqual(2, message.RepeatedForeignEnumCount);
- Assert.AreEqual(2, message.RepeatedImportEnumCount);
-
- Assert.AreEqual(2, message.RepeatedStringPieceCount);
- Assert.AreEqual(2, message.RepeatedCordCount);
-
- Assert.AreEqual(201, message.GetRepeatedInt32(0));
- Assert.AreEqual(202L, message.GetRepeatedInt64(0));
- Assert.AreEqual(203U, message.GetRepeatedUint32(0));
- Assert.AreEqual(204UL, message.GetRepeatedUint64(0));
- Assert.AreEqual(205, message.GetRepeatedSint32(0));
- Assert.AreEqual(206L, message.GetRepeatedSint64(0));
- Assert.AreEqual(207U, message.GetRepeatedFixed32(0));
- Assert.AreEqual(208UL, message.GetRepeatedFixed64(0));
- Assert.AreEqual(209, message.GetRepeatedSfixed32(0));
- Assert.AreEqual(210L, message.GetRepeatedSfixed64(0));
- Assert.AreEqual(211F, message.GetRepeatedFloat(0));
- Assert.AreEqual(212D, message.GetRepeatedDouble(0));
- Assert.AreEqual(true, message.GetRepeatedBool(0));
- Assert.AreEqual("215", message.GetRepeatedString(0));
- Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0));
-
- Assert.AreEqual(217, message.GetRepeatedGroup(0).A);
- Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb);
- Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C);
- Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0));
- Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0));
-
- Assert.AreEqual("224", message.GetRepeatedStringPiece(0));
- Assert.AreEqual("225", message.GetRepeatedCord(0));
-
- // Actually verify the second (modified) elements now.
- Assert.AreEqual(501, message.GetRepeatedInt32(1));
- Assert.AreEqual(502L, message.GetRepeatedInt64(1));
- Assert.AreEqual(503U, message.GetRepeatedUint32(1));
- Assert.AreEqual(504UL, message.GetRepeatedUint64(1));
- Assert.AreEqual(505, message.GetRepeatedSint32(1));
- Assert.AreEqual(506L, message.GetRepeatedSint64(1));
- Assert.AreEqual(507U, message.GetRepeatedFixed32(1));
- Assert.AreEqual(508UL, message.GetRepeatedFixed64(1));
- Assert.AreEqual(509, message.GetRepeatedSfixed32(1));
- Assert.AreEqual(510L, message.GetRepeatedSfixed64(1));
- Assert.AreEqual(511F, message.GetRepeatedFloat(1));
- Assert.AreEqual(512D, message.GetRepeatedDouble(1));
- Assert.AreEqual(true, message.GetRepeatedBool(1));
- Assert.AreEqual("515", message.GetRepeatedString(1));
- Assert.AreEqual(ToBytes("516"), message.GetRepeatedBytes(1));
-
- Assert.AreEqual(517, message.GetRepeatedGroup(1).A);
- Assert.AreEqual(518, message.GetRepeatedNestedMessage(1).Bb);
- Assert.AreEqual(519, message.GetRepeatedForeignMessage(1).C);
- Assert.AreEqual(520, message.GetRepeatedImportMessage(1).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetRepeatedNestedEnum(1));
- Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetRepeatedForeignEnum(1));
- Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetRepeatedImportEnum(1));
-
- Assert.AreEqual("524", message.GetRepeatedStringPiece(1));
- Assert.AreEqual("525", message.GetRepeatedCord(1));
- }
-
- /// <summary>
- /// Helper to assert that sequences are equal.
- /// </summary>
- internal static void AssertEqual<T>(IEnumerable<T> first, IEnumerable<T> second) {
- using (IEnumerator<T> firstEnumerator = first.GetEnumerator()) {
- foreach (T secondElement in second) {
- Assert.IsTrue(firstEnumerator.MoveNext(), "First enumerator ran out of elements too early.");
- Assert.AreEqual(firstEnumerator.Current, secondElement);
- }
- Assert.IsFalse(firstEnumerator.MoveNext(), "Second enumerator ran out of elements too early.");
- }
- }
-
- internal static void AssertEqualBytes(byte[] expected, byte[] actual) {
- Assert.AreEqual(ByteString.CopyFrom(expected), ByteString.CopyFrom(actual));
- }
-
- internal static void AssertAllExtensionsSet(TestAllExtensions message) {
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalInt32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalInt64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalUint32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalUint64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSint32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSint64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalFixed32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalFixed64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSfixed32Extension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSfixed64Extension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalFloatExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalDoubleExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalBoolExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalStringExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalBytesExtension ));
-
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalGroupExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalNestedMessageExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalForeignMessageExtension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalImportMessageExtension ));
-
- Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalGroupExtension ).HasA);
- Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension ).HasBb);
- Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).HasC);
- Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension ).HasD);
-
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalNestedEnumExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalForeignEnumExtension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalImportEnumExtension ));
-
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalStringPieceExtension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalCordExtension));
-
- Assert.AreEqual(101 , message.GetExtension(UnitTestProtoFile.OptionalInt32Extension ));
- Assert.AreEqual(102L , message.GetExtension(UnitTestProtoFile.OptionalInt64Extension ));
- Assert.AreEqual(103U , message.GetExtension(UnitTestProtoFile.OptionalUint32Extension ));
- Assert.AreEqual(104UL , message.GetExtension(UnitTestProtoFile.OptionalUint64Extension ));
- Assert.AreEqual(105 , message.GetExtension(UnitTestProtoFile.OptionalSint32Extension ));
- Assert.AreEqual(106L , message.GetExtension(UnitTestProtoFile.OptionalSint64Extension ));
- Assert.AreEqual(107U , message.GetExtension(UnitTestProtoFile.OptionalFixed32Extension ));
- Assert.AreEqual(108UL , message.GetExtension(UnitTestProtoFile.OptionalFixed64Extension ));
- Assert.AreEqual(109 , message.GetExtension(UnitTestProtoFile.OptionalSfixed32Extension));
- Assert.AreEqual(110L , message.GetExtension(UnitTestProtoFile.OptionalSfixed64Extension));
- Assert.AreEqual(111F , message.GetExtension(UnitTestProtoFile.OptionalFloatExtension ));
- Assert.AreEqual(112D , message.GetExtension(UnitTestProtoFile.OptionalDoubleExtension ));
- Assert.AreEqual(true , message.GetExtension(UnitTestProtoFile.OptionalBoolExtension ));
- Assert.AreEqual("115", message.GetExtension(UnitTestProtoFile.OptionalStringExtension ));
- Assert.AreEqual(ToBytes("116"), message.GetExtension(UnitTestProtoFile.OptionalBytesExtension));
-
- Assert.AreEqual(117, message.GetExtension(UnitTestProtoFile.OptionalGroupExtension ).A);
- Assert.AreEqual(118, message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension ).Bb);
- Assert.AreEqual(119, message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).C);
- Assert.AreEqual(120, message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension ).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(UnitTestProtoFile.OptionalForeignEnumExtension));
- Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetExtension(UnitTestProtoFile.OptionalImportEnumExtension));
-
- Assert.AreEqual("124", message.GetExtension(UnitTestProtoFile.OptionalStringPieceExtension));
- Assert.AreEqual("125", message.GetExtension(UnitTestProtoFile.OptionalCordExtension));
-
- // -----------------------------------------------------------------
-
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt64Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint32Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint64Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint32Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint64Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed32Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed64Extension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed32Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed64Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFloatExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBoolExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBytesExtension ));
-
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedGroupExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedMessageExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignMessageExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportMessageExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedEnumExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignEnumExtension ));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportEnumExtension ));
-
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringPieceExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedCordExtension));
-
- Assert.AreEqual(201 , message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension , 0));
- Assert.AreEqual(202L , message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension , 0));
- Assert.AreEqual(203U , message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension , 0));
- Assert.AreEqual(204UL , message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension , 0));
- Assert.AreEqual(205 , message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension , 0));
- Assert.AreEqual(206L , message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension , 0));
- Assert.AreEqual(207U , message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension , 0));
- Assert.AreEqual(208UL , message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension , 0));
- Assert.AreEqual(209 , message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 0));
- Assert.AreEqual(210L , message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 0));
- Assert.AreEqual(211F , message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension , 0));
- Assert.AreEqual(212D , message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension , 0));
- Assert.AreEqual(true , message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension , 0));
- Assert.AreEqual("215", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension , 0));
- Assert.AreEqual(ToBytes("216"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 0));
-
- Assert.AreEqual(217, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension , 0).A);
- Assert.AreEqual(218, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension , 0).Bb);
- Assert.AreEqual(219, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 0).C);
- Assert.AreEqual(220, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension , 0).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 0));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 0));
- Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 0));
-
- Assert.AreEqual("224", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 0));
- Assert.AreEqual("225", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 0));
-
- Assert.AreEqual(301 , message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension , 1));
- Assert.AreEqual(302L , message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension , 1));
- Assert.AreEqual(303U , message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension , 1));
- Assert.AreEqual(304UL , message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension , 1));
- Assert.AreEqual(305 , message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension , 1));
- Assert.AreEqual(306L , message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension , 1));
- Assert.AreEqual(307U , message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension , 1));
- Assert.AreEqual(308UL , message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension , 1));
- Assert.AreEqual(309 , message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 1));
- Assert.AreEqual(310L , message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 1));
- Assert.AreEqual(311F , message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension , 1));
- Assert.AreEqual(312D , message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension , 1));
- Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension , 1));
- Assert.AreEqual("315", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension , 1));
- Assert.AreEqual(ToBytes("316"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 1));
-
- Assert.AreEqual(317, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension , 1).A);
- Assert.AreEqual(318, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension , 1).Bb);
- Assert.AreEqual(319, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 1).C);
- Assert.AreEqual(320, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension , 1).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 1));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 1));
- Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 1));
-
- Assert.AreEqual("324", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 1));
- Assert.AreEqual("325", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 1));
-
- // -----------------------------------------------------------------
-
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultInt32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultInt64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultUint32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultUint64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSint32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSint64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultFixed32Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultFixed64Extension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSfixed32Extension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSfixed64Extension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultFloatExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultDoubleExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultBoolExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultStringExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultBytesExtension ));
-
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultNestedEnumExtension ));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultForeignEnumExtension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultImportEnumExtension ));
-
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultStringPieceExtension));
- Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultCordExtension));
-
- Assert.AreEqual(401 , message.GetExtension(UnitTestProtoFile.DefaultInt32Extension ));
- Assert.AreEqual(402L , message.GetExtension(UnitTestProtoFile.DefaultInt64Extension ));
- Assert.AreEqual(403U , message.GetExtension(UnitTestProtoFile.DefaultUint32Extension ));
- Assert.AreEqual(404UL , message.GetExtension(UnitTestProtoFile.DefaultUint64Extension ));
- Assert.AreEqual(405 , message.GetExtension(UnitTestProtoFile.DefaultSint32Extension ));
- Assert.AreEqual(406L , message.GetExtension(UnitTestProtoFile.DefaultSint64Extension ));
- Assert.AreEqual(407U , message.GetExtension(UnitTestProtoFile.DefaultFixed32Extension ));
- Assert.AreEqual(408UL , message.GetExtension(UnitTestProtoFile.DefaultFixed64Extension ));
- Assert.AreEqual(409 , message.GetExtension(UnitTestProtoFile.DefaultSfixed32Extension));
- Assert.AreEqual(410L , message.GetExtension(UnitTestProtoFile.DefaultSfixed64Extension));
- Assert.AreEqual(411F , message.GetExtension(UnitTestProtoFile.DefaultFloatExtension ));
- Assert.AreEqual(412D , message.GetExtension(UnitTestProtoFile.DefaultDoubleExtension ));
- Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.DefaultBoolExtension ));
- Assert.AreEqual("415", message.GetExtension(UnitTestProtoFile.DefaultStringExtension ));
- Assert.AreEqual(ToBytes("416"), message.GetExtension(UnitTestProtoFile.DefaultBytesExtension));
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(UnitTestProtoFile.DefaultNestedEnumExtension ));
- Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(UnitTestProtoFile.DefaultForeignEnumExtension));
- Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(UnitTestProtoFile.DefaultImportEnumExtension));
-
- Assert.AreEqual("424", message.GetExtension(UnitTestProtoFile.DefaultStringPieceExtension));
- Assert.AreEqual("425", message.GetExtension(UnitTestProtoFile.DefaultCordExtension));
- }
-
- /// <summary>
- /// Modifies the repeated extensions of the given message to contain the values
- /// expected by AssertRepeatedExtensionsModified.
- /// </summary>
- internal static void ModifyRepeatedExtensions(TestAllExtensions.Builder message) {
- message.SetExtension(UnitTestProtoFile.RepeatedInt32Extension, 1, 501);
- message.SetExtension(UnitTestProtoFile.RepeatedInt64Extension, 1, 502L);
- message.SetExtension(UnitTestProtoFile.RepeatedUint32Extension, 1, 503U);
- message.SetExtension(UnitTestProtoFile.RepeatedUint64Extension, 1, 504UL);
- message.SetExtension(UnitTestProtoFile.RepeatedSint32Extension, 1, 505);
- message.SetExtension(UnitTestProtoFile.RepeatedSint64Extension, 1, 506L);
- message.SetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 1, 507U);
- message.SetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 1, 508UL);
- message.SetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 1, 509);
- message.SetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 1, 510L);
- message.SetExtension(UnitTestProtoFile.RepeatedFloatExtension, 1, 511F);
- message.SetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1, 512D);
- message.SetExtension(UnitTestProtoFile.RepeatedBoolExtension, 1, true);
- message.SetExtension(UnitTestProtoFile.RepeatedStringExtension, 1, "515");
- message.SetExtension(UnitTestProtoFile.RepeatedBytesExtension, 1, ToBytes("516"));
-
- message.SetExtension(UnitTestProtoFile.RepeatedGroupExtension, 1, RepeatedGroup_extension.CreateBuilder().SetA(517).Build());
- message.SetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 1, TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(518).Build());
- message.SetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 1, ForeignMessage.CreateBuilder().SetC(519).Build());
- message.SetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 1, ImportMessage.CreateBuilder().SetD(520).Build());
-
- message.SetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 1, TestAllTypes.Types.NestedEnum.FOO);
- message.SetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 1, ForeignEnum.FOREIGN_FOO);
- message.SetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 1, ImportEnum.IMPORT_FOO);
-
- message.SetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 1, "524");
- message.SetExtension(UnitTestProtoFile.RepeatedCordExtension, 1, "525");
- }
-
- /// <summary>
- /// Asserts that all repeated extensions are set to the values assigned by
- /// SetAllExtensions follwed by ModifyRepeatedExtensions.
- /// </summary>
- internal static void AssertRepeatedExtensionsModified(TestAllExtensions message) {
- // ModifyRepeatedFields only sets the second repeated element of each
- // field. In addition to verifying this, we also verify that the first
- // element and size were *not* modified.
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt64Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint32Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint64Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint32Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint64Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed32Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed64Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed32Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed64Extension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFloatExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBoolExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBytesExtension));
-
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedGroupExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedMessageExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignMessageExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportMessageExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedEnumExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignEnumExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportEnumExtension));
-
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringPieceExtension));
- Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedCordExtension));
-
- Assert.AreEqual(201, message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 0));
- Assert.AreEqual(202L, message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 0));
- Assert.AreEqual(203U, message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 0));
- Assert.AreEqual(204UL, message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 0));
- Assert.AreEqual(205, message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 0));
- Assert.AreEqual(206L, message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 0));
- Assert.AreEqual(207U, message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 0));
- Assert.AreEqual(208UL, message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 0));
- Assert.AreEqual(209, message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 0));
- Assert.AreEqual(210L, message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 0));
- Assert.AreEqual(211F, message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 0));
- Assert.AreEqual(212D, message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 0));
- Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 0));
- Assert.AreEqual("215", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 0));
- Assert.AreEqual(ToBytes("216"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 0));
-
- Assert.AreEqual(217, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension, 0).A);
- Assert.AreEqual(218, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 0).Bb);
- Assert.AreEqual(219, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 0).C);
- Assert.AreEqual(220, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 0).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 0));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 0));
- Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 0));
-
- Assert.AreEqual("224", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 0));
- Assert.AreEqual("225", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 0));
-
- // Actually verify the second (modified) elements now.
- Assert.AreEqual(501, message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 1));
- Assert.AreEqual(502L, message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 1));
- Assert.AreEqual(503U, message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 1));
- Assert.AreEqual(504UL, message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 1));
- Assert.AreEqual(505, message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 1));
- Assert.AreEqual(506L, message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 1));
- Assert.AreEqual(507U, message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 1));
- Assert.AreEqual(508UL, message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 1));
- Assert.AreEqual(509, message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 1));
- Assert.AreEqual(510L, message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 1));
- Assert.AreEqual(511F, message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 1));
- Assert.AreEqual(512D, message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1));
- Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 1));
- Assert.AreEqual("515", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 1));
- Assert.AreEqual(ToBytes("516"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 1));
-
- Assert.AreEqual(517, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension, 1).A);
- Assert.AreEqual(518, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 1).Bb);
- Assert.AreEqual(519, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 1).C);
- Assert.AreEqual(520, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 1).D);
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 1));
- Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 1));
- Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 1));
-
- Assert.AreEqual("524", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 1));
- Assert.AreEqual("525", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 1));
- }
-
- internal static void AssertExtensionsClear(TestAllExtensions message) {
- // HasBlah() should initially be false for all optional fields.
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalInt32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalInt64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalUint32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalUint64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSint32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSint64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalFixed32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalFixed64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSfixed32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSfixed64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalFloatExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalDoubleExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalBoolExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalStringExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalBytesExtension));
-
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalGroupExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalNestedMessageExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalForeignMessageExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalImportMessageExtension));
-
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalNestedEnumExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalForeignEnumExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalImportEnumExtension));
-
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalStringPieceExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalCordExtension));
-
- // Optional fields without defaults are set to zero or something like it.
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalInt32Extension));
- Assert.AreEqual(0L, message.GetExtension(UnitTestProtoFile.OptionalInt64Extension));
- Assert.AreEqual(0U, message.GetExtension(UnitTestProtoFile.OptionalUint32Extension));
- Assert.AreEqual(0UL, message.GetExtension(UnitTestProtoFile.OptionalUint64Extension));
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalSint32Extension));
- Assert.AreEqual(0L, message.GetExtension(UnitTestProtoFile.OptionalSint64Extension));
- Assert.AreEqual(0U, message.GetExtension(UnitTestProtoFile.OptionalFixed32Extension));
- Assert.AreEqual(0UL, message.GetExtension(UnitTestProtoFile.OptionalFixed64Extension));
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalSfixed32Extension));
- Assert.AreEqual(0L, message.GetExtension(UnitTestProtoFile.OptionalSfixed64Extension));
- Assert.AreEqual(0F, message.GetExtension(UnitTestProtoFile.OptionalFloatExtension));
- Assert.AreEqual(0D, message.GetExtension(UnitTestProtoFile.OptionalDoubleExtension));
- Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.OptionalBoolExtension));
- Assert.AreEqual("", message.GetExtension(UnitTestProtoFile.OptionalStringExtension));
- Assert.AreEqual(ByteString.Empty, message.GetExtension(UnitTestProtoFile.OptionalBytesExtension));
-
- // Embedded messages should also be clear.
- Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalGroupExtension).HasA);
- Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension).HasBb);
- Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).HasC);
- Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension).HasD);
-
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalGroupExtension).A);
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension).Bb);
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).C);
- Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension).D);
-
- // Enums without defaults are set to the first value in the enum.
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension));
- Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(UnitTestProtoFile.OptionalForeignEnumExtension));
- Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(UnitTestProtoFile.OptionalImportEnumExtension));
-
- Assert.AreEqual("", message.GetExtension(UnitTestProtoFile.OptionalStringPieceExtension));
- Assert.AreEqual("", message.GetExtension(UnitTestProtoFile.OptionalCordExtension));
-
- // Repeated fields are empty.
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt64Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint32Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint64Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint32Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint64Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed32Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed64Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed32Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed64Extension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedFloatExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedBoolExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedBytesExtension));
-
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedGroupExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedMessageExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignMessageExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportMessageExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedEnumExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignEnumExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportEnumExtension));
-
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringPieceExtension));
- Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedCordExtension));
-
- // HasBlah() should also be false for all default fields.
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultInt32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultInt64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultUint32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultUint64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSint32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSint64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultFixed32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultFixed64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSfixed32Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSfixed64Extension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultFloatExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultDoubleExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultBoolExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultStringExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultBytesExtension));
-
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultNestedEnumExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultForeignEnumExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultImportEnumExtension));
-
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultStringPieceExtension));
- Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultCordExtension));
-
- // Fields with defaults have their default values (duh).
- Assert.AreEqual(41, message.GetExtension(UnitTestProtoFile.DefaultInt32Extension));
- Assert.AreEqual(42L, message.GetExtension(UnitTestProtoFile.DefaultInt64Extension));
- Assert.AreEqual(43U, message.GetExtension(UnitTestProtoFile.DefaultUint32Extension));
- Assert.AreEqual(44UL, message.GetExtension(UnitTestProtoFile.DefaultUint64Extension));
- Assert.AreEqual(-45, message.GetExtension(UnitTestProtoFile.DefaultSint32Extension));
- Assert.AreEqual(46L, message.GetExtension(UnitTestProtoFile.DefaultSint64Extension));
- Assert.AreEqual(47U, message.GetExtension(UnitTestProtoFile.DefaultFixed32Extension));
- Assert.AreEqual(48UL, message.GetExtension(UnitTestProtoFile.DefaultFixed64Extension));
- Assert.AreEqual(49, message.GetExtension(UnitTestProtoFile.DefaultSfixed32Extension));
- Assert.AreEqual(-50L, message.GetExtension(UnitTestProtoFile.DefaultSfixed64Extension));
- Assert.AreEqual(51.5F, message.GetExtension(UnitTestProtoFile.DefaultFloatExtension));
- Assert.AreEqual(52e3D, message.GetExtension(UnitTestProtoFile.DefaultDoubleExtension));
- Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.DefaultBoolExtension));
- Assert.AreEqual("hello", message.GetExtension(UnitTestProtoFile.DefaultStringExtension));
- Assert.AreEqual(ToBytes("world"), message.GetExtension(UnitTestProtoFile.DefaultBytesExtension));
-
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(UnitTestProtoFile.DefaultNestedEnumExtension));
- Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(UnitTestProtoFile.DefaultForeignEnumExtension));
- Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(UnitTestProtoFile.DefaultImportEnumExtension));
-
- Assert.AreEqual("abc", message.GetExtension(UnitTestProtoFile.DefaultStringPieceExtension));
- Assert.AreEqual("123", message.GetExtension(UnitTestProtoFile.DefaultCordExtension));
- }
-
- /// <summary>
- /// Helper to construct a byte array from a bunch of bytes.
- /// </summary>
- internal static byte[] Bytes(params byte[] bytesAsInts) {
- byte[] bytes = new byte[bytesAsInts.Length];
- for (int i = 0; i < bytesAsInts.Length; i++) {
- bytes[i] = (byte)bytesAsInts[i];
- }
- return bytes;
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/TextFormatTest.cs b/csharp/ProtocolBuffers.Test/TextFormatTest.cs
deleted file mode 100644
index 8d30b96c..00000000
--- a/csharp/ProtocolBuffers.Test/TextFormatTest.cs
+++ /dev/null
@@ -1,487 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.IO;
-using System.Text;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class TextFormatTest {
-
- private static readonly string AllFieldsSetText = TestUtil.ReadTextFromFile("text_format_unittest_data.txt");
- private static readonly string AllExtensionsSetText = TestUtil.ReadTextFromFile("text_format_unittest_extensions_data.txt");
-
- /// <summary>
- /// Note that this is slightly different to the Java - 123.0 becomes 123, and 1.23E17 becomes 1.23E+17.
- /// Both of these differences can be parsed by the Java and the C++, and we can parse their output too.
- /// </summary>
- private const string ExoticText =
- "repeated_int32: -1\n" +
- "repeated_int32: -2147483648\n" +
- "repeated_int64: -1\n" +
- "repeated_int64: -9223372036854775808\n" +
- "repeated_uint32: 4294967295\n" +
- "repeated_uint32: 2147483648\n" +
- "repeated_uint64: 18446744073709551615\n" +
- "repeated_uint64: 9223372036854775808\n" +
- "repeated_double: 123\n" +
- "repeated_double: 123.5\n" +
- "repeated_double: 0.125\n" +
- "repeated_double: 1.23E+17\n" +
- "repeated_double: 1.235E+22\n" +
- "repeated_double: 1.235E-18\n" +
- "repeated_double: 123.456789\n" +
- "repeated_double: Infinity\n" +
- "repeated_double: -Infinity\n" +
- "repeated_double: NaN\n" +
- "repeated_string: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"" +
- "\\341\\210\\264\"\n" +
- "repeated_bytes: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\376\"\n";
-
- private const string MessageSetText =
- "[protobuf_unittest.TestMessageSetExtension1] {\n" +
- " i: 123\n" +
- "}\n" +
- "[protobuf_unittest.TestMessageSetExtension2] {\n" +
- " str: \"foo\"\n" +
- "}\n";
-
- /// <summary>
- /// Print TestAllTypes and compare with golden file.
- /// </summary>
- [Test]
- public void PrintMessage() {
- string text = TextFormat.PrintToString(TestUtil.GetAllSet());
- Assert.AreEqual(AllFieldsSetText.Replace("\r\n", "\n"), text.Replace("\r\n", "\n"));
- }
-
- /// <summary>
- /// Print TestAllExtensions and compare with golden file.
- /// </summary>
- [Test]
- public void PrintExtensions() {
- string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet());
-
- Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n"), text.Replace("\r\n", "\n"));
- }
-
- /// <summary>
- /// Test printing of unknown fields in a message.
- /// </summary>
- [Test]
- public void PrintUnknownFields() {
- TestEmptyMessage message =
- TestEmptyMessage.CreateBuilder()
- .SetUnknownFields(
- UnknownFieldSet.CreateBuilder()
- .AddField(5,
- UnknownField.CreateBuilder()
- .AddVarint(1)
- .AddFixed32(2)
- .AddFixed64(3)
- .AddLengthDelimited(ByteString.CopyFromUtf8("4"))
- .AddGroup(
- UnknownFieldSet.CreateBuilder()
- .AddField(10,
- UnknownField.CreateBuilder()
- .AddVarint(5)
- .Build())
- .Build())
- .Build())
- .AddField(8,
- UnknownField.CreateBuilder()
- .AddVarint(1)
- .AddVarint(2)
- .AddVarint(3)
- .Build())
- .AddField(15,
- UnknownField.CreateBuilder()
- .AddVarint(0xABCDEF1234567890L)
- .AddFixed32(0xABCD1234)
- .AddFixed64(0xABCDEF1234567890L)
- .Build())
- .Build())
- .Build();
-
- Assert.AreEqual(
- "5: 1\n" +
- "5: 0x00000002\n" +
- "5: 0x0000000000000003\n" +
- "5: \"4\"\n" +
- "5 {\n" +
- " 10: 5\n" +
- "}\n" +
- "8: 1\n" +
- "8: 2\n" +
- "8: 3\n" +
- "15: 12379813812177893520\n" +
- "15: 0xabcd1234\n" +
- "15: 0xabcdef1234567890\n",
- TextFormat.PrintToString(message));
- }
-
- /// <summary>
- /// Helper to construct a ByteString from a string containing only 8-bit
- /// characters. The characters are converted directly to bytes, *not*
- /// encoded using UTF-8.
- /// </summary>
- private static ByteString Bytes(string str) {
- return ByteString.CopyFrom(Encoding.GetEncoding(28591).GetBytes(str));
- }
-
- [Test]
- public void PrintExotic() {
- IMessage message = TestAllTypes.CreateBuilder()
- // Signed vs. unsigned numbers.
- .AddRepeatedInt32 (-1)
- .AddRepeatedUint32(uint.MaxValue)
- .AddRepeatedInt64 (-1)
- .AddRepeatedUint64(ulong.MaxValue)
-
- .AddRepeatedInt32 (1 << 31)
- .AddRepeatedUint32(1U << 31)
- .AddRepeatedInt64 (1L << 63)
- .AddRepeatedUint64(1UL << 63)
-
- // Floats of various precisions and exponents.
- .AddRepeatedDouble(123)
- .AddRepeatedDouble(123.5)
- .AddRepeatedDouble(0.125)
- .AddRepeatedDouble(123e15)
- .AddRepeatedDouble(123.5e20)
- .AddRepeatedDouble(123.5e-20)
- .AddRepeatedDouble(123.456789)
- .AddRepeatedDouble(Double.PositiveInfinity)
- .AddRepeatedDouble(Double.NegativeInfinity)
- .AddRepeatedDouble(Double.NaN)
-
- // Strings and bytes that needing escaping.
- .AddRepeatedString("\0\u0001\u0007\b\f\n\r\t\v\\\'\"\u1234")
- .AddRepeatedBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\"\u00fe"))
- .Build();
-
- Assert.AreEqual(ExoticText, message.ToString());
- }
-
- [Test]
- public void PrintMessageSet() {
- TestMessageSet messageSet =
- TestMessageSet.CreateBuilder()
- .SetExtension(
- TestMessageSetExtension1.MessageSetExtension,
- TestMessageSetExtension1.CreateBuilder().SetI(123).Build())
- .SetExtension(
- TestMessageSetExtension2.MessageSetExtension,
- TestMessageSetExtension2.CreateBuilder().SetStr("foo").Build())
- .Build();
-
- Assert.AreEqual(MessageSetText, messageSet.ToString());
- }
-
- // =================================================================
-
- [Test]
- public void Parse() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge(AllFieldsSetText, builder);
- TestUtil.AssertAllFieldsSet(builder.Build());
- }
-
- [Test]
- public void ParseReader() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge(new StringReader(AllFieldsSetText), builder);
- TestUtil.AssertAllFieldsSet(builder.Build());
- }
-
- [Test]
- public void ParseExtensions() {
- TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
- TextFormat.Merge(AllExtensionsSetText,
- TestUtil.CreateExtensionRegistry(),
- builder);
- TestUtil.AssertAllExtensionsSet(builder.Build());
- }
-
- [Test]
- public void ParseCompatibility() {
- string original = "repeated_float: inf\n" +
- "repeated_float: -inf\n" +
- "repeated_float: nan\n" +
- "repeated_float: inff\n" +
- "repeated_float: -inff\n" +
- "repeated_float: nanf\n" +
- "repeated_float: 1.0f\n" +
- "repeated_float: infinityf\n" +
- "repeated_float: -Infinityf\n" +
- "repeated_double: infinity\n" +
- "repeated_double: -infinity\n" +
- "repeated_double: nan\n";
- string canonical = "repeated_float: Infinity\n" +
- "repeated_float: -Infinity\n" +
- "repeated_float: NaN\n" +
- "repeated_float: Infinity\n" +
- "repeated_float: -Infinity\n" +
- "repeated_float: NaN\n" +
- "repeated_float: 1\n" + // Java has 1.0; this is fine
- "repeated_float: Infinity\n" +
- "repeated_float: -Infinity\n" +
- "repeated_double: Infinity\n" +
- "repeated_double: -Infinity\n" +
- "repeated_double: NaN\n";
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge(original, builder);
- Assert.AreEqual(canonical, builder.Build().ToString());
- }
-
- [Test]
- public void ParseExotic() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge(ExoticText, builder);
-
- // Too lazy to check things individually. Don't try to debug this
- // if testPrintExotic() is Assert.Failing.
- Assert.AreEqual(ExoticText, builder.Build().ToString());
- }
-
- [Test]
- public void ParseMessageSet() {
- ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance();
- extensionRegistry.Add(TestMessageSetExtension1.MessageSetExtension);
- extensionRegistry.Add(TestMessageSetExtension2.MessageSetExtension);
-
- TestMessageSet.Builder builder = TestMessageSet.CreateBuilder();
- TextFormat.Merge(MessageSetText, extensionRegistry, builder);
- TestMessageSet messageSet = builder.Build();
-
- Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension1.MessageSetExtension));
- Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I);
- Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension2.MessageSetExtension));
- Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str);
- }
-
- [Test]
- public void ParseNumericEnum() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge("optional_nested_enum: 2", builder);
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum);
- }
-
- [Test]
- public void ParseAngleBrackets() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge("OptionalGroup: < a: 1 >", builder);
- Assert.IsTrue(builder.HasOptionalGroup);
- Assert.AreEqual(1, builder.OptionalGroup.A);
- }
-
- [Test]
- public void ParseComment() {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- TextFormat.Merge(
- "# this is a comment\n" +
- "optional_int32: 1 # another comment\n" +
- "optional_int64: 2\n" +
- "# EOF comment", builder);
- Assert.AreEqual(1, builder.OptionalInt32);
- Assert.AreEqual(2, builder.OptionalInt64);
- }
-
-
- private static void AssertParseError(string error, string text) {
- TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
- try {
- TextFormat.Merge(text, TestUtil.CreateExtensionRegistry(), builder);
- Assert.Fail("Expected parse exception.");
- } catch (FormatException e) {
- Assert.AreEqual(error, e.Message);
- }
- }
-
- [Test]
- public void ParseErrors() {
- AssertParseError(
- "1:16: Expected \":\".",
- "optional_int32 123");
- AssertParseError(
- "1:23: Expected identifier.",
- "optional_nested_enum: ?");
- AssertParseError(
- "1:18: Couldn't parse integer: Number must be positive: -1",
- "optional_uint32: -1");
- AssertParseError(
- "1:17: Couldn't parse integer: Number out of range for 32-bit signed " +
- "integer: 82301481290849012385230157",
- "optional_int32: 82301481290849012385230157");
- AssertParseError(
- "1:16: Expected \"true\" or \"false\".",
- "optional_bool: maybe");
- AssertParseError(
- "1:18: Expected string.",
- "optional_string: 123");
- AssertParseError(
- "1:18: String missing ending quote.",
- "optional_string: \"ueoauaoe");
- AssertParseError(
- "1:18: String missing ending quote.",
- "optional_string: \"ueoauaoe\n" +
- "optional_int32: 123");
- AssertParseError(
- "1:18: Invalid escape sequence: '\\z'",
- "optional_string: \"\\z\"");
- AssertParseError(
- "1:18: String missing ending quote.",
- "optional_string: \"ueoauaoe\n" +
- "optional_int32: 123");
- AssertParseError(
- "1:2: Extension \"nosuchext\" not found in the ExtensionRegistry.",
- "[nosuchext]: 123");
- AssertParseError(
- "1:20: Extension \"protobuf_unittest.optional_int32_extension\" does " +
- "not extend message type \"protobuf_unittest.TestAllTypes\".",
- "[protobuf_unittest.optional_int32_extension]: 123");
- AssertParseError(
- "1:1: Message type \"protobuf_unittest.TestAllTypes\" has no field " +
- "named \"nosuchfield\".",
- "nosuchfield: 123");
- AssertParseError(
- "1:21: Expected \">\".",
- "OptionalGroup < a: 1");
- AssertParseError(
- "1:23: Enum type \"protobuf_unittest.TestAllTypes.NestedEnum\" has no " +
- "value named \"NO_SUCH_VALUE\".",
- "optional_nested_enum: NO_SUCH_VALUE");
- AssertParseError(
- "1:23: Enum type \"protobuf_unittest.TestAllTypes.NestedEnum\" has no " +
- "value with number 123.",
- "optional_nested_enum: 123");
-
- // Delimiters must match.
- AssertParseError(
- "1:22: Expected identifier.",
- "OptionalGroup < a: 1 }");
- AssertParseError(
- "1:22: Expected identifier.",
- "OptionalGroup { a: 1 >");
- }
-
- // =================================================================
-
- private static ByteString Bytes(params byte[] bytes) {
- return ByteString.CopyFrom(bytes);
- }
-
- private delegate void FormattingAction();
-
- private static void AssertFormatException(FormattingAction action) {
- try {
- action();
- Assert.Fail("Should have thrown an exception.");
- } catch (FormatException) {
- // success
- }
- }
-
- [Test]
- public void Escape() {
- // Escape sequences.
- Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"",
- TextFormat.EscapeBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\"")));
- Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"",
- TextFormat.EscapeText("\0\u0001\u0007\b\f\n\r\t\v\\\'\""));
- Assert.AreEqual(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""),
- TextFormat.UnescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\""));
- Assert.AreEqual("\0\u0001\u0007\b\f\n\r\t\v\\\'\"",
- TextFormat.UnescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\""));
-
- // Unicode handling.
- Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeText("\u1234"));
- Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeBytes(Bytes(0xe1, 0x88, 0xb4)));
- Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\341\\210\\264"));
- Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\341\\210\\264"));
- Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\xe1\\x88\\xb4"));
- Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\xe1\\x88\\xb4"));
-
- // Errors.
- AssertFormatException(() => TextFormat.UnescapeText("\\x"));
- AssertFormatException(() => TextFormat.UnescapeText("\\z"));
- AssertFormatException(() => TextFormat.UnescapeText("\\"));
- }
-
- [Test]
- public void ParseInteger() {
- Assert.AreEqual( 0, TextFormat.ParseInt32( "0"));
- Assert.AreEqual( 1, TextFormat.ParseInt32( "1"));
- Assert.AreEqual( -1, TextFormat.ParseInt32( "-1"));
- Assert.AreEqual( 12345, TextFormat.ParseInt32( "12345"));
- Assert.AreEqual( -12345, TextFormat.ParseInt32( "-12345"));
- Assert.AreEqual( 2147483647, TextFormat.ParseInt32( "2147483647"));
- Assert.AreEqual(-2147483648, TextFormat.ParseInt32("-2147483648"));
-
- Assert.AreEqual( 0, TextFormat.ParseUInt32( "0"));
- Assert.AreEqual( 1, TextFormat.ParseUInt32( "1"));
- Assert.AreEqual( 12345, TextFormat.ParseUInt32( "12345"));
- Assert.AreEqual( 2147483647, TextFormat.ParseUInt32("2147483647"));
- Assert.AreEqual(2147483648U, TextFormat.ParseUInt32("2147483648"));
- Assert.AreEqual(4294967295U, TextFormat.ParseUInt32("4294967295"));
-
- Assert.AreEqual( 0L, TextFormat.ParseInt64( "0"));
- Assert.AreEqual( 1L, TextFormat.ParseInt64( "1"));
- Assert.AreEqual( -1L, TextFormat.ParseInt64( "-1"));
- Assert.AreEqual( 12345L, TextFormat.ParseInt64( "12345"));
- Assert.AreEqual( -12345L, TextFormat.ParseInt64( "-12345"));
- Assert.AreEqual( 2147483647L, TextFormat.ParseInt64( "2147483647"));
- Assert.AreEqual(-2147483648L, TextFormat.ParseInt64("-2147483648"));
- Assert.AreEqual( 4294967295L, TextFormat.ParseInt64( "4294967295"));
- Assert.AreEqual( 4294967296L, TextFormat.ParseInt64( "4294967296"));
- Assert.AreEqual(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807"));
- Assert.AreEqual(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808"));
-
- Assert.AreEqual( 0L, TextFormat.ParseUInt64( "0"));
- Assert.AreEqual( 1L, TextFormat.ParseUInt64( "1"));
- Assert.AreEqual( 12345L, TextFormat.ParseUInt64( "12345"));
- Assert.AreEqual( 2147483647L, TextFormat.ParseUInt64( "2147483647"));
- Assert.AreEqual( 4294967295L, TextFormat.ParseUInt64( "4294967295"));
- Assert.AreEqual( 4294967296L, TextFormat.ParseUInt64( "4294967296"));
- Assert.AreEqual(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807"));
- Assert.AreEqual(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808"));
- Assert.AreEqual(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615"));
-
- // Hex
- Assert.AreEqual(0x1234abcd, TextFormat.ParseInt32("0x1234abcd"));
- Assert.AreEqual(-0x1234abcd, TextFormat.ParseInt32("-0x1234abcd"));
- Assert.AreEqual(0xffffffffffffffffUL, TextFormat.ParseUInt64("0xffffffffffffffff"));
- Assert.AreEqual(0x7fffffffffffffffL,
- TextFormat.ParseInt64("0x7fffffffffffffff"));
-
- // Octal
- Assert.AreEqual(342391, TextFormat.ParseInt32("01234567"));
-
- // Out-of-range
- AssertFormatException(() => TextFormat.ParseInt32("2147483648"));
- AssertFormatException(() => TextFormat.ParseInt32("-2147483649"));
- AssertFormatException(() => TextFormat.ParseUInt32("4294967296"));
- AssertFormatException(() => TextFormat.ParseUInt32("-1"));
- AssertFormatException(() => TextFormat.ParseInt64("9223372036854775808"));
- AssertFormatException(() => TextFormat.ParseInt64("-9223372036854775809"));
- AssertFormatException(() => TextFormat.ParseUInt64("18446744073709551616"));
- AssertFormatException(() => TextFormat.ParseUInt64("-1"));
- AssertFormatException(() => TextFormat.ParseInt32("abcd"));
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs b/csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs
deleted file mode 100644
index 12ed4120..00000000
--- a/csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs
+++ /dev/null
@@ -1,314 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System;
-using System.Collections.Generic;
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class UnknownFieldSetTest {
-
- private MessageDescriptor descriptor;
- private TestAllTypes allFields;
- private ByteString allFieldsData;
-
- /// <summary>
- /// An empty message that has been parsed from allFieldsData. So, it has
- /// unknown fields of every type.
- /// </summary>
- private TestEmptyMessage emptyMessage;
- private UnknownFieldSet unknownFields;
-
- [SetUp]
- public void SetUp() {
- descriptor = TestAllTypes.Descriptor;
- allFields = TestUtil.GetAllSet();
- allFieldsData = allFields.ToByteString();
- emptyMessage = TestEmptyMessage.ParseFrom(allFieldsData);
- unknownFields = emptyMessage.UnknownFields;
- }
-
- private UnknownField GetField(String name) {
- FieldDescriptor field = descriptor.FindDescriptor<FieldDescriptor>(name);
- Assert.IsNotNull(field);
- return unknownFields.FieldDictionary[field.FieldNumber];
- }
-
- /// <summary>
- /// Constructs a protocol buffer which contains fields with all the same
- /// numbers as allFieldsData except that each field is some other wire
- /// type.
- /// </summary>
- private ByteString GetBizarroData() {
- UnknownFieldSet.Builder bizarroFields = UnknownFieldSet.CreateBuilder();
-
- UnknownField varintField = UnknownField.CreateBuilder().AddVarint(1).Build();
- UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build();
-
- foreach (KeyValuePair<int, UnknownField> entry in unknownFields.FieldDictionary) {
- if (entry.Value.VarintList.Count == 0) {
- // Original field is not a varint, so use a varint.
- bizarroFields.AddField(entry.Key, varintField);
- } else {
- // Original field *is* a varint, so use something else.
- bizarroFields.AddField(entry.Key, fixed32Field);
- }
- }
-
- return bizarroFields.Build().ToByteString();
- }
-
- // =================================================================
-
- [Test]
- public void Varint() {
- UnknownField field = GetField("optional_int32");
- Assert.AreEqual(1, field.VarintList.Count);
- Assert.AreEqual(allFields.OptionalInt32, (long) field.VarintList[0]);
- }
-
- [Test]
- public void Fixed32() {
- UnknownField field = GetField("optional_fixed32");
- Assert.AreEqual(1, field.Fixed32List.Count);
- Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]);
- }
-
- [Test]
- public void Fixed64() {
- UnknownField field = GetField("optional_fixed64");
- Assert.AreEqual(1, field.Fixed64List.Count);
- Assert.AreEqual(allFields.OptionalFixed64, (long) field.Fixed64List[0]);
- }
-
- [Test]
- public void LengthDelimited() {
- UnknownField field = GetField("optional_bytes");
- Assert.AreEqual(1, field.LengthDelimitedList.Count);
- Assert.AreEqual(allFields.OptionalBytes, field.LengthDelimitedList[0]);
- }
-
- [Test]
- public void Group() {
- FieldDescriptor nestedFieldDescriptor =
- TestAllTypes.Types.OptionalGroup.Descriptor.FindDescriptor<FieldDescriptor>("a");
- Assert.IsNotNull(nestedFieldDescriptor);
-
- UnknownField field = GetField("optionalgroup");
- Assert.AreEqual(1, field.GroupList.Count);
-
- UnknownFieldSet group = field.GroupList[0];
- Assert.AreEqual(1, group.FieldDictionary.Count);
- Assert.IsTrue(group.HasField(nestedFieldDescriptor.FieldNumber));
-
- UnknownField nestedField = group[nestedFieldDescriptor.FieldNumber];
- Assert.AreEqual(1, nestedField.VarintList.Count);
- Assert.AreEqual(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]);
- }
-
- [Test]
- public void Serialize() {
- // Check that serializing the UnknownFieldSet produces the original data again.
- ByteString data = emptyMessage.ToByteString();
- Assert.AreEqual(allFieldsData, data);
- }
-
- [Test]
- public void CopyFrom() {
- TestEmptyMessage message =
- TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Build();
-
- Assert.AreEqual(emptyMessage.ToString(), message.ToString());
- }
-
- [Test]
- public void MergeFrom() {
- TestEmptyMessage source =
- TestEmptyMessage.CreateBuilder()
- .SetUnknownFields(
- UnknownFieldSet.CreateBuilder()
- .AddField(2,
- UnknownField.CreateBuilder()
- .AddVarint(2).Build())
- .AddField(3,
- UnknownField.CreateBuilder()
- .AddVarint(4).Build())
- .Build())
- .Build();
- TestEmptyMessage destination =
- TestEmptyMessage.CreateBuilder()
- .SetUnknownFields(
- UnknownFieldSet.CreateBuilder()
- .AddField(1,
- UnknownField.CreateBuilder()
- .AddVarint(1).Build())
- .AddField(3,
- UnknownField.CreateBuilder()
- .AddVarint(3).Build())
- .Build())
- .MergeFrom(source)
- .Build();
-
- Assert.AreEqual(
- "1: 1\n" +
- "2: 2\n" +
- "3: 3\n" +
- "3: 4\n",
- destination.ToString());
- }
-
- [Test]
- public void Clear() {
- UnknownFieldSet fields =
- UnknownFieldSet.CreateBuilder().MergeFrom(unknownFields).Clear().Build();
- Assert.AreEqual(0, fields.FieldDictionary.Count);
- }
-
- [Test]
- public void ClearMessage() {
- TestEmptyMessage message =
- TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Clear().Build();
- Assert.AreEqual(0, message.SerializedSize);
- }
-
- [Test]
- public void ParseKnownAndUnknown() {
- // Test mixing known and unknown fields when parsing.
-
- UnknownFieldSet fields =
- UnknownFieldSet.CreateBuilder(unknownFields)
- .AddField(123456,
- UnknownField.CreateBuilder().AddVarint(654321).Build())
- .Build();
-
- ByteString data = fields.ToByteString();
- TestAllTypes destination = TestAllTypes.ParseFrom(data);
-
- TestUtil.AssertAllFieldsSet(destination);
- Assert.AreEqual(1, destination.UnknownFields.FieldDictionary.Count);
-
- UnknownField field = destination.UnknownFields[123456];
- Assert.AreEqual(1, field.VarintList.Count);
- Assert.AreEqual(654321, (long) field.VarintList[0]);
- }
-
- [Test]
- public void WrongTypeTreatedAsUnknown() {
- // Test that fields of the wrong wire type are treated like unknown fields
- // when parsing.
-
- ByteString bizarroData = GetBizarroData();
- TestAllTypes allTypesMessage = TestAllTypes.ParseFrom(bizarroData);
- TestEmptyMessage emptyMessage = TestEmptyMessage.ParseFrom(bizarroData);
-
- // All fields should have been interpreted as unknown, so the debug strings
- // should be the same.
- Assert.AreEqual(emptyMessage.ToString(), allTypesMessage.ToString());
- }
-
- [Test]
- public void UnknownExtensions() {
- // Make sure fields are properly parsed to the UnknownFieldSet even when
- // they are declared as extension numbers.
-
- TestEmptyMessageWithExtensions message =
- TestEmptyMessageWithExtensions.ParseFrom(allFieldsData);
-
- Assert.AreEqual(unknownFields.FieldDictionary.Count,
- message.UnknownFields.FieldDictionary.Count);
- Assert.AreEqual(allFieldsData, message.ToByteString());
- }
-
- [Test]
- public void WrongExtensionTypeTreatedAsUnknown() {
- // Test that fields of the wrong wire type are treated like unknown fields
- // when parsing extensions.
-
- ByteString bizarroData = GetBizarroData();
- TestAllExtensions allExtensionsMessage = TestAllExtensions.ParseFrom(bizarroData);
- TestEmptyMessage emptyMessage = TestEmptyMessage.ParseFrom(bizarroData);
-
- // All fields should have been interpreted as unknown, so the debug strings
- // should be the same.
- Assert.AreEqual(emptyMessage.ToString(),
- allExtensionsMessage.ToString());
- }
-
- [Test]
- public void ParseUnknownEnumValue() {
- FieldDescriptor singularField = TestAllTypes.Descriptor.FindDescriptor<FieldDescriptor>("optional_nested_enum");
- FieldDescriptor repeatedField = TestAllTypes.Descriptor.FindDescriptor<FieldDescriptor>("repeated_nested_enum");
- Assert.IsNotNull(singularField);
- Assert.IsNotNull(repeatedField);
-
- ByteString data =
- UnknownFieldSet.CreateBuilder()
- .AddField(singularField.FieldNumber,
- UnknownField.CreateBuilder()
- .AddVarint((int) TestAllTypes.Types.NestedEnum.BAR)
- .AddVarint(5) // not valid
- .Build())
- .AddField(repeatedField.FieldNumber,
- UnknownField.CreateBuilder()
- .AddVarint((int) TestAllTypes.Types.NestedEnum.FOO)
- .AddVarint(4) // not valid
- .AddVarint((int) TestAllTypes.Types.NestedEnum.BAZ)
- .AddVarint(6) // not valid
- .Build())
- .Build()
- .ToByteString();
-
- {
- TestAllTypes message = TestAllTypes.ParseFrom(data);
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR,
- message.OptionalNestedEnum);
- TestUtil.AssertEqual(new [] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ},
- message.RepeatedNestedEnumList);
- TestUtil.AssertEqual(new[] {5UL}, message.UnknownFields[singularField.FieldNumber].VarintList);
- TestUtil.AssertEqual(new[] {4UL, 6UL}, message.UnknownFields[repeatedField.FieldNumber].VarintList);
- }
-
- {
- TestAllExtensions message =
- TestAllExtensions.ParseFrom(data, TestUtil.CreateExtensionRegistry());
- Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR,
- message.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension));
- TestUtil.AssertEqual(new[] { TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ },
- message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension));
- TestUtil.AssertEqual(new[] { 5UL }, message.UnknownFields[singularField.FieldNumber].VarintList);
- TestUtil.AssertEqual(new[] { 4UL, 6UL }, message.UnknownFields[repeatedField.FieldNumber].VarintList);
- }
- }
-
- [Test]
- public void LargeVarint() {
- ByteString data =
- UnknownFieldSet.CreateBuilder()
- .AddField(1,
- UnknownField.CreateBuilder()
- .AddVarint(0x7FFFFFFFFFFFFFFFL)
- .Build())
- .Build()
- .ToByteString();
- UnknownFieldSet parsed = UnknownFieldSet.ParseFrom(data);
- UnknownField field = parsed[1];
- Assert.AreEqual(1, field.VarintList.Count);
- Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]);
- }
- }
-}
diff --git a/csharp/ProtocolBuffers.Test/WireFormatTest.cs b/csharp/ProtocolBuffers.Test/WireFormatTest.cs
deleted file mode 100644
index c5fc3e41..00000000
--- a/csharp/ProtocolBuffers.Test/WireFormatTest.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.
-// http://code.google.com/p/protobuf/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-using System.Reflection;
-using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
-
-namespace Google.ProtocolBuffers {
- [TestFixture]
- public class WireFormatTest {
-
- /// <summary>
- /// Keeps the attributes on FieldType and the switch statement in WireFormat in sync.
- /// </summary>
- [Test]
- public void FieldTypeToWireTypeMapping() {
- foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) {
- FieldType fieldType = (FieldType)field.GetValue(null);
- FieldMappingAttribute mapping = (FieldMappingAttribute)field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0];
- Assert.AreEqual(mapping.WireType, WireFormat.GetWireType(fieldType));
- }
- }
-
- [Test]
- public void Serialization() {
- TestAllTypes message = TestUtil.GetAllSet();
-
- ByteString rawBytes = message.ToByteString();
- Assert.AreEqual(rawBytes.Length, message.SerializedSize);
-
- TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes);
-
- TestUtil.AssertAllFieldsSet(message2);
- }
-
- [Test]
- public void SerializeExtensions() {
- // TestAllTypes and TestAllExtensions should have compatible wire formats,
- // so if we serealize a TestAllExtensions then parse it as TestAllTypes
- // it should work.
-
- TestAllExtensions message = TestUtil.GetAllExtensionsSet();
- ByteString rawBytes = message.ToByteString();
- Assert.AreEqual(rawBytes.Length, message.SerializedSize);
-
- TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes);
-
- TestUtil.AssertAllFieldsSet(message2);
- }
-
- [Test]
- public void ParseExtensions() {
- // TestAllTypes and TestAllExtensions should have compatible wire formats,
- // so if we serealize a TestAllTypes then parse it as TestAllExtensions
- // it should work.
-
- TestAllTypes message = TestUtil.GetAllSet();
- ByteString rawBytes = message.ToByteString();
-
- ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- TestUtil.RegisterAllExtensions(registry);
- registry = registry.AsReadOnly();
-
- TestAllExtensions message2 =
- TestAllExtensions.ParseFrom(rawBytes, registry);
-
- TestUtil.AssertAllExtensionsSet(message2);
- }
-
- [Test]
- public void ExtensionsSerializedSize() {
- Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize);
- }
-
- private void AssertFieldsInOrder(ByteString data) {
- CodedInputStream input = data.CreateCodedInput();
- uint previousTag = 0;
-
- while (true) {
- uint tag = input.ReadTag();
- if (tag == 0) {
- break;
- }
-
- Assert.IsTrue(tag > previousTag);
- previousTag = tag;
- input.SkipField(tag);
- }
- }
-
- [Test]
- public void InterleavedFieldsAndExtensions() {
- // Tests that fields are written in order even when extension ranges
- // are interleaved with field numbers.
- ByteString data =
- TestFieldOrderings.CreateBuilder()
- .SetMyInt(1)
- .SetMyString("foo")
- .SetMyFloat(1.0F)
- .SetExtension(UnitTestProtoFile.MyExtensionInt, 23)
- .SetExtension(UnitTestProtoFile.MyExtensionString, "bar")
- .Build().ToByteString();
- AssertFieldsInOrder(data);
-
- MessageDescriptor descriptor = TestFieldOrderings.Descriptor;
- ByteString dynamic_data =
- DynamicMessage.CreateBuilder(TestFieldOrderings.Descriptor)
- .SetField(descriptor.FindDescriptor<FieldDescriptor>("my_int"), 1L)
- .SetField(descriptor.FindDescriptor<FieldDescriptor>("my_string"), "foo")
- .SetField(descriptor.FindDescriptor<FieldDescriptor>("my_float"), 1.0F)
- .SetField(UnitTestProtoFile.MyExtensionInt.Descriptor, 23)
- .SetField(UnitTestProtoFile.MyExtensionString.Descriptor, "bar")
- .WeakBuild().ToByteString();
- AssertFieldsInOrder(dynamic_data);
- }
-
- private const int UnknownTypeId = 1550055;
- private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber;
- private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber;
-
- [Test]
- public void SerializeMessageSet() {
- // Set up a TestMessageSet with two known messages and an unknown one.
- TestMessageSet messageSet =
- TestMessageSet.CreateBuilder()
- .SetExtension(
- TestMessageSetExtension1.MessageSetExtension,
- TestMessageSetExtension1.CreateBuilder().SetI(123).Build())
- .SetExtension(
- TestMessageSetExtension2.MessageSetExtension,
- TestMessageSetExtension2.CreateBuilder().SetStr("foo").Build())
- .SetUnknownFields(
- UnknownFieldSet.CreateBuilder()
- .AddField(UnknownTypeId,
- UnknownField.CreateBuilder()
- .AddLengthDelimited(ByteString.CopyFromUtf8("bar"))
- .Build())
- .Build())
- .Build();
-
- ByteString data = messageSet.ToByteString();
-
- // Parse back using RawMessageSet and check the contents.
- RawMessageSet raw = RawMessageSet.ParseFrom(data);
-
- Assert.AreEqual(0, raw.UnknownFields.FieldDictionary.Count);
-
- Assert.AreEqual(3, raw.ItemCount);
- Assert.AreEqual(TypeId1, raw.ItemList[0].TypeId);
- Assert.AreEqual(TypeId2, raw.ItemList[1].TypeId);
- Assert.AreEqual(UnknownTypeId, raw.ItemList[2].TypeId);
-
- TestMessageSetExtension1 message1 = TestMessageSetExtension1.ParseFrom(raw.GetItem(0).Message.ToByteArray());
- Assert.AreEqual(123, message1.I);
-
- TestMessageSetExtension2 message2 = TestMessageSetExtension2.ParseFrom(raw.GetItem(1).Message.ToByteArray());
- Assert.AreEqual("foo", message2.Str);
-
- Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8());
- }
-
- [Test]
- public void ParseMessageSet() {
- ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance();
- extensionRegistry.Add(TestMessageSetExtension1.MessageSetExtension);
- extensionRegistry.Add(TestMessageSetExtension2.MessageSetExtension);
-
- // Set up a RawMessageSet with two known messages and an unknown one.
- RawMessageSet raw =
- RawMessageSet.CreateBuilder()
- .AddItem(
- RawMessageSet.Types.Item.CreateBuilder()
- .SetTypeId(TypeId1)
- .SetMessage(
- TestMessageSetExtension1.CreateBuilder()
- .SetI(123)
- .Build().ToByteString())
- .Build())
- .AddItem(
- RawMessageSet.Types.Item.CreateBuilder()
- .SetTypeId(TypeId2)
- .SetMessage(
- TestMessageSetExtension2.CreateBuilder()
- .SetStr("foo")
- .Build().ToByteString())
- .Build())
- .AddItem(
- RawMessageSet.Types.Item.CreateBuilder()
- .SetTypeId(UnknownTypeId)
- .SetMessage(ByteString.CopyFromUtf8("bar"))
- .Build())
- .Build();
-
- ByteString data = raw.ToByteString();
-
- // Parse as a TestMessageSet and check the contents.
- TestMessageSet messageSet =
- TestMessageSet.ParseFrom(data, extensionRegistry);
-
- Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I);
- Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str);
-
- // Check for unknown field with type LENGTH_DELIMITED,
- // number UNKNOWN_TYPE_ID, and contents "bar".
- UnknownFieldSet unknownFields = messageSet.UnknownFields;
- Assert.AreEqual(1, unknownFields.FieldDictionary.Count);
- Assert.IsTrue(unknownFields.HasField(UnknownTypeId));
-
- UnknownField field = unknownFields[UnknownTypeId];
- Assert.AreEqual(1, field.LengthDelimitedList.Count);
- Assert.AreEqual("bar", field.LengthDelimitedList[0].ToStringUtf8());
- }
-
- }
-}