diff options
6 files changed, 3780 insertions, 807 deletions
diff --git a/csharp/protos/google/protobuf/field_presence_test.proto b/csharp/protos/google/protobuf/field_presence_test.proto deleted file mode 100644 index 14d91312..00000000 --- a/csharp/protos/google/protobuf/field_presence_test.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -package Google.ProtocolBuffers.TestProtos.FieldPresence; - -// TODO(jieluo): Add repeated fields, oneof, maps to TestAllTypes -message TestAllTypes { - enum NestedEnum { - FOO = 0; - BAR = 1; - BAZ = 2; - } - message NestedMessage { - optional int32 value = 1; - } - - optional int32 optional_int32 = 1; - optional string optional_string = 2; - optional bytes optional_bytes = 3; - optional NestedEnum optional_nested_enum = 4; - optional NestedMessage optional_nested_message = 5; -} diff --git a/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs b/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs index 9c1fc6af..8f59334e 100644 --- a/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs +++ b/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs @@ -33,7 +33,7 @@ using System;
using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.TestProtos.FieldPresence;
+using Google.ProtocolBuffers.TestProtos.Proto3;
using NUnit.Framework;
namespace Google.ProtocolBuffers
@@ -177,7 +177,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(ByteString.Empty, message.OptionalBytes);
Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum);
Assert.IsTrue(message.HasOptionalNestedMessage);
- Assert.AreEqual(0, message.OptionalNestedMessage.Value);
+ Assert.AreEqual(0, message.OptionalNestedMessage.Bb);
}
}
}
diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index dd28f34a..b4c562d1 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -84,7 +84,6 @@ <Compile Include="Compatibility\TestResources.cs" />
<Compile Include="Compatibility\TextCompatibilityTests.cs" />
<Compile Include="Compatibility\XmlCompatibilityTests.cs" />
- <Compile Include="TestProtos\FieldPresenceTest.cs" />
<Compile Include="TestProtos\GoogleSize.cs" />
<Compile Include="TestProtos\GoogleSpeed.cs" />
<Compile Include="TestProtos\Unittest.cs" />
@@ -96,6 +95,7 @@ <Compile Include="TestProtos\UnittestImportPublic.cs" />
<Compile Include="TestProtos\UnittestIssues.cs" />
<Compile Include="TestProtos\UnittestMset.cs" />
+ <Compile Include="TestProtos\UnittestNoFieldPresence.cs" />
<Compile Include="TestProtos\UnittestOptimizeFor.cs" />
<Compile Include="TestProtos\UnknownEnumTest.cs" />
<Compile Include="TestResources.cs" />
diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs deleted file mode 100644 index b4cb279d..00000000 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs +++ /dev/null @@ -1,782 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protos/google/protobuf/field_presence_test.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -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.FieldPresence { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class FieldPresenceTest { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Builder> internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder> internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static FieldPresenceTest() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", - "cHJvdG8SL0dvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcy5GaWVs", - "ZFByZXNlbmNlIvYCCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIY", - "ASABKAUSFwoPb3B0aW9uYWxfc3RyaW5nGAIgASgJEhYKDm9wdGlvbmFsX2J5", - "dGVzGAMgASgMEmYKFG9wdGlvbmFsX25lc3RlZF9lbnVtGAQgASgOMkguR29v", - "Z2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zLkZpZWxkUHJlc2VuY2Uu", - "VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SbAoXb3B0aW9uYWxfbmVzdGVkX21l", - "c3NhZ2UYBSABKAsySy5Hb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90", - "b3MuRmllbGRQcmVzZW5jZS5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRoe", - "Cg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3RlZEVudW0S", - "BwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJiBnByb3RvMw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Builder>(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor = internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder>(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Value", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage<TestAllTypes, TestAllTypes.Builder> { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; - 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.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable<TestAllTypes, TestAllTypes.Builder> InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage<NestedMessage, NestedMessage.Builder> { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - 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.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable<NestedMessage, NestedMessage.Builder> InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private int value_; - public int Value { - get { return value_; } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (Value != 0) { - output.WriteInt32(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (Value != 0) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder<NestedMessage, Builder> { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.Value != 0) { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - input.ReadInt32(ref result.value_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(int value) { - PrepareBuilder(); - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.value_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private int optionalInt32_; - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalStringFieldNumber = 2; - private string optionalString_ = ""; - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 3; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalNestedEnumFieldNumber = 4; - private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalNestedMessageFieldNumber = 5; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (OptionalInt32 != 0) { - output.WriteInt32(1, field_names[1], OptionalInt32); - } - if (OptionalString != "") { - output.WriteString(2, field_names[4], OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) { - output.WriteBytes(3, field_names[0], OptionalBytes); - } - if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - output.WriteEnum(4, field_names[2], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(5, field_names[3], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (OptionalInt32 != 0) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (OptionalString != "") { - size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) { - size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); - } - if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) OptionalNestedEnum); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder<TestAllTypes, Builder> { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.OptionalInt32 != 0) { - OptionalInt32 = other.OptionalInt32; - } - if (other.OptionalString != "") { - OptionalString = other.OptionalString; - } - if (other.OptionalBytes != pb::ByteString.Empty) { - OptionalBytes = other.OptionalBytes; - } - if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - input.ReadInt32(ref result.optionalInt32_); - break; - } - case 18: { - input.ReadString(ref result.optionalString_); - break; - } - case 26: { - input.ReadBytes(ref result.optionalBytes_); - break; - } - case 32: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong)(int)unknown); - } - break; - } - case 42: { - global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.optionalInt32_ = 0; - return this; - } - - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.optionalString_ = ""; - return this; - } - - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs new file mode 100644 index 00000000..0d212b72 --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs @@ -0,0 +1,3776 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/unittest_no_field_presence.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +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.Proto3 { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class UnittestNoFieldPresence { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Builder> internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder> internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required, global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Builder> internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder> internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static UnittestNoFieldPresence() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfbm9fZmllbGRfcHJlc2VuY2Uu", + "cHJvdG8SH3Byb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QaHmdvb2ds", + "ZS9wcm90b2J1Zi91bml0dGVzdC5wcm90byKaEQoMVGVzdEFsbFR5cGVzEhYK", + "Dm9wdGlvbmFsX2ludDMyGAEgASgFEhYKDm9wdGlvbmFsX2ludDY0GAIgASgD", + "EhcKD29wdGlvbmFsX3VpbnQzMhgDIAEoDRIXCg9vcHRpb25hbF91aW50NjQY", + "BCABKAQSFwoPb3B0aW9uYWxfc2ludDMyGAUgASgREhcKD29wdGlvbmFsX3Np", + "bnQ2NBgGIAEoEhIYChBvcHRpb25hbF9maXhlZDMyGAcgASgHEhgKEG9wdGlv", + "bmFsX2ZpeGVkNjQYCCABKAYSGQoRb3B0aW9uYWxfc2ZpeGVkMzIYCSABKA8S", + "GQoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBASFgoOb3B0aW9uYWxfZmxvYXQY", + "CyABKAISFwoPb3B0aW9uYWxfZG91YmxlGAwgASgBEhUKDW9wdGlvbmFsX2Jv", + "b2wYDSABKAgSFwoPb3B0aW9uYWxfc3RyaW5nGA4gASgJEhYKDm9wdGlvbmFs", + "X2J5dGVzGA8gASgMElwKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGBIgASgL", + "MjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0dGVzdC5UZXN0QWxsVHlw", + "ZXMuTmVzdGVkTWVzc2FnZRJRChhvcHRpb25hbF9mb3JlaWduX21lc3NhZ2UY", + "EyABKAsyLy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LkZvcmVp", + "Z25NZXNzYWdlEkAKF29wdGlvbmFsX3Byb3RvMl9tZXNzYWdlGBQgASgLMh8u", + "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzElYKFG9wdGlvbmFsX25l", + "c3RlZF9lbnVtGBUgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", + "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bRJLChVvcHRpb25hbF9mb3Jl", + "aWduX2VudW0YFiABKA4yLC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", + "ZXN0LkZvcmVpZ25FbnVtEiEKFW9wdGlvbmFsX3N0cmluZ19waWVjZRgYIAEo", + "CUICCAISGQoNb3B0aW9uYWxfY29yZBgZIAEoCUICCAESXgoVb3B0aW9uYWxf", + "bGF6eV9tZXNzYWdlGB4gASgLMjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91", + "bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZUICKAESFgoOcmVw", + "ZWF0ZWRfaW50MzIYHyADKAUSFgoOcmVwZWF0ZWRfaW50NjQYICADKAMSFwoP", + "cmVwZWF0ZWRfdWludDMyGCEgAygNEhcKD3JlcGVhdGVkX3VpbnQ2NBgiIAMo", + "BBIXCg9yZXBlYXRlZF9zaW50MzIYIyADKBESFwoPcmVwZWF0ZWRfc2ludDY0", + "GCQgAygSEhgKEHJlcGVhdGVkX2ZpeGVkMzIYJSADKAcSGAoQcmVwZWF0ZWRf", + "Zml4ZWQ2NBgmIAMoBhIZChFyZXBlYXRlZF9zZml4ZWQzMhgnIAMoDxIZChFy", + "ZXBlYXRlZF9zZml4ZWQ2NBgoIAMoEBIWCg5yZXBlYXRlZF9mbG9hdBgpIAMo", + "AhIXCg9yZXBlYXRlZF9kb3VibGUYKiADKAESFQoNcmVwZWF0ZWRfYm9vbBgr", + "IAMoCBIXCg9yZXBlYXRlZF9zdHJpbmcYLCADKAkSFgoOcmVwZWF0ZWRfYnl0", + "ZXMYLSADKAwSXAoXcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2UYMCADKAsyOy5w", + "cm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5O", + "ZXN0ZWRNZXNzYWdlElEKGHJlcGVhdGVkX2ZvcmVpZ25fbWVzc2FnZRgxIAMo", + "CzIvLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuRm9yZWlnbk1l", + "c3NhZ2USQAoXcmVwZWF0ZWRfcHJvdG8yX21lc3NhZ2UYMiADKAsyHy5wcm90", + "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMSVgoUcmVwZWF0ZWRfbmVzdGVk", + "X2VudW0YMyADKA4yOC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0", + "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtEksKFXJlcGVhdGVkX2ZvcmVpZ25f", + "ZW51bRg0IAMoDjIsLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3Qu", + "Rm9yZWlnbkVudW0SIQoVcmVwZWF0ZWRfc3RyaW5nX3BpZWNlGDYgAygJQgII", + "AhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJQgIIARJeChVyZXBlYXRlZF9sYXp5", + "X21lc3NhZ2UYOSADKAsyOy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", + "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlQgIoARIWCgxvbmVvZl91", + "aW50MzIYbyABKA1IABJbChRvbmVvZl9uZXN0ZWRfbWVzc2FnZRhwIAEoCzI7", + "LnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuVGVzdEFsbFR5cGVz", + "Lk5lc3RlZE1lc3NhZ2VIABIWCgxvbmVvZl9zdHJpbmcYcSABKAlIABJOCgpv", + "bmVvZl9lbnVtGHIgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", + "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bUgAGhsKDU5lc3RlZE1lc3Nh", + "Z2USCgoCYmIYASABKAUiJwoKTmVzdGVkRW51bRIHCgNGT08QABIHCgNCQVIQ", + "ARIHCgNCQVoQAkINCgtvbmVvZl9maWVsZCJFChJUZXN0UHJvdG8yUmVxdWly", + "ZWQSLwoGcHJvdG8yGAEgASgLMh8ucHJvdG9idWZfdW5pdHRlc3QuVGVzdFJl", + "cXVpcmVkIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUqQAoLRm9yZWln", + "bkVudW0SDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhABEg8KC0ZP", + "UkVJR05fQkFaEAJCK6oCKEdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFBy", + "b3Rvcy5Qcm90bzNiBnByb3RvMw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; + internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Builder>(internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor, + new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalProto2Message", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "OptionalLazyMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedProto2Message", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "RepeatedLazyMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofEnum", }); + internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor.NestedTypes[0]; + internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder>(internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor, + new string[] { "Bb", }); + internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor = Descriptor.MessageTypes[1]; + internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required, global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Builder>(internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor, + new string[] { "Proto2", }); + internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2]; + internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder>(internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor, + new string[] { "C", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::Google.ProtocolBuffers.TestProtos.Unittest.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::Google.ProtocolBuffers.TestProtos.Unittest.Descriptor, + }, assigner); + } + #endregion + + } + #region Enums + public enum ForeignEnum { + FOREIGN_FOO = 0, + FOREIGN_BAR = 1, + FOREIGN_BAZ = 2, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestAllTypes : pb::GeneratedMessage<TestAllTypes, TestAllTypes.Builder> { + private TestAllTypes() { } + private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); + private static readonly string[] _testAllTypesFieldNames = new string[] { "oneof_enum", "oneof_nested_message", "oneof_string", "oneof_uint32", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_int32", "optional_int64", "optional_lazy_message", "optional_nested_enum", "optional_nested_message", "optional_proto2_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_int32", "repeated_int64", "repeated_lazy_message", "repeated_nested_enum", "repeated_nested_message", "repeated_proto2_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64" }; + private static readonly uint[] _testAllTypesFieldTags = new uint[] { 912, 898, 906, 888, 104, 122, 202, 97, 61, 65, 93, 176, 154, 8, 16, 242, 168, 146, 162, 77, 81, 40, 48, 114, 194, 24, 32, 344, 362, 442, 337, 301, 305, 333, 416, 394, 248, 256, 458, 408, 386, 402, 317, 321, 280, 288, 354, 434, 264, 272 }; + 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.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable<TestAllTypes, TestAllTypes.Builder> InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum NestedEnum { + FOO = 0, + BAR = 1, + BAZ = 2, + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedMessage : pb::GeneratedMessage<NestedMessage, NestedMessage.Builder> { + private NestedMessage() { } + private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); + private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; + private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; + 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.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable<NestedMessage, NestedMessage.Builder> InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } + } + + public const int BbFieldNumber = 1; + private int bb_; + public int Bb { + get { return bb_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _nestedMessageFieldNames; + if (Bb != 0) { + output.WriteInt32(1, field_names[0], Bb); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (Bb != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder<NestedMessage, Builder> { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedMessage result; + + private NestedMessage PrepareBuilder() { + if (resultIsReadOnly) { + NestedMessage original = result; + result = new NestedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NestedMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Descriptor; } + } + + public override NestedMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override NestedMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NestedMessage) { + return MergeFrom((NestedMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.Bb != 0) { + Bb = other.Bb; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nestedMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.bb_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int Bb { + get { return result.Bb; } + set { SetBb(value); } + } + public Builder SetBb(int value) { + PrepareBuilder(); + result.bb_ = value; + return this; + } + public Builder ClearBb() { + PrepareBuilder(); + result.bb_ = 0; + return this; + } + } + static NestedMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + } + #endregion + + public const int OptionalInt32FieldNumber = 1; + private int optionalInt32_; + public int OptionalInt32 { + get { return optionalInt32_; } + } + + public const int OptionalInt64FieldNumber = 2; + private long optionalInt64_; + public long OptionalInt64 { + get { return optionalInt64_; } + } + + public const int OptionalUint32FieldNumber = 3; + private uint optionalUint32_; + public uint OptionalUint32 { + get { return optionalUint32_; } + } + + public const int OptionalUint64FieldNumber = 4; + private ulong optionalUint64_; + public ulong OptionalUint64 { + get { return optionalUint64_; } + } + + public const int OptionalSint32FieldNumber = 5; + private int optionalSint32_; + public int OptionalSint32 { + get { return optionalSint32_; } + } + + public const int OptionalSint64FieldNumber = 6; + private long optionalSint64_; + public long OptionalSint64 { + get { return optionalSint64_; } + } + + public const int OptionalFixed32FieldNumber = 7; + private uint optionalFixed32_; + public uint OptionalFixed32 { + get { return optionalFixed32_; } + } + + public const int OptionalFixed64FieldNumber = 8; + private ulong optionalFixed64_; + public ulong OptionalFixed64 { + get { return optionalFixed64_; } + } + + public const int OptionalSfixed32FieldNumber = 9; + private int optionalSfixed32_; + public int OptionalSfixed32 { + get { return optionalSfixed32_; } + } + + public const int OptionalSfixed64FieldNumber = 10; + private long optionalSfixed64_; + public long OptionalSfixed64 { + get { return optionalSfixed64_; } + } + + public const int OptionalFloatFieldNumber = 11; + private float optionalFloat_; + public float OptionalFloat { + get { return optionalFloat_; } + } + + public const int OptionalDoubleFieldNumber = 12; + private double optionalDouble_; + public double OptionalDouble { + get { return optionalDouble_; } + } + + public const int OptionalBoolFieldNumber = 13; + private bool optionalBool_; + public bool OptionalBool { + get { return optionalBool_; } + } + + public const int OptionalStringFieldNumber = 14; + private string optionalString_ = ""; + public string OptionalString { + get { return optionalString_; } + } + + public const int OptionalBytesFieldNumber = 15; + private pb::ByteString optionalBytes_ = pb::ByteString.Empty; + public pb::ByteString OptionalBytes { + get { return optionalBytes_; } + } + + public const int OptionalNestedMessageFieldNumber = 18; + private bool hasOptionalNestedMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage optionalNestedMessage_; + public bool HasOptionalNestedMessage { + get { return hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public const int OptionalForeignMessageFieldNumber = 19; + private bool hasOptionalForeignMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage optionalForeignMessage_; + public bool HasOptionalForeignMessage { + get { return hasOptionalForeignMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage OptionalForeignMessage { + get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance; } + } + + public const int OptionalProto2MessageFieldNumber = 20; + private bool hasOptionalProto2Message; + private global::Google.ProtocolBuffers.TestProtos.TestAllTypes optionalProto2Message_; + public bool HasOptionalProto2Message { + get { return hasOptionalProto2Message; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message { + get { return optionalProto2Message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } + } + + public const int OptionalNestedEnumFieldNumber = 21; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return optionalNestedEnum_; } + } + + public const int OptionalForeignEnumFieldNumber = 22; + private global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO; + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum OptionalForeignEnum { + get { return optionalForeignEnum_; } + } + + public const int OptionalStringPieceFieldNumber = 24; + private string optionalStringPiece_ = ""; + public string OptionalStringPiece { + get { return optionalStringPiece_; } + } + + public const int OptionalCordFieldNumber = 25; + private string optionalCord_ = ""; + public string OptionalCord { + get { return optionalCord_; } + } + + public const int OptionalLazyMessageFieldNumber = 30; + private bool hasOptionalLazyMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage optionalLazyMessage_; + public bool HasOptionalLazyMessage { + get { return hasOptionalLazyMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalLazyMessage { + get { return optionalLazyMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public const int RepeatedInt32FieldNumber = 31; + private pbc::PopsicleList<int> repeatedInt32_ = new pbc::PopsicleList<int>(); + public scg::IList<int> RepeatedInt32List { + get { return pbc::Lists.AsReadOnly(repeatedInt32_); } + } + public int RepeatedInt32Count { + get { return repeatedInt32_.Count; } + } + public int GetRepeatedInt32(int index) { + return repeatedInt32_[index]; + } + + public const int RepeatedInt64FieldNumber = 32; + private pbc::PopsicleList<long> repeatedInt64_ = new pbc::PopsicleList<long>(); + public scg::IList<long> RepeatedInt64List { + get { return pbc::Lists.AsReadOnly(repeatedInt64_); } + } + public int RepeatedInt64Count { + get { return repeatedInt64_.Count; } + } + public long GetRepeatedInt64(int index) { + return repeatedInt64_[index]; + } + + public const int RepeatedUint32FieldNumber = 33; + private pbc::PopsicleList<uint> repeatedUint32_ = new pbc::PopsicleList<uint>(); + public scg::IList<uint> RepeatedUint32List { + get { return pbc::Lists.AsReadOnly(repeatedUint32_); } + } + public int RepeatedUint32Count { + get { return repeatedUint32_.Count; } + } + public uint GetRepeatedUint32(int index) { + return repeatedUint32_[index]; + } + + public const int RepeatedUint64FieldNumber = 34; + private pbc::PopsicleList<ulong> repeatedUint64_ = new pbc::PopsicleList<ulong>(); + public scg::IList<ulong> RepeatedUint64List { + get { return pbc::Lists.AsReadOnly(repeatedUint64_); } + } + public int RepeatedUint64Count { + get { return repeatedUint64_.Count; } + } + public ulong GetRepeatedUint64(int index) { + return repeatedUint64_[index]; + } + + public const int RepeatedSint32FieldNumber = 35; + private pbc::PopsicleList<int> repeatedSint32_ = new pbc::PopsicleList<int>(); + public scg::IList<int> RepeatedSint32List { + get { return pbc::Lists.AsReadOnly(repeatedSint32_); } + } + public int RepeatedSint32Count { + get { return repeatedSint32_.Count; } + } + public int GetRepeatedSint32(int index) { + return repeatedSint32_[index]; + } + + public const int RepeatedSint64FieldNumber = 36; + private pbc::PopsicleList<long> repeatedSint64_ = new pbc::PopsicleList<long>(); + public scg::IList<long> RepeatedSint64List { + get { return pbc::Lists.AsReadOnly(repeatedSint64_); } + } + public int RepeatedSint64Count { + get { return repeatedSint64_.Count; } + } + public long GetRepeatedSint64(int index) { + return repeatedSint64_[index]; + } + + public const int RepeatedFixed32FieldNumber = 37; + private pbc::PopsicleList<uint> repeatedFixed32_ = new pbc::PopsicleList<uint>(); + public scg::IList<uint> RepeatedFixed32List { + get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } + } + public int RepeatedFixed32Count { + get { return repeatedFixed32_.Count; } + } + public uint GetRepeatedFixed32(int index) { + return repeatedFixed32_[index]; + } + + public const int RepeatedFixed64FieldNumber = 38; + private pbc::PopsicleList<ulong> repeatedFixed64_ = new pbc::PopsicleList<ulong>(); + public scg::IList<ulong> RepeatedFixed64List { + get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } + } + public int RepeatedFixed64Count { + get { return repeatedFixed64_.Count; } + } + public ulong GetRepeatedFixed64(int index) { + return repeatedFixed64_[index]; + } + + public const int RepeatedSfixed32FieldNumber = 39; + private pbc::PopsicleList<int> repeatedSfixed32_ = new pbc::PopsicleList<int>(); + public scg::IList<int> RepeatedSfixed32List { + get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } + } + public int RepeatedSfixed32Count { + get { return repeatedSfixed32_.Count; } + } + public int GetRepeatedSfixed32(int index) { + return repeatedSfixed32_[index]; + } + + public const int RepeatedSfixed64FieldNumber = 40; + private pbc::PopsicleList<long> repeatedSfixed64_ = new pbc::PopsicleList<long>(); + public scg::IList<long> RepeatedSfixed64List { + get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } + } + public int RepeatedSfixed64Count { + get { return repeatedSfixed64_.Count; } + } + public long GetRepeatedSfixed64(int index) { + return repeatedSfixed64_[index]; + } + + public const int RepeatedFloatFieldNumber = 41; + private pbc::PopsicleList<float> repeatedFloat_ = new pbc::PopsicleList<float>(); + public scg::IList<float> RepeatedFloatList { + get { return pbc::Lists.AsReadOnly(repeatedFloat_); } + } + public int RepeatedFloatCount { + get { return repeatedFloat_.Count; } + } + public float GetRepeatedFloat(int index) { + return repeatedFloat_[index]; + } + + public const int RepeatedDoubleFieldNumber = 42; + private pbc::PopsicleList<double> repeatedDouble_ = new pbc::PopsicleList<double>(); + public scg::IList<double> RepeatedDoubleList { + get { return pbc::Lists.AsReadOnly(repeatedDouble_); } + } + public int RepeatedDoubleCount { + get { return repeatedDouble_.Count; } + } + public double GetRepeatedDouble(int index) { + return repeatedDouble_[index]; + } + + public const int RepeatedBoolFieldNumber = 43; + private pbc::PopsicleList<bool> repeatedBool_ = new pbc::PopsicleList<bool>(); + public scg::IList<bool> RepeatedBoolList { + get { return pbc::Lists.AsReadOnly(repeatedBool_); } + } + public int RepeatedBoolCount { + get { return repeatedBool_.Count; } + } + public bool GetRepeatedBool(int index) { + return repeatedBool_[index]; + } + + public const int RepeatedStringFieldNumber = 44; + private pbc::PopsicleList<string> repeatedString_ = new pbc::PopsicleList<string>(); + public scg::IList<string> RepeatedStringList { + get { return pbc::Lists.AsReadOnly(repeatedString_); } + } + public int RepeatedStringCount { + get { return repeatedString_.Count; } + } + public string GetRepeatedString(int index) { + return repeatedString_[index]; + } + + public const int RepeatedBytesFieldNumber = 45; + private pbc::PopsicleList<pb::ByteString> repeatedBytes_ = new pbc::PopsicleList<pb::ByteString>(); + public scg::IList<pb::ByteString> RepeatedBytesList { + get { return pbc::Lists.AsReadOnly(repeatedBytes_); } + } + public int RepeatedBytesCount { + get { return repeatedBytes_.Count; } + } + public pb::ByteString GetRepeatedBytes(int index) { + return repeatedBytes_[index]; + } + + public const int RepeatedNestedMessageFieldNumber = 48; + private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> repeatedNestedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage>(); + public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedNestedMessageList { + get { return repeatedNestedMessage_; } + } + public int RepeatedNestedMessageCount { + get { return repeatedNestedMessage_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { + return repeatedNestedMessage_[index]; + } + + public const int RepeatedForeignMessageFieldNumber = 49; + private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> repeatedForeignMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage>(); + public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> RepeatedForeignMessageList { + get { return repeatedForeignMessage_; } + } + public int RepeatedForeignMessageCount { + get { return repeatedForeignMessage_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage GetRepeatedForeignMessage(int index) { + return repeatedForeignMessage_[index]; + } + + public const int RepeatedProto2MessageFieldNumber = 50; + private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> repeatedProto2Message_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes>(); + public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> RepeatedProto2MessageList { + get { return repeatedProto2Message_; } + } + public int RepeatedProto2MessageCount { + get { return repeatedProto2Message_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) { + return repeatedProto2Message_[index]; + } + + public const int RepeatedNestedEnumFieldNumber = 51; + private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> repeatedNestedEnum_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum>(); + public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> RepeatedNestedEnumList { + get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } + } + public int RepeatedNestedEnumCount { + get { return repeatedNestedEnum_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { + return repeatedNestedEnum_[index]; + } + + public const int RepeatedForeignEnumFieldNumber = 52; + private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> repeatedForeignEnum_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum>(); + public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> RepeatedForeignEnumList { + get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } + } + public int RepeatedForeignEnumCount { + get { return repeatedForeignEnum_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum GetRepeatedForeignEnum(int index) { + return repeatedForeignEnum_[index]; + } + + public const int RepeatedStringPieceFieldNumber = 54; + private pbc::PopsicleList<string> repeatedStringPiece_ = new pbc::PopsicleList<string>(); + public scg::IList<string> RepeatedStringPieceList { + get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } + } + public int RepeatedStringPieceCount { + get { return repeatedStringPiece_.Count; } + } + public string GetRepeatedStringPiece(int index) { + return repeatedStringPiece_[index]; + } + + public const int RepeatedCordFieldNumber = 55; + private pbc::PopsicleList<string> repeatedCord_ = new pbc::PopsicleList<string>(); + public scg::IList<string> RepeatedCordList { + get { return pbc::Lists.AsReadOnly(repeatedCord_); } + } + public int RepeatedCordCount { + get { return repeatedCord_.Count; } + } + public string GetRepeatedCord(int index) { + return repeatedCord_[index]; + } + + public const int RepeatedLazyMessageFieldNumber = 57; + private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> repeatedLazyMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage>(); + public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedLazyMessageList { + get { return repeatedLazyMessage_; } + } + public int RepeatedLazyMessageCount { + get { return repeatedLazyMessage_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) { + return repeatedLazyMessage_[index]; + } + + public const int OneofUint32FieldNumber = 111; + private uint oneofUint32_; + public uint OneofUint32 { + get { return oneofUint32_; } + } + + public const int OneofNestedMessageFieldNumber = 112; + private bool hasOneofNestedMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage oneofNestedMessage_; + public bool HasOneofNestedMessage { + get { return hasOneofNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage { + get { return oneofNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public const int OneofStringFieldNumber = 113; + private string oneofString_ = ""; + public string OneofString { + get { return oneofString_; } + } + + public const int OneofEnumFieldNumber = 114; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum oneofEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OneofEnum { + get { return oneofEnum_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _testAllTypesFieldNames; + if (OptionalInt32 != 0) { + output.WriteInt32(1, field_names[13], OptionalInt32); + } + if (OptionalInt64 != 0L) { + output.WriteInt64(2, field_names[14], OptionalInt64); + } + if (OptionalUint32 != 0) { + output.WriteUInt32(3, field_names[25], OptionalUint32); + } + if (OptionalUint64 != 0UL) { + output.WriteUInt64(4, field_names[26], OptionalUint64); + } + if (OptionalSint32 != 0) { + output.WriteSInt32(5, field_names[21], OptionalSint32); + } + if (OptionalSint64 != 0L) { + output.WriteSInt64(6, field_names[22], OptionalSint64); + } + if (OptionalFixed32 != 0) { + output.WriteFixed32(7, field_names[8], OptionalFixed32); + } + if (OptionalFixed64 != 0UL) { + output.WriteFixed64(8, field_names[9], OptionalFixed64); + } + if (OptionalSfixed32 != 0) { + output.WriteSFixed32(9, field_names[19], OptionalSfixed32); + } + if (OptionalSfixed64 != 0L) { + output.WriteSFixed64(10, field_names[20], OptionalSfixed64); + } + if (OptionalFloat != 0F) { + output.WriteFloat(11, field_names[10], OptionalFloat); + } + if (OptionalDouble != 0D) { + output.WriteDouble(12, field_names[7], OptionalDouble); + } + if (OptionalBool != false) { + output.WriteBool(13, field_names[4], OptionalBool); + } + if (OptionalString != "") { + output.WriteString(14, field_names[23], OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + output.WriteBytes(15, field_names[5], OptionalBytes); + } + if (hasOptionalNestedMessage) { + output.WriteMessage(18, field_names[17], OptionalNestedMessage); + } + if (hasOptionalForeignMessage) { + output.WriteMessage(19, field_names[12], OptionalForeignMessage); + } + if (hasOptionalProto2Message) { + output.WriteMessage(20, field_names[18], OptionalProto2Message); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + output.WriteEnum(21, field_names[16], (int) OptionalNestedEnum, OptionalNestedEnum); + } + if (OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) { + output.WriteEnum(22, field_names[11], (int) OptionalForeignEnum, OptionalForeignEnum); + } + if (OptionalStringPiece != "") { + output.WriteString(24, field_names[24], OptionalStringPiece); + } + if (OptionalCord != "") { + output.WriteString(25, field_names[6], OptionalCord); + } + if (hasOptionalLazyMessage) { + output.WriteMessage(30, field_names[15], OptionalLazyMessage); + } + if (repeatedInt32_.Count > 0) { + output.WriteInt32Array(31, field_names[36], repeatedInt32_); + } + if (repeatedInt64_.Count > 0) { + output.WriteInt64Array(32, field_names[37], repeatedInt64_); + } + if (repeatedUint32_.Count > 0) { + output.WriteUInt32Array(33, field_names[48], repeatedUint32_); + } + if (repeatedUint64_.Count > 0) { + output.WriteUInt64Array(34, field_names[49], repeatedUint64_); + } + if (repeatedSint32_.Count > 0) { + output.WriteSInt32Array(35, field_names[44], repeatedSint32_); + } + if (repeatedSint64_.Count > 0) { + output.WriteSInt64Array(36, field_names[45], repeatedSint64_); + } + if (repeatedFixed32_.Count > 0) { + output.WriteFixed32Array(37, field_names[31], repeatedFixed32_); + } + if (repeatedFixed64_.Count > 0) { + output.WriteFixed64Array(38, field_names[32], repeatedFixed64_); + } + if (repeatedSfixed32_.Count > 0) { + output.WriteSFixed32Array(39, field_names[42], repeatedSfixed32_); + } + if (repeatedSfixed64_.Count > 0) { + output.WriteSFixed64Array(40, field_names[43], repeatedSfixed64_); + } + if (repeatedFloat_.Count > 0) { + output.WriteFloatArray(41, field_names[33], repeatedFloat_); + } + if (repeatedDouble_.Count > 0) { + output.WriteDoubleArray(42, field_names[30], repeatedDouble_); + } + if (repeatedBool_.Count > 0) { + output.WriteBoolArray(43, field_names[27], repeatedBool_); + } + if (repeatedString_.Count > 0) { + output.WriteStringArray(44, field_names[46], repeatedString_); + } + if (repeatedBytes_.Count > 0) { + output.WriteBytesArray(45, field_names[28], repeatedBytes_); + } + if (repeatedNestedMessage_.Count > 0) { + output.WriteMessageArray(48, field_names[40], repeatedNestedMessage_); + } + if (repeatedForeignMessage_.Count > 0) { + output.WriteMessageArray(49, field_names[35], repeatedForeignMessage_); + } + if (repeatedProto2Message_.Count > 0) { + output.WriteMessageArray(50, field_names[41], repeatedProto2Message_); + } + if (repeatedNestedEnum_.Count > 0) { + output.WriteEnumArray(51, field_names[39], repeatedNestedEnum_); + } + if (repeatedForeignEnum_.Count > 0) { + output.WriteEnumArray(52, field_names[34], repeatedForeignEnum_); + } + if (repeatedStringPiece_.Count > 0) { + output.WriteStringArray(54, field_names[47], repeatedStringPiece_); + } + if (repeatedCord_.Count > 0) { + output.WriteStringArray(55, field_names[29], repeatedCord_); + } + if (repeatedLazyMessage_.Count > 0) { + output.WriteMessageArray(57, field_names[38], repeatedLazyMessage_); + } + if (OneofUint32 != 0) { + output.WriteUInt32(111, field_names[3], OneofUint32); + } + if (hasOneofNestedMessage) { + output.WriteMessage(112, field_names[1], OneofNestedMessage); + } + if (OneofString != "") { + output.WriteString(113, field_names[2], OneofString); + } + if (OneofEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + output.WriteEnum(114, field_names[0], (int) OneofEnum, OneofEnum); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (OptionalInt32 != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); + } + if (OptionalInt64 != 0L) { + size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); + } + if (OptionalUint32 != 0) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); + } + if (OptionalUint64 != 0UL) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); + } + if (OptionalSint32 != 0) { + size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); + } + if (OptionalSint64 != 0L) { + size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); + } + if (OptionalFixed32 != 0) { + size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); + } + if (OptionalFixed64 != 0UL) { + size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); + } + if (OptionalSfixed32 != 0) { + size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); + } + if (OptionalSfixed64 != 0L) { + size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); + } + if (OptionalFloat != 0F) { + size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); + } + if (OptionalDouble != 0D) { + size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); + } + if (OptionalBool != false) { + size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); + } + if (OptionalString != "") { + size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); + } + if (hasOptionalNestedMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); + } + if (hasOptionalForeignMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); + } + if (hasOptionalProto2Message) { + size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalProto2Message); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); + } + if (OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); + } + if (OptionalStringPiece != "") { + size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); + } + if (OptionalCord != "") { + size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); + } + if (hasOptionalLazyMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(30, OptionalLazyMessage); + } + { + int dataSize = 0; + foreach (int element in RepeatedInt32List) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedInt32_.Count; + } + { + int dataSize = 0; + foreach (long element in RepeatedInt64List) { + dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedInt64_.Count; + } + { + int dataSize = 0; + foreach (uint element in RepeatedUint32List) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedUint32_.Count; + } + { + int dataSize = 0; + foreach (ulong element in RepeatedUint64List) { + dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedUint64_.Count; + } + { + int dataSize = 0; + foreach (int element in RepeatedSint32List) { + dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedSint32_.Count; + } + { + int dataSize = 0; + foreach (long element in RepeatedSint64List) { + dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedSint64_.Count; + } + { + int dataSize = 0; + dataSize = 4 * repeatedFixed32_.Count; + size += dataSize; + size += 2 * repeatedFixed32_.Count; + } + { + int dataSize = 0; + dataSize = 8 * repeatedFixed64_.Count; + size += dataSize; + size += 2 * repeatedFixed64_.Count; + } + { + int dataSize = 0; + dataSize = 4 * repeatedSfixed32_.Count; + size += dataSize; + size += 2 * repeatedSfixed32_.Count; + } + { + int dataSize = 0; + dataSize = 8 * repeatedSfixed64_.Count; + size += dataSize; + size += 2 * repeatedSfixed64_.Count; + } + { + int dataSize = 0; + dataSize = 4 * repeatedFloat_.Count; + size += dataSize; + size += 2 * repeatedFloat_.Count; + } + { + int dataSize = 0; + dataSize = 8 * repeatedDouble_.Count; + size += dataSize; + size += 2 * repeatedDouble_.Count; + } + { + int dataSize = 0; + dataSize = 1 * repeatedBool_.Count; + size += dataSize; + size += 2 * repeatedBool_.Count; + } + { + int dataSize = 0; + foreach (string element in RepeatedStringList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedString_.Count; + } + { + int dataSize = 0; + foreach (pb::ByteString element in RepeatedBytesList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedBytes_.Count; + } + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(48, element); + } + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage element in RepeatedForeignMessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(49, element); + } + foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes element in RepeatedProto2MessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(50, element); + } + { + int dataSize = 0; + if (repeatedNestedEnum_.Count > 0) { + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { + dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); + } + size += dataSize; + size += 2 * repeatedNestedEnum_.Count; + } + } + { + int dataSize = 0; + if (repeatedForeignEnum_.Count > 0) { + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum element in repeatedForeignEnum_) { + dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); + } + size += dataSize; + size += 2 * repeatedForeignEnum_.Count; + } + } + { + int dataSize = 0; + foreach (string element in RepeatedStringPieceList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedStringPiece_.Count; + } + { + int dataSize = 0; + foreach (string element in RepeatedCordList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedCord_.Count; + } + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage element in RepeatedLazyMessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(57, element); + } + if (OneofUint32 != 0) { + size += pb::CodedOutputStream.ComputeUInt32Size(111, OneofUint32); + } + if (hasOneofNestedMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(112, OneofNestedMessage); + } + if (OneofString != "") { + size += pb::CodedOutputStream.ComputeStringSize(113, OneofString); + } + if (OneofEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(114, (int) OneofEnum); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestAllTypes ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestAllTypes MakeReadOnly() { + repeatedInt32_.MakeReadOnly(); + repeatedInt64_.MakeReadOnly(); + repeatedUint32_.MakeReadOnly(); + repeatedUint64_.MakeReadOnly(); + repeatedSint32_.MakeReadOnly(); + repeatedSint64_.MakeReadOnly(); + repeatedFixed32_.MakeReadOnly(); + repeatedFixed64_.MakeReadOnly(); + repeatedSfixed32_.MakeReadOnly(); + repeatedSfixed64_.MakeReadOnly(); + repeatedFloat_.MakeReadOnly(); + repeatedDouble_.MakeReadOnly(); + repeatedBool_.MakeReadOnly(); + repeatedString_.MakeReadOnly(); + repeatedBytes_.MakeReadOnly(); + repeatedNestedMessage_.MakeReadOnly(); + repeatedForeignMessage_.MakeReadOnly(); + repeatedProto2Message_.MakeReadOnly(); + repeatedNestedEnum_.MakeReadOnly(); + repeatedForeignEnum_.MakeReadOnly(); + repeatedStringPiece_.MakeReadOnly(); + repeatedCord_.MakeReadOnly(); + repeatedLazyMessage_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestAllTypes prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder<TestAllTypes, Builder> { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestAllTypes cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestAllTypes result; + + private TestAllTypes PrepareBuilder() { + if (resultIsReadOnly) { + TestAllTypes original = result; + result = new TestAllTypes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TestAllTypes MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Descriptor; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.DefaultInstance; } + } + + public override TestAllTypes BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TestAllTypes) { + return MergeFrom((TestAllTypes) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestAllTypes other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.DefaultInstance) return this; + PrepareBuilder(); + if (other.OptionalInt32 != 0) { + OptionalInt32 = other.OptionalInt32; + } + if (other.OptionalInt64 != 0L) { + OptionalInt64 = other.OptionalInt64; + } + if (other.OptionalUint32 != 0) { + OptionalUint32 = other.OptionalUint32; + } + if (other.OptionalUint64 != 0UL) { + OptionalUint64 = other.OptionalUint64; + } + if (other.OptionalSint32 != 0) { + OptionalSint32 = other.OptionalSint32; + } + if (other.OptionalSint64 != 0L) { + OptionalSint64 = other.OptionalSint64; + } + if (other.OptionalFixed32 != 0) { + OptionalFixed32 = other.OptionalFixed32; + } + if (other.OptionalFixed64 != 0UL) { + OptionalFixed64 = other.OptionalFixed64; + } + if (other.OptionalSfixed32 != 0) { + OptionalSfixed32 = other.OptionalSfixed32; + } + if (other.OptionalSfixed64 != 0L) { + OptionalSfixed64 = other.OptionalSfixed64; + } + if (other.OptionalFloat != 0F) { + OptionalFloat = other.OptionalFloat; + } + if (other.OptionalDouble != 0D) { + OptionalDouble = other.OptionalDouble; + } + if (other.OptionalBool != false) { + OptionalBool = other.OptionalBool; + } + if (other.OptionalString != "") { + OptionalString = other.OptionalString; + } + if (other.OptionalBytes != pb::ByteString.Empty) { + OptionalBytes = other.OptionalBytes; + } + if (other.HasOptionalNestedMessage) { + MergeOptionalNestedMessage(other.OptionalNestedMessage); + } + if (other.HasOptionalForeignMessage) { + MergeOptionalForeignMessage(other.OptionalForeignMessage); + } + if (other.HasOptionalProto2Message) { + MergeOptionalProto2Message(other.OptionalProto2Message); + } + if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) { + OptionalForeignEnum = other.OptionalForeignEnum; + } + if (other.OptionalStringPiece != "") { + OptionalStringPiece = other.OptionalStringPiece; + } + if (other.OptionalCord != "") { + OptionalCord = other.OptionalCord; + } + if (other.HasOptionalLazyMessage) { + MergeOptionalLazyMessage(other.OptionalLazyMessage); + } + if (other.repeatedInt32_.Count != 0) { + result.repeatedInt32_.Add(other.repeatedInt32_); + } + if (other.repeatedInt64_.Count != 0) { + result.repeatedInt64_.Add(other.repeatedInt64_); + } + if (other.repeatedUint32_.Count != 0) { + result.repeatedUint32_.Add(other.repeatedUint32_); + } + if (other.repeatedUint64_.Count != 0) { + result.repeatedUint64_.Add(other.repeatedUint64_); + } + if (other.repeatedSint32_.Count != 0) { + result.repeatedSint32_.Add(other.repeatedSint32_); + } + if (other.repeatedSint64_.Count != 0) { + result.repeatedSint64_.Add(other.repeatedSint64_); + } + if (other.repeatedFixed32_.Count != 0) { + result.repeatedFixed32_.Add(other.repeatedFixed32_); + } + if (other.repeatedFixed64_.Count != 0) { + result.repeatedFixed64_.Add(other.repeatedFixed64_); + } + if (other.repeatedSfixed32_.Count != 0) { + result.repeatedSfixed32_.Add(other.repeatedSfixed32_); + } + if (other.repeatedSfixed64_.Count != 0) { + result.repeatedSfixed64_.Add(other.repeatedSfixed64_); + } + if (other.repeatedFloat_.Count != 0) { + result.repeatedFloat_.Add(other.repeatedFloat_); + } + if (other.repeatedDouble_.Count != 0) { + result.repeatedDouble_.Add(other.repeatedDouble_); + } + if (other.repeatedBool_.Count != 0) { + result.repeatedBool_.Add(other.repeatedBool_); + } + if (other.repeatedString_.Count != 0) { + result.repeatedString_.Add(other.repeatedString_); + } + if (other.repeatedBytes_.Count != 0) { + result.repeatedBytes_.Add(other.repeatedBytes_); + } + if (other.repeatedNestedMessage_.Count != 0) { + result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); + } + if (other.repeatedForeignMessage_.Count != 0) { + result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); + } + if (other.repeatedProto2Message_.Count != 0) { + result.repeatedProto2Message_.Add(other.repeatedProto2Message_); + } + if (other.repeatedNestedEnum_.Count != 0) { + result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); + } + if (other.repeatedForeignEnum_.Count != 0) { + result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); + } + if (other.repeatedStringPiece_.Count != 0) { + result.repeatedStringPiece_.Add(other.repeatedStringPiece_); + } + if (other.repeatedCord_.Count != 0) { + result.repeatedCord_.Add(other.repeatedCord_); + } + if (other.repeatedLazyMessage_.Count != 0) { + result.repeatedLazyMessage_.Add(other.repeatedLazyMessage_); + } + if (other.OneofUint32 != 0) { + OneofUint32 = other.OneofUint32; + } + if (other.HasOneofNestedMessage) { + MergeOneofNestedMessage(other.OneofNestedMessage); + } + if (other.OneofString != "") { + OneofString = other.OneofString; + } + if (other.OneofEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + OneofEnum = other.OneofEnum; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _testAllTypesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.optionalInt32_); + break; + } + case 16: { + input.ReadInt64(ref result.optionalInt64_); + break; + } + case 24: { + input.ReadUInt32(ref result.optionalUint32_); + break; + } + case 32: { + input.ReadUInt64(ref result.optionalUint64_); + break; + } + case 40: { + input.ReadSInt32(ref result.optionalSint32_); + break; + } + case 48: { + input.ReadSInt64(ref result.optionalSint64_); + break; + } + case 61: { + input.ReadFixed32(ref result.optionalFixed32_); + break; + } + case 65: { + input.ReadFixed64(ref result.optionalFixed64_); + break; + } + case 77: { + input.ReadSFixed32(ref result.optionalSfixed32_); + break; + } + case 81: { + input.ReadSFixed64(ref result.optionalSfixed64_); + break; + } + case 93: { + input.ReadFloat(ref result.optionalFloat_); + break; + } + case 97: { + input.ReadDouble(ref result.optionalDouble_); + break; + } + case 104: { + input.ReadBool(ref result.optionalBool_); + break; + } + case 114: { + input.ReadString(ref result.optionalString_); + break; + } + case 122: { + input.ReadBytes(ref result.optionalBytes_); + break; + } + case 146: { + global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalNestedMessage) { + subBuilder.MergeFrom(OptionalNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalNestedMessage = subBuilder.BuildPartial(); + break; + } + case 154: { + global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.CreateBuilder(); + if (result.hasOptionalForeignMessage) { + subBuilder.MergeFrom(OptionalForeignMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalForeignMessage = subBuilder.BuildPartial(); + break; + } + case 162: { + global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(); + if (result.hasOptionalProto2Message) { + subBuilder.MergeFrom(OptionalProto2Message); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalProto2Message = subBuilder.BuildPartial(); + break; + } + case 168: { + object unknown; + if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(21, (ulong)(int)unknown); + } + break; + } + case 176: { + object unknown; + if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(22, (ulong)(int)unknown); + } + break; + } + case 194: { + input.ReadString(ref result.optionalStringPiece_); + break; + } + case 202: { + input.ReadString(ref result.optionalCord_); + break; + } + case 242: { + global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalLazyMessage) { + subBuilder.MergeFrom(OptionalLazyMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalLazyMessage = subBuilder.BuildPartial(); + break; + } + case 250: + case 248: { + input.ReadInt32Array(tag, field_name, result.repeatedInt32_); + break; + } + case 258: + case 256: { + input.ReadInt64Array(tag, field_name, result.repeatedInt64_); + break; + } + case 266: + case 264: { + input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); + break; + } + case 274: + case 272: { + input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); + break; + } + case 282: + case 280: { + input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); + break; + } + case 290: + case 288: { + input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); + break; + } + case 298: + case 301: { + input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); + break; + } + case 306: + case 305: { + input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); + break; + } + case 314: + case 317: { + input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); + break; + } + case 322: + case 321: { + input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); + break; + } + case 330: + case 333: { + input.ReadFloatArray(tag, field_name, result.repeatedFloat_); + break; + } + case 338: + case 337: { + input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); + break; + } + case 346: + case 344: { + input.ReadBoolArray(tag, field_name, result.repeatedBool_); + break; + } + case 354: { + input.ReadStringArray(tag, field_name, result.repeatedString_); + break; + } + case 362: { + input.ReadBytesArray(tag, field_name, result.repeatedBytes_); + break; + } + case 386: { + input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); + break; + } + case 394: { + input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance, extensionRegistry); + break; + } + case 402: { + input.ReadMessageArray(tag, field_name, result.repeatedProto2Message_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance, extensionRegistry); + break; + } + case 410: + case 408: { + scg::ICollection<object> unknownItems; + input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum>(tag, field_name, result.repeatedNestedEnum_, out unknownItems); + if (unknownItems != null) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + foreach (object rawValue in unknownItems) + if (rawValue is int) + unknownFields.MergeVarintField(51, (ulong)(int)rawValue); + } + break; + } + case 418: + case 416: { + scg::ICollection<object> unknownItems; + input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum>(tag, field_name, result.repeatedForeignEnum_, out unknownItems); + if (unknownItems != null) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + foreach (object rawValue in unknownItems) + if (rawValue is int) + unknownFields.MergeVarintField(52, (ulong)(int)rawValue); + } + break; + } + case 434: { + input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); + break; + } + case 442: { + input.ReadStringArray(tag, field_name, result.repeatedCord_); + break; + } + case 458: { + input.ReadMessageArray(tag, field_name, result.repeatedLazyMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); + break; + } + case 888: { + input.ReadUInt32(ref result.oneofUint32_); + break; + } + case 898: { + global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OneofNestedMessage = subBuilder.BuildPartial(); + break; + } + case 906: { + input.ReadString(ref result.oneofString_); + break; + } + case 912: { + object unknown; + if(input.ReadEnum(ref result.oneofEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(114, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int OptionalInt32 { + get { return result.OptionalInt32; } + set { SetOptionalInt32(value); } + } + public Builder SetOptionalInt32(int value) { + PrepareBuilder(); + result.optionalInt32_ = value; + return this; + } + public Builder ClearOptionalInt32() { + PrepareBuilder(); + result.optionalInt32_ = 0; + return this; + } + + public long OptionalInt64 { + get { return result.OptionalInt64; } + set { SetOptionalInt64(value); } + } + public Builder SetOptionalInt64(long value) { + PrepareBuilder(); + result.optionalInt64_ = value; + return this; + } + public Builder ClearOptionalInt64() { + PrepareBuilder(); + result.optionalInt64_ = 0L; + return this; + } + + public uint OptionalUint32 { + get { return result.OptionalUint32; } + set { SetOptionalUint32(value); } + } + public Builder SetOptionalUint32(uint value) { + PrepareBuilder(); + result.optionalUint32_ = value; + return this; + } + public Builder ClearOptionalUint32() { + PrepareBuilder(); + result.optionalUint32_ = 0; + return this; + } + + public ulong OptionalUint64 { + get { return result.OptionalUint64; } + set { SetOptionalUint64(value); } + } + public Builder SetOptionalUint64(ulong value) { + PrepareBuilder(); + result.optionalUint64_ = value; + return this; + } + public Builder ClearOptionalUint64() { + PrepareBuilder(); + result.optionalUint64_ = 0UL; + return this; + } + + public int OptionalSint32 { + get { return result.OptionalSint32; } + set { SetOptionalSint32(value); } + } + public Builder SetOptionalSint32(int value) { + PrepareBuilder(); + result.optionalSint32_ = value; + return this; + } + public Builder ClearOptionalSint32() { + PrepareBuilder(); + result.optionalSint32_ = 0; + return this; + } + + public long OptionalSint64 { + get { return result.OptionalSint64; } + set { SetOptionalSint64(value); } + } + public Builder SetOptionalSint64(long value) { + PrepareBuilder(); + result.optionalSint64_ = value; + return this; + } + public Builder ClearOptionalSint64() { + PrepareBuilder(); + result.optionalSint64_ = 0L; + return this; + } + + public uint OptionalFixed32 { + get { return result.OptionalFixed32; } + set { SetOptionalFixed32(value); } + } + public Builder SetOptionalFixed32(uint value) { + PrepareBuilder(); + result.optionalFixed32_ = value; + return this; + } + public Builder ClearOptionalFixed32() { + PrepareBuilder(); + result.optionalFixed32_ = 0; + return this; + } + + public ulong OptionalFixed64 { + get { return result.OptionalFixed64; } + set { SetOptionalFixed64(value); } + } + public Builder SetOptionalFixed64(ulong value) { + PrepareBuilder(); + result.optionalFixed64_ = value; + return this; + } + public Builder ClearOptionalFixed64() { + PrepareBuilder(); + result.optionalFixed64_ = 0UL; + return this; + } + + public int OptionalSfixed32 { + get { return result.OptionalSfixed32; } + set { SetOptionalSfixed32(value); } + } + public Builder SetOptionalSfixed32(int value) { + PrepareBuilder(); + result.optionalSfixed32_ = value; + return this; + } + public Builder ClearOptionalSfixed32() { + PrepareBuilder(); + result.optionalSfixed32_ = 0; + return this; + } + + public long OptionalSfixed64 { + get { return result.OptionalSfixed64; } + set { SetOptionalSfixed64(value); } + } + public Builder SetOptionalSfixed64(long value) { + PrepareBuilder(); + result.optionalSfixed64_ = value; + return this; + } + public Builder ClearOptionalSfixed64() { + PrepareBuilder(); + result.optionalSfixed64_ = 0L; + return this; + } + + public float OptionalFloat { + get { return result.OptionalFloat; } + set { SetOptionalFloat(value); } + } + public Builder SetOptionalFloat(float value) { + PrepareBuilder(); + result.optionalFloat_ = value; + return this; + } + public Builder ClearOptionalFloat() { + PrepareBuilder(); + result.optionalFloat_ = 0F; + return this; + } + + public double OptionalDouble { + get { return result.OptionalDouble; } + set { SetOptionalDouble(value); } + } + public Builder SetOptionalDouble(double value) { + PrepareBuilder(); + result.optionalDouble_ = value; + return this; + } + public Builder ClearOptionalDouble() { + PrepareBuilder(); + result.optionalDouble_ = 0D; + return this; + } + + public bool OptionalBool { + get { return result.OptionalBool; } + set { SetOptionalBool(value); } + } + public Builder SetOptionalBool(bool value) { + PrepareBuilder(); + result.optionalBool_ = value; + return this; + } + public Builder ClearOptionalBool() { + PrepareBuilder(); + result.optionalBool_ = false; + return this; + } + + public string OptionalString { + get { return result.OptionalString; } + set { SetOptionalString(value); } + } + public Builder SetOptionalString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalString_ = value; + return this; + } + public Builder ClearOptionalString() { + PrepareBuilder(); + result.optionalString_ = ""; + return this; + } + + public pb::ByteString OptionalBytes { + get { return result.OptionalBytes; } + set { SetOptionalBytes(value); } + } + public Builder SetOptionalBytes(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalBytes_ = value; + return this; + } + public Builder ClearOptionalBytes() { + PrepareBuilder(); + result.optionalBytes_ = pb::ByteString.Empty; + return this; + } + + public bool HasOptionalNestedMessage { + get { return result.hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return result.OptionalNestedMessage; } + set { SetOptionalNestedMessage(value); } + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = value; + return this; + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalNestedMessage && + result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalNestedMessage_ = value; + } + result.hasOptionalNestedMessage = true; + return this; + } + public Builder ClearOptionalNestedMessage() { + PrepareBuilder(); + result.hasOptionalNestedMessage = false; + result.optionalNestedMessage_ = null; + return this; + } + + public bool HasOptionalForeignMessage { + get { return result.hasOptionalForeignMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage OptionalForeignMessage { + get { return result.OptionalForeignMessage; } + set { SetOptionalForeignMessage(value); } + } + public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalForeignMessage = true; + result.optionalForeignMessage_ = value; + return this; + } + public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalForeignMessage = true; + result.optionalForeignMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalForeignMessage && + result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance) { + result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalForeignMessage_ = value; + } + result.hasOptionalForeignMessage = true; + return this; + } + public Builder ClearOptionalForeignMessage() { + PrepareBuilder(); + result.hasOptionalForeignMessage = false; + result.optionalForeignMessage_ = null; + return this; + } + + public bool HasOptionalProto2Message { + get { return result.hasOptionalProto2Message; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message { + get { return result.OptionalProto2Message; } + set { SetOptionalProto2Message(value); } + } + public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalProto2Message = true; + result.optionalProto2Message_ = value; + return this; + } + public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalProto2Message = true; + result.optionalProto2Message_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalProto2Message && + result.optionalProto2Message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) { + result.optionalProto2Message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.optionalProto2Message_).MergeFrom(value).BuildPartial(); + } else { + result.optionalProto2Message_ = value; + } + result.hasOptionalProto2Message = true; + return this; + } + public Builder ClearOptionalProto2Message() { + PrepareBuilder(); + result.hasOptionalProto2Message = false; + result.optionalProto2Message_ = null; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return result.OptionalNestedEnum; } + set { SetOptionalNestedEnum(value); } + } + public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.optionalNestedEnum_ = value; + return this; + } + public Builder ClearOptionalNestedEnum() { + PrepareBuilder(); + result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum OptionalForeignEnum { + get { return result.OptionalForeignEnum; } + set { SetOptionalForeignEnum(value); } + } + public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) { + PrepareBuilder(); + result.optionalForeignEnum_ = value; + return this; + } + public Builder ClearOptionalForeignEnum() { + PrepareBuilder(); + result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO; + return this; + } + + public string OptionalStringPiece { + get { return result.OptionalStringPiece; } + set { SetOptionalStringPiece(value); } + } + public Builder SetOptionalStringPiece(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalStringPiece_ = value; + return this; + } + public Builder ClearOptionalStringPiece() { + PrepareBuilder(); + result.optionalStringPiece_ = ""; + return this; + } + + public string OptionalCord { + get { return result.OptionalCord; } + set { SetOptionalCord(value); } + } + public Builder SetOptionalCord(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalCord_ = value; + return this; + } + public Builder ClearOptionalCord() { + PrepareBuilder(); + result.optionalCord_ = ""; + return this; + } + + public bool HasOptionalLazyMessage { + get { return result.hasOptionalLazyMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalLazyMessage { + get { return result.OptionalLazyMessage; } + set { SetOptionalLazyMessage(value); } + } + public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalLazyMessage = true; + result.optionalLazyMessage_ = value; + return this; + } + public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalLazyMessage = true; + result.optionalLazyMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalLazyMessage && + result.optionalLazyMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.optionalLazyMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalLazyMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalLazyMessage_ = value; + } + result.hasOptionalLazyMessage = true; + return this; + } + public Builder ClearOptionalLazyMessage() { + PrepareBuilder(); + result.hasOptionalLazyMessage = false; + result.optionalLazyMessage_ = null; + return this; + } + + public pbc::IPopsicleList<int> RepeatedInt32List { + get { return PrepareBuilder().repeatedInt32_; } + } + public int RepeatedInt32Count { + get { return result.RepeatedInt32Count; } + } + public int GetRepeatedInt32(int index) { + return result.GetRepeatedInt32(index); + } + public Builder SetRepeatedInt32(int index, int value) { + PrepareBuilder(); + result.repeatedInt32_[index] = value; + return this; + } + public Builder AddRepeatedInt32(int value) { + PrepareBuilder(); + result.repeatedInt32_.Add(value); + return this; + } + public Builder AddRangeRepeatedInt32(scg::IEnumerable<int> values) { + PrepareBuilder(); + result.repeatedInt32_.Add(values); + return this; + } + public Builder ClearRepeatedInt32() { + PrepareBuilder(); + result.repeatedInt32_.Clear(); + return this; + } + + public pbc::IPopsicleList<long> RepeatedInt64List { + get { return PrepareBuilder().repeatedInt64_; } + } + public int RepeatedInt64Count { + get { return result.RepeatedInt64Count; } + } + public long GetRepeatedInt64(int index) { + return result.GetRepeatedInt64(index); + } + public Builder SetRepeatedInt64(int index, long value) { + PrepareBuilder(); + result.repeatedInt64_[index] = value; + return this; + } + public Builder AddRepeatedInt64(long value) { + PrepareBuilder(); + result.repeatedInt64_.Add(value); + return this; + } + public Builder AddRangeRepeatedInt64(scg::IEnumerable<long> values) { + PrepareBuilder(); + result.repeatedInt64_.Add(values); + return this; + } + public Builder ClearRepeatedInt64() { + PrepareBuilder(); + result.repeatedInt64_.Clear(); + return this; + } + + public pbc::IPopsicleList<uint> RepeatedUint32List { + get { return PrepareBuilder().repeatedUint32_; } + } + public int RepeatedUint32Count { + get { return result.RepeatedUint32Count; } + } + public uint GetRepeatedUint32(int index) { + return result.GetRepeatedUint32(index); + } + public Builder SetRepeatedUint32(int index, uint value) { + PrepareBuilder(); + result.repeatedUint32_[index] = value; + return this; + } + public Builder AddRepeatedUint32(uint value) { + PrepareBuilder(); + result.repeatedUint32_.Add(value); + return this; + } + public Builder AddRangeRepeatedUint32(scg::IEnumerable<uint> values) { + PrepareBuilder(); + result.repeatedUint32_.Add(values); + return this; + } + public Builder ClearRepeatedUint32() { + PrepareBuilder(); + result.repeatedUint32_.Clear(); + return this; + } + + public pbc::IPopsicleList<ulong> RepeatedUint64List { + get { return PrepareBuilder().repeatedUint64_; } + } + public int RepeatedUint64Count { + get { return result.RepeatedUint64Count; } + } + public ulong GetRepeatedUint64(int index) { + return result.GetRepeatedUint64(index); + } + public Builder SetRepeatedUint64(int index, ulong value) { + PrepareBuilder(); + result.repeatedUint64_[index] = value; + return this; + } + public Builder AddRepeatedUint64(ulong value) { + PrepareBuilder(); + result.repeatedUint64_.Add(value); + return this; + } + public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) { + PrepareBuilder(); + result.repeatedUint64_.Add(values); + return this; + } + public Builder ClearRepeatedUint64() { + PrepareBuilder(); + result.repeatedUint64_.Clear(); + return this; + } + + public pbc::IPopsicleList<int> RepeatedSint32List { + get { return PrepareBuilder().repeatedSint32_; } + } + public int RepeatedSint32Count { + get { return result.RepeatedSint32Count; } + } + public int GetRepeatedSint32(int index) { + return result.GetRepeatedSint32(index); + } + public Builder SetRepeatedSint32(int index, int value) { + PrepareBuilder(); + result.repeatedSint32_[index] = value; + return this; + } + public Builder AddRepeatedSint32(int value) { + PrepareBuilder(); + result.repeatedSint32_.Add(value); + return this; + } + public Builder AddRangeRepeatedSint32(scg::IEnumerable<int> values) { + PrepareBuilder(); + result.repeatedSint32_.Add(values); + return this; + } + public Builder ClearRepeatedSint32() { + PrepareBuilder(); + result.repeatedSint32_.Clear(); + return this; + } + + public pbc::IPopsicleList<long> RepeatedSint64List { + get { return PrepareBuilder().repeatedSint64_; } + } + public int RepeatedSint64Count { + get { return result.RepeatedSint64Count; } + } + public long GetRepeatedSint64(int index) { + return result.GetRepeatedSint64(index); + } + public Builder SetRepeatedSint64(int index, long value) { + PrepareBuilder(); + result.repeatedSint64_[index] = value; + return this; + } + public Builder AddRepeatedSint64(long value) { + PrepareBuilder(); + result.repeatedSint64_.Add(value); + return this; + } + public Builder AddRangeRepeatedSint64(scg::IEnumerable<long> values) { + PrepareBuilder(); + result.repeatedSint64_.Add(values); + return this; + } + public Builder ClearRepeatedSint64() { + PrepareBuilder(); + result.repeatedSint64_.Clear(); + return this; + } + + public pbc::IPopsicleList<uint> RepeatedFixed32List { + get { return PrepareBuilder().repeatedFixed32_; } + } + public int RepeatedFixed32Count { + get { return result.RepeatedFixed32Count; } + } + public uint GetRepeatedFixed32(int index) { + return result.GetRepeatedFixed32(index); + } + public Builder SetRepeatedFixed32(int index, uint value) { + PrepareBuilder(); + result.repeatedFixed32_[index] = value; + return this; + } + public Builder AddRepeatedFixed32(uint value) { + PrepareBuilder(); + result.repeatedFixed32_.Add(value); + return this; + } + public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) { + PrepareBuilder(); + result.repeatedFixed32_.Add(values); + return this; + } + public Builder ClearRepeatedFixed32() { + PrepareBuilder(); + result.repeatedFixed32_.Clear(); + return this; + } + + public pbc::IPopsicleList<ulong> RepeatedFixed64List { + get { return PrepareBuilder().repeatedFixed64_; } + } + public int RepeatedFixed64Count { + get { return result.RepeatedFixed64Count; } + } + public ulong GetRepeatedFixed64(int index) { + return result.GetRepeatedFixed64(index); + } + public Builder SetRepeatedFixed64(int index, ulong value) { + PrepareBuilder(); + result.repeatedFixed64_[index] = value; + return this; + } + public Builder AddRepeatedFixed64(ulong value) { + PrepareBuilder(); + result.repeatedFixed64_.Add(value); + return this; + } + public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) { + PrepareBuilder(); + result.repeatedFixed64_.Add(values); + return this; + } + public Builder ClearRepeatedFixed64() { + PrepareBuilder(); + result.repeatedFixed64_.Clear(); + return this; + } + + public pbc::IPopsicleList<int> RepeatedSfixed32List { + get { return PrepareBuilder().repeatedSfixed32_; } + } + public int RepeatedSfixed32Count { + get { return result.RepeatedSfixed32Count; } + } + public int GetRepeatedSfixed32(int index) { + return result.GetRepeatedSfixed32(index); + } + public Builder SetRepeatedSfixed32(int index, int value) { + PrepareBuilder(); + result.repeatedSfixed32_[index] = value; + return this; + } + public Builder AddRepeatedSfixed32(int value) { + PrepareBuilder(); + result.repeatedSfixed32_.Add(value); + return this; + } + public Builder AddRangeRepeatedSfixed32(scg::IEnumerable<int> values) { + PrepareBuilder(); + result.repeatedSfixed32_.Add(values); + return this; + } + public Builder ClearRepeatedSfixed32() { + PrepareBuilder(); + result.repeatedSfixed32_.Clear(); + return this; + } + + public pbc::IPopsicleList<long> RepeatedSfixed64List { + get { return PrepareBuilder().repeatedSfixed64_; } + } + public int RepeatedSfixed64Count { + get { return result.RepeatedSfixed64Count; } + } + public long GetRepeatedSfixed64(int index) { + return result.GetRepeatedSfixed64(index); + } + public Builder SetRepeatedSfixed64(int index, long value) { + PrepareBuilder(); + result.repeatedSfixed64_[index] = value; + return this; + } + public Builder AddRepeatedSfixed64(long value) { + PrepareBuilder(); + result.repeatedSfixed64_.Add(value); + return this; + } + public Builder AddRangeRepeatedSfixed64(scg::IEnumerable<long> values) { + PrepareBuilder(); + result.repeatedSfixed64_.Add(values); + return this; + } + public Builder ClearRepeatedSfixed64() { + PrepareBuilder(); + result.repeatedSfixed64_.Clear(); + return this; + } + + public pbc::IPopsicleList<float> RepeatedFloatList { + get { return PrepareBuilder().repeatedFloat_; } + } + public int RepeatedFloatCount { + get { return result.RepeatedFloatCount; } + } + public float GetRepeatedFloat(int index) { + return result.GetRepeatedFloat(index); + } + public Builder SetRepeatedFloat(int index, float value) { + PrepareBuilder(); + result.repeatedFloat_[index] = value; + return this; + } + public Builder AddRepeatedFloat(float value) { + PrepareBuilder(); + result.repeatedFloat_.Add(value); + return this; + } + public Builder AddRangeRepeatedFloat(scg::IEnumerable<float> values) { + PrepareBuilder(); + result.repeatedFloat_.Add(values); + return this; + } + public Builder ClearRepeatedFloat() { + PrepareBuilder(); + result.repeatedFloat_.Clear(); + return this; + } + + public pbc::IPopsicleList<double> RepeatedDoubleList { + get { return PrepareBuilder().repeatedDouble_; } + } + public int RepeatedDoubleCount { + get { return result.RepeatedDoubleCount; } + } + public double GetRepeatedDouble(int index) { + return result.GetRepeatedDouble(index); + } + public Builder SetRepeatedDouble(int index, double value) { + PrepareBuilder(); + result.repeatedDouble_[index] = value; + return this; + } + public Builder AddRepeatedDouble(double value) { + PrepareBuilder(); + result.repeatedDouble_.Add(value); + return this; + } + public Builder AddRangeRepeatedDouble(scg::IEnumerable<double> values) { + PrepareBuilder(); + result.repeatedDouble_.Add(values); + return this; + } + public Builder ClearRepeatedDouble() { + PrepareBuilder(); + result.repeatedDouble_.Clear(); + return this; + } + + public pbc::IPopsicleList<bool> RepeatedBoolList { + get { return PrepareBuilder().repeatedBool_; } + } + public int RepeatedBoolCount { + get { return result.RepeatedBoolCount; } + } + public bool GetRepeatedBool(int index) { + return result.GetRepeatedBool(index); + } + public Builder SetRepeatedBool(int index, bool value) { + PrepareBuilder(); + result.repeatedBool_[index] = value; + return this; + } + public Builder AddRepeatedBool(bool value) { + PrepareBuilder(); + result.repeatedBool_.Add(value); + return this; + } + public Builder AddRangeRepeatedBool(scg::IEnumerable<bool> values) { + PrepareBuilder(); + result.repeatedBool_.Add(values); + return this; + } + public Builder ClearRepeatedBool() { + PrepareBuilder(); + result.repeatedBool_.Clear(); + return this; + } + + public pbc::IPopsicleList<string> RepeatedStringList { + get { return PrepareBuilder().repeatedString_; } + } + public int RepeatedStringCount { + get { return result.RepeatedStringCount; } + } + public string GetRepeatedString(int index) { + return result.GetRepeatedString(index); + } + public Builder SetRepeatedString(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedString_[index] = value; + return this; + } + public Builder AddRepeatedString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedString_.Add(value); + return this; + } + public Builder AddRangeRepeatedString(scg::IEnumerable<string> values) { + PrepareBuilder(); + result.repeatedString_.Add(values); + return this; + } + public Builder ClearRepeatedString() { + PrepareBuilder(); + result.repeatedString_.Clear(); + return this; + } + + public pbc::IPopsicleList<pb::ByteString> RepeatedBytesList { + get { return PrepareBuilder().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) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedBytes_[index] = value; + return this; + } + public Builder AddRepeatedBytes(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedBytes_.Add(value); + return this; + } + public Builder AddRangeRepeatedBytes(scg::IEnumerable<pb::ByteString> values) { + PrepareBuilder(); + result.repeatedBytes_.Add(values); + return this; + } + public Builder ClearRepeatedBytes() { + PrepareBuilder(); + result.repeatedBytes_.Clear(); + return this; + } + + public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedNestedMessageList { + get { return PrepareBuilder().repeatedNestedMessage_; } + } + public int RepeatedNestedMessageCount { + get { return result.RepeatedNestedMessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { + return result.GetRepeatedNestedMessage(index); + } + public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedNestedMessage_[index] = value; + return this; + } + public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedNestedMessage_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedNestedMessage_.Add(value); + return this; + } + public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedNestedMessage_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> values) { + PrepareBuilder(); + result.repeatedNestedMessage_.Add(values); + return this; + } + public Builder ClearRepeatedNestedMessage() { + PrepareBuilder(); + result.repeatedNestedMessage_.Clear(); + return this; + } + + public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> RepeatedForeignMessageList { + get { return PrepareBuilder().repeatedForeignMessage_; } + } + public int RepeatedForeignMessageCount { + get { return result.RepeatedForeignMessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage GetRepeatedForeignMessage(int index) { + return result.GetRepeatedForeignMessage(index); + } + public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedForeignMessage_[index] = value; + return this; + } + public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedForeignMessage_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedForeignMessage_.Add(value); + return this; + } + public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedForeignMessage_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> values) { + PrepareBuilder(); + result.repeatedForeignMessage_.Add(values); + return this; + } + public Builder ClearRepeatedForeignMessage() { + PrepareBuilder(); + result.repeatedForeignMessage_.Clear(); + return this; + } + + public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> RepeatedProto2MessageList { + get { return PrepareBuilder().repeatedProto2Message_; } + } + public int RepeatedProto2MessageCount { + get { return result.RepeatedProto2MessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) { + return result.GetRepeatedProto2Message(index); + } + public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedProto2Message_[index] = value; + return this; + } + public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedProto2Message_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedProto2Message_.Add(value); + return this; + } + public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedProto2Message_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedProto2Message(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> values) { + PrepareBuilder(); + result.repeatedProto2Message_.Add(values); + return this; + } + public Builder ClearRepeatedProto2Message() { + PrepareBuilder(); + result.repeatedProto2Message_.Clear(); + return this; + } + + public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> RepeatedNestedEnumList { + get { return PrepareBuilder().repeatedNestedEnum_; } + } + public int RepeatedNestedEnumCount { + get { return result.RepeatedNestedEnumCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { + return result.GetRepeatedNestedEnum(index); + } + public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.repeatedNestedEnum_[index] = value; + return this; + } + public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.repeatedNestedEnum_.Add(value); + return this; + } + public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> values) { + PrepareBuilder(); + result.repeatedNestedEnum_.Add(values); + return this; + } + public Builder ClearRepeatedNestedEnum() { + PrepareBuilder(); + result.repeatedNestedEnum_.Clear(); + return this; + } + + public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> RepeatedForeignEnumList { + get { return PrepareBuilder().repeatedForeignEnum_; } + } + public int RepeatedForeignEnumCount { + get { return result.RepeatedForeignEnumCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum GetRepeatedForeignEnum(int index) { + return result.GetRepeatedForeignEnum(index); + } + public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) { + PrepareBuilder(); + result.repeatedForeignEnum_[index] = value; + return this; + } + public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) { + PrepareBuilder(); + result.repeatedForeignEnum_.Add(value); + return this; + } + public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> values) { + PrepareBuilder(); + result.repeatedForeignEnum_.Add(values); + return this; + } + public Builder ClearRepeatedForeignEnum() { + PrepareBuilder(); + result.repeatedForeignEnum_.Clear(); + return this; + } + + public pbc::IPopsicleList<string> RepeatedStringPieceList { + get { return PrepareBuilder().repeatedStringPiece_; } + } + public int RepeatedStringPieceCount { + get { return result.RepeatedStringPieceCount; } + } + public string GetRepeatedStringPiece(int index) { + return result.GetRepeatedStringPiece(index); + } + public Builder SetRepeatedStringPiece(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedStringPiece_[index] = value; + return this; + } + public Builder AddRepeatedStringPiece(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedStringPiece_.Add(value); + return this; + } + public Builder AddRangeRepeatedStringPiece(scg::IEnumerable<string> values) { + PrepareBuilder(); + result.repeatedStringPiece_.Add(values); + return this; + } + public Builder ClearRepeatedStringPiece() { + PrepareBuilder(); + result.repeatedStringPiece_.Clear(); + return this; + } + + public pbc::IPopsicleList<string> RepeatedCordList { + get { return PrepareBuilder().repeatedCord_; } + } + public int RepeatedCordCount { + get { return result.RepeatedCordCount; } + } + public string GetRepeatedCord(int index) { + return result.GetRepeatedCord(index); + } + public Builder SetRepeatedCord(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedCord_[index] = value; + return this; + } + public Builder AddRepeatedCord(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedCord_.Add(value); + return this; + } + public Builder AddRangeRepeatedCord(scg::IEnumerable<string> values) { + PrepareBuilder(); + result.repeatedCord_.Add(values); + return this; + } + public Builder ClearRepeatedCord() { + PrepareBuilder(); + result.repeatedCord_.Clear(); + return this; + } + + public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedLazyMessageList { + get { return PrepareBuilder().repeatedLazyMessage_; } + } + public int RepeatedLazyMessageCount { + get { return result.RepeatedLazyMessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) { + return result.GetRepeatedLazyMessage(index); + } + public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedLazyMessage_[index] = value; + return this; + } + public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedLazyMessage_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedLazyMessage_.Add(value); + return this; + } + public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedLazyMessage_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedLazyMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> values) { + PrepareBuilder(); + result.repeatedLazyMessage_.Add(values); + return this; + } + public Builder ClearRepeatedLazyMessage() { + PrepareBuilder(); + result.repeatedLazyMessage_.Clear(); + return this; + } + + public uint OneofUint32 { + get { return result.OneofUint32; } + set { SetOneofUint32(value); } + } + public Builder SetOneofUint32(uint value) { + PrepareBuilder(); + result.oneofUint32_ = value; + return this; + } + public Builder ClearOneofUint32() { + PrepareBuilder(); + result.oneofUint32_ = 0; + return this; + } + + public bool HasOneofNestedMessage { + get { return result.hasOneofNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage { + get { return result.OneofNestedMessage; } + set { SetOneofNestedMessage(value); } + } + public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOneofNestedMessage = true; + result.oneofNestedMessage_ = value; + return this; + } + public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOneofNestedMessage = true; + result.oneofNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOneofNestedMessage && + result.oneofNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.oneofNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.oneofNestedMessage_).MergeFrom(value).BuildPartial(); + } else { + result.oneofNestedMessage_ = value; + } + result.hasOneofNestedMessage = true; + return this; + } + public Builder ClearOneofNestedMessage() { + PrepareBuilder(); + result.hasOneofNestedMessage = false; + result.oneofNestedMessage_ = null; + return this; + } + + public string OneofString { + get { return result.OneofString; } + set { SetOneofString(value); } + } + public Builder SetOneofString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.oneofString_ = value; + return this; + } + public Builder ClearOneofString() { + PrepareBuilder(); + result.oneofString_ = ""; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OneofEnum { + get { return result.OneofEnum; } + set { SetOneofEnum(value); } + } + public Builder SetOneofEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.oneofEnum_ = value; + return this; + } + public Builder ClearOneofEnum() { + PrepareBuilder(); + result.oneofEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + } + static TestAllTypes() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestProto2Required : pb::GeneratedMessage<TestProto2Required, TestProto2Required.Builder> { + private TestProto2Required() { } + private static readonly TestProto2Required defaultInstance = new TestProto2Required().MakeReadOnly(); + private static readonly string[] _testProto2RequiredFieldNames = new string[] { "proto2" }; + private static readonly uint[] _testProto2RequiredFieldTags = new uint[] { 10 }; + public static TestProto2Required DefaultInstance { + get { return defaultInstance; } + } + + public override TestProto2Required DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TestProto2Required ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable<TestProto2Required, TestProto2Required.Builder> InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; } + } + + public const int Proto2FieldNumber = 1; + private bool hasProto2; + private global::Google.ProtocolBuffers.TestProtos.TestRequired proto2_; + public bool HasProto2 { + get { return hasProto2; } + } + public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 { + get { return proto2_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _testProto2RequiredFieldNames; + if (hasProto2) { + output.WriteMessage(1, field_names[0], Proto2); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProto2) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Proto2); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestProto2Required ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestProto2Required ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestProto2Required ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestProto2Required ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestProto2Required ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestProto2Required ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestProto2Required ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestProto2Required ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestProto2Required MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestProto2Required prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder<TestProto2Required, Builder> { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestProto2Required cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestProto2Required result; + + private TestProto2Required PrepareBuilder() { + if (resultIsReadOnly) { + TestProto2Required original = result; + result = new TestProto2Required(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TestProto2Required MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Descriptor; } + } + + public override TestProto2Required DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.DefaultInstance; } + } + + public override TestProto2Required BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TestProto2Required) { + return MergeFrom((TestProto2Required) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestProto2Required other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProto2) { + MergeProto2(other.Proto2); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_testProto2RequiredFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _testProto2RequiredFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(); + if (result.hasProto2) { + subBuilder.MergeFrom(Proto2); + } + input.ReadMessage(subBuilder, extensionRegistry); + Proto2 = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProto2 { + get { return result.hasProto2; } + } + public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 { + get { return result.Proto2; } + set { SetProto2(value); } + } + public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProto2 = true; + result.proto2_ = value; + return this; + } + public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasProto2 = true; + result.proto2_ = builderForValue.Build(); + return this; + } + public Builder MergeProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasProto2 && + result.proto2_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) { + result.proto2_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.proto2_).MergeFrom(value).BuildPartial(); + } else { + result.proto2_ = value; + } + result.hasProto2 = true; + return this; + } + public Builder ClearProto2() { + PrepareBuilder(); + result.hasProto2 = false; + result.proto2_ = null; + return this; + } + } + static TestProto2Required() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ForeignMessage : pb::GeneratedMessage<ForeignMessage, ForeignMessage.Builder> { + private ForeignMessage() { } + private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly(); + private static readonly string[] _foreignMessageFieldNames = new string[] { "c" }; + private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 }; + 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.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable<ForeignMessage, ForeignMessage.Builder> InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; } + } + + public const int CFieldNumber = 1; + private int c_; + public int C { + get { return c_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _foreignMessageFieldNames; + if (C != 0) { + output.WriteInt32(1, field_names[0], C); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (C != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, C); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ForeignMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ForeignMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ForeignMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ForeignMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ForeignMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ForeignMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder<ForeignMessage, Builder> { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ForeignMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ForeignMessage result; + + private ForeignMessage PrepareBuilder() { + if (resultIsReadOnly) { + ForeignMessage original = result; + result = new ForeignMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ForeignMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Descriptor; } + } + + public override ForeignMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance; } + } + + public override ForeignMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ForeignMessage) { + return MergeFrom((ForeignMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ForeignMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.C != 0) { + C = other.C; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _foreignMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.c_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int C { + get { return result.C; } + set { SetC(value); } + } + public Builder SetC(int value) { + PrepareBuilder(); + result.c_ = value; + return this; + } + public Builder ClearC() { + PrepareBuilder(); + result.c_ = 0; + return this; + } + } + static ForeignMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/google/protobuf/unittest_no_field_presence.proto b/src/google/protobuf/unittest_no_field_presence.proto index 6e71517c..f261b58e 100644 --- a/src/google/protobuf/unittest_no_field_presence.proto +++ b/src/google/protobuf/unittest_no_field_presence.proto @@ -37,7 +37,7 @@ import "google/protobuf/unittest.proto"; package proto2_nofieldpresence_unittest; -option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos.Proto3"; // This proto includes every type of field in both singular and repeated // forms. |