Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
d1f5acaa
Commit
d1f5acaa
authored
Apr 29, 2015
by
Jie Luo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the package for field_presence_test.proto
parent
c5c9c6a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
808 additions
and
990 deletions
+808
-990
field_presence_test.proto
csharp/protos/google/protobuf/field_presence_test.proto
+1
-1
FieldPResenceTest.cs
csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs
+24
-24
FieldPresense.cs
csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs
+783
-965
No files found.
csharp/protos/google/protobuf/field_presence_test.proto
View file @
d1f5acaa
syntax
=
"proto3"
;
syntax
=
"proto3"
;
package
field_presence_test
;
package
Google
.
ProtocolBuffers.TestProtos.FieldPresence
;
option
java_package
=
"com.google.protobuf"
;
option
java_package
=
"com.google.protobuf"
;
option
java_outer_classname
=
"FieldPresenceTestProto"
;
option
java_outer_classname
=
"FieldPresenceTestProto"
;
...
...
csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs
View file @
d1f5acaa
...
@@ -56,22 +56,22 @@ namespace Google.ProtocolBuffers
...
@@ -56,22 +56,22 @@ namespace Google.ProtocolBuffers
{
{
// Optional non-message fields don't have HasFoo method generated
// Optional non-message fields don't have HasFoo method generated
Type
proto2Type
=
typeof
(
TestAllTypes
);
Type
proto2Type
=
typeof
(
TestAllTypes
);
Type
proto3Type
=
typeof
(
field_presence_test
.
TestAllTypes
);
Type
proto3Type
=
typeof
(
FieldPresence
.
TestAllTypes
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalInt32"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalInt32"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalString"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalString"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalBytes"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalBytes"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalNestedEnum"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalNestedEnum"
);
proto2Type
=
typeof
(
TestAllTypes
.
Builder
);
proto2Type
=
typeof
(
TestAllTypes
.
Builder
);
proto3Type
=
typeof
(
field_presence_test
.
TestAllTypes
.
Builder
);
proto3Type
=
typeof
(
FieldPresence
.
TestAllTypes
.
Builder
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalInt32"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalInt32"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalString"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalString"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalBytes"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalBytes"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalNestedEnum"
);
CheckHasMethodRemoved
(
proto2Type
,
proto3Type
,
"OptionalNestedEnum"
);
// message fields still have the HasFoo method generated
// message fields still have the HasFoo method generated
Assert
.
False
(
field_presence_test
.
TestAllTypes
.
CreateBuilder
().
Build
().
HasOptionalNestedMessage
);
Assert
.
False
(
FieldPresence
.
TestAllTypes
.
CreateBuilder
().
Build
().
HasOptionalNestedMessage
);
Assert
.
False
(
field_presence_test
.
TestAllTypes
.
CreateBuilder
().
HasOptionalNestedMessage
);
Assert
.
False
(
FieldPresence
.
TestAllTypes
.
CreateBuilder
().
HasOptionalNestedMessage
);
}
}
[
TestMethod
]
[
TestMethod
]
...
@@ -81,29 +81,29 @@ namespace Google.ProtocolBuffers
...
@@ -81,29 +81,29 @@ namespace Google.ProtocolBuffers
// way as not set.
// way as not set.
// Serialization will ignore such fields.
// Serialization will ignore such fields.
field_presence_test
.
TestAllTypes
.
Builder
builder
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
();
FieldPresence
.
TestAllTypes
.
Builder
builder
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
();
builder
.
SetOptionalInt32
(
0
);
builder
.
SetOptionalInt32
(
0
);
builder
.
SetOptionalString
(
""
);
builder
.
SetOptionalString
(
""
);
builder
.
SetOptionalBytes
(
ByteString
.
Empty
);
builder
.
SetOptionalBytes
(
ByteString
.
Empty
);
builder
.
SetOptionalNestedEnum
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
);
builder
.
SetOptionalNestedEnum
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
);
field_presence_test
.
TestAllTypes
message
=
builder
.
Build
();
FieldPresence
.
TestAllTypes
message
=
builder
.
Build
();
Assert
.
AreEqual
(
0
,
message
.
SerializedSize
);
Assert
.
AreEqual
(
0
,
message
.
SerializedSize
);
// Test merge
// Test merge
field_presence_test
.
TestAllTypes
.
Builder
a
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
();
FieldPresence
.
TestAllTypes
.
Builder
a
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
();
a
.
SetOptionalInt32
(
1
);
a
.
SetOptionalInt32
(
1
);
a
.
SetOptionalString
(
"x"
);
a
.
SetOptionalString
(
"x"
);
a
.
SetOptionalBytes
(
ByteString
.
CopyFromUtf8
(
"y"
));
a
.
SetOptionalBytes
(
ByteString
.
CopyFromUtf8
(
"y"
));
a
.
SetOptionalNestedEnum
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
BAR
);
a
.
SetOptionalNestedEnum
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
BAR
);
a
.
MergeFrom
(
message
);
a
.
MergeFrom
(
message
);
field_presence_test
.
TestAllTypes
messageA
=
a
.
Build
();
FieldPresence
.
TestAllTypes
messageA
=
a
.
Build
();
Assert
.
AreEqual
(
1
,
messageA
.
OptionalInt32
);
Assert
.
AreEqual
(
1
,
messageA
.
OptionalInt32
);
Assert
.
AreEqual
(
"x"
,
messageA
.
OptionalString
);
Assert
.
AreEqual
(
"x"
,
messageA
.
OptionalString
);
Assert
.
AreEqual
(
ByteString
.
CopyFromUtf8
(
"y"
),
messageA
.
OptionalBytes
);
Assert
.
AreEqual
(
ByteString
.
CopyFromUtf8
(
"y"
),
messageA
.
OptionalBytes
);
Assert
.
AreEqual
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
BAR
,
messageA
.
OptionalNestedEnum
);
Assert
.
AreEqual
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
BAR
,
messageA
.
OptionalNestedEnum
);
// equals/hashCode should produce the same results
// equals/hashCode should produce the same results
field_presence_test
.
TestAllTypes
empty
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
().
Build
();
FieldPresence
.
TestAllTypes
empty
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
().
Build
();
Assert
.
True
(
empty
.
Equals
(
message
));
Assert
.
True
(
empty
.
Equals
(
message
));
Assert
.
True
(
message
.
Equals
(
empty
));
Assert
.
True
(
message
.
Equals
(
empty
));
Assert
.
AreEqual
(
empty
.
GetHashCode
(),
message
.
GetHashCode
());
Assert
.
AreEqual
(
empty
.
GetHashCode
(),
message
.
GetHashCode
());
...
@@ -112,24 +112,24 @@ namespace Google.ProtocolBuffers
...
@@ -112,24 +112,24 @@ namespace Google.ProtocolBuffers
[
TestMethod
]
[
TestMethod
]
public
void
TestFieldPresenceReflection
()
public
void
TestFieldPresenceReflection
()
{
{
MessageDescriptor
descriptor
=
field_presence_test
.
TestAllTypes
.
Descriptor
;
MessageDescriptor
descriptor
=
FieldPresence
.
TestAllTypes
.
Descriptor
;
FieldDescriptor
optionalInt32Field
=
descriptor
.
FindFieldByName
(
"optional_int32"
);
FieldDescriptor
optionalInt32Field
=
descriptor
.
FindFieldByName
(
"optional_int32"
);
FieldDescriptor
optionalStringField
=
descriptor
.
FindFieldByName
(
"optional_string"
);
FieldDescriptor
optionalStringField
=
descriptor
.
FindFieldByName
(
"optional_string"
);
FieldDescriptor
optionalBytesField
=
descriptor
.
FindFieldByName
(
"optional_bytes"
);
FieldDescriptor
optionalBytesField
=
descriptor
.
FindFieldByName
(
"optional_bytes"
);
FieldDescriptor
optionalNestedEnumField
=
descriptor
.
FindFieldByName
(
"optional_nested_enum"
);
FieldDescriptor
optionalNestedEnumField
=
descriptor
.
FindFieldByName
(
"optional_nested_enum"
);
field_presence_test
.
TestAllTypes
message
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
().
Build
();
FieldPresence
.
TestAllTypes
message
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
().
Build
();
Assert
.
False
(
message
.
HasField
(
optionalInt32Field
));
Assert
.
False
(
message
.
HasField
(
optionalInt32Field
));
Assert
.
False
(
message
.
HasField
(
optionalStringField
));
Assert
.
False
(
message
.
HasField
(
optionalStringField
));
Assert
.
False
(
message
.
HasField
(
optionalBytesField
));
Assert
.
False
(
message
.
HasField
(
optionalBytesField
));
Assert
.
False
(
message
.
HasField
(
optionalNestedEnumField
));
Assert
.
False
(
message
.
HasField
(
optionalNestedEnumField
));
// Set to default value is seen as not present
// Set to default value is seen as not present
message
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
()
message
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
()
.
SetOptionalInt32
(
0
)
.
SetOptionalInt32
(
0
)
.
SetOptionalString
(
""
)
.
SetOptionalString
(
""
)
.
SetOptionalBytes
(
ByteString
.
Empty
)
.
SetOptionalBytes
(
ByteString
.
Empty
)
.
SetOptionalNestedEnum
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
.
SetOptionalNestedEnum
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
.
Build
();
.
Build
();
Assert
.
False
(
message
.
HasField
(
optionalInt32Field
));
Assert
.
False
(
message
.
HasField
(
optionalInt32Field
));
Assert
.
False
(
message
.
HasField
(
optionalStringField
));
Assert
.
False
(
message
.
HasField
(
optionalStringField
));
...
@@ -138,11 +138,11 @@ namespace Google.ProtocolBuffers
...
@@ -138,11 +138,11 @@ namespace Google.ProtocolBuffers
Assert
.
AreEqual
(
0
,
message
.
AllFields
.
Count
);
Assert
.
AreEqual
(
0
,
message
.
AllFields
.
Count
);
// Set t0 non-defalut value is seen as present
// Set t0 non-defalut value is seen as present
message
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
()
message
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
()
.
SetOptionalInt32
(
1
)
.
SetOptionalInt32
(
1
)
.
SetOptionalString
(
"x"
)
.
SetOptionalString
(
"x"
)
.
SetOptionalBytes
(
ByteString
.
CopyFromUtf8
(
"y"
))
.
SetOptionalBytes
(
ByteString
.
CopyFromUtf8
(
"y"
))
.
SetOptionalNestedEnum
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
BAR
)
.
SetOptionalNestedEnum
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
BAR
)
.
Build
();
.
Build
();
Assert
.
True
(
message
.
HasField
(
optionalInt32Field
));
Assert
.
True
(
message
.
HasField
(
optionalInt32Field
));
Assert
.
True
(
message
.
HasField
(
optionalStringField
));
Assert
.
True
(
message
.
HasField
(
optionalStringField
));
...
@@ -154,13 +154,13 @@ namespace Google.ProtocolBuffers
...
@@ -154,13 +154,13 @@ namespace Google.ProtocolBuffers
[
TestMethod
]
[
TestMethod
]
public
void
TestMessageField
()
public
void
TestMessageField
()
{
{
field_presence_test
.
TestAllTypes
.
Builder
builder
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
();
FieldPresence
.
TestAllTypes
.
Builder
builder
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
();
Assert
.
False
(
builder
.
HasOptionalNestedMessage
);
Assert
.
False
(
builder
.
HasOptionalNestedMessage
);
Assert
.
False
(
builder
.
Build
().
HasOptionalNestedMessage
);
Assert
.
False
(
builder
.
Build
().
HasOptionalNestedMessage
);
// Unlike non-message fields, if we set default value to message field, the field
// Unlike non-message fields, if we set default value to message field, the field
// shoule be seem as present.
// shoule be seem as present.
builder
.
SetOptionalNestedMessage
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
);
builder
.
SetOptionalNestedMessage
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
);
Assert
.
True
(
builder
.
HasOptionalNestedMessage
);
Assert
.
True
(
builder
.
HasOptionalNestedMessage
);
Assert
.
True
(
builder
.
Build
().
HasOptionalNestedMessage
);
Assert
.
True
(
builder
.
Build
().
HasOptionalNestedMessage
);
...
@@ -169,17 +169,17 @@ namespace Google.ProtocolBuffers
...
@@ -169,17 +169,17 @@ namespace Google.ProtocolBuffers
[
TestMethod
]
[
TestMethod
]
public
void
TestSeralizeAndParese
()
public
void
TestSeralizeAndParese
()
{
{
field_presence_test
.
TestAllTypes
.
Builder
builder
=
field_presence_test
.
TestAllTypes
.
CreateBuilder
();
FieldPresence
.
TestAllTypes
.
Builder
builder
=
FieldPresence
.
TestAllTypes
.
CreateBuilder
();
builder
.
SetOptionalInt32
(
1234
);
builder
.
SetOptionalInt32
(
1234
);
builder
.
SetOptionalString
(
"hello"
);
builder
.
SetOptionalString
(
"hello"
);
builder
.
SetOptionalNestedMessage
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
);
builder
.
SetOptionalNestedMessage
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
);
ByteString
data
=
builder
.
Build
().
ToByteString
();
ByteString
data
=
builder
.
Build
().
ToByteString
();
field_presence_test
.
TestAllTypes
message
=
field_presence_test
.
TestAllTypes
.
ParseFrom
(
data
);
FieldPresence
.
TestAllTypes
message
=
FieldPresence
.
TestAllTypes
.
ParseFrom
(
data
);
Assert
.
AreEqual
(
1234
,
message
.
OptionalInt32
);
Assert
.
AreEqual
(
1234
,
message
.
OptionalInt32
);
Assert
.
AreEqual
(
"hello"
,
message
.
OptionalString
);
Assert
.
AreEqual
(
"hello"
,
message
.
OptionalString
);
Assert
.
AreEqual
(
ByteString
.
Empty
,
message
.
OptionalBytes
);
Assert
.
AreEqual
(
ByteString
.
Empty
,
message
.
OptionalBytes
);
Assert
.
AreEqual
(
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
,
message
.
OptionalNestedEnum
);
Assert
.
AreEqual
(
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
,
message
.
OptionalNestedEnum
);
Assert
.
True
(
message
.
HasOptionalNestedMessage
);
Assert
.
True
(
message
.
HasOptionalNestedMessage
);
Assert
.
AreEqual
(
0
,
message
.
OptionalNestedMessage
.
Value
);
Assert
.
AreEqual
(
0
,
message
.
OptionalNestedMessage
.
Value
);
}
}
...
...
csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs
View file @
d1f5acaa
// Generated by the protocol buffer compiler. DO NOT EDIT!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: protos/google/protobuf/field_presence_test.proto
// source: protos/google/protobuf/field_presence_test.proto
#pragma warning disable 1591, 0612, 3021
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
#region Designer generated code
using
pb
=
global
::
Google
.
ProtocolBuffers
;
using
pb
=
global
::
Google
.
ProtocolBuffers
;
using
pbc
=
global
::
Google
.
ProtocolBuffers
.
Collections
;
using
pbc
=
global
::
Google
.
ProtocolBuffers
.
Collections
;
using
pbd
=
global
::
Google
.
ProtocolBuffers
.
Descriptors
;
using
pbd
=
global
::
Google
.
ProtocolBuffers
.
Descriptors
;
using
scg
=
global
::
System
.
Collections
.
Generic
;
using
scg
=
global
::
System
.
Collections
.
Generic
;
namespace
field_presence_test
namespace
Google.ProtocolBuffers.TestProtos.FieldPresence
{
{
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
public
static
partial
class
FieldPresenceTest
{
public
static
partial
class
FieldPresenceTest
{
#
region
Extension
registration
public
static
void
RegisterAllExtensions
(
pb
::
ExtensionRegistry
registry
)
{
#
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
;
#
endregion
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
;
#
region
Static
variables
internal
static
pbd
::
MessageDescriptor
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor
;
internal
static
pbd
::
MessageDescriptor
internal__static_field_presence_test_TestAllTypes__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
;
internal
static
pb
::
FieldAccess
.
FieldAccessorTable
<
global
::
field_presence_test
.
TestAllTypes
,
global
::
field_presence_test
.
TestAllTypes
.
Builder
>
internal__static_field_presence_test_TestAllTypes__FieldAccessorTable
;
#
endregion
internal
static
pbd
::
MessageDescriptor
internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor
;
#
region
Descriptor
internal
static
pb
::
FieldAccess
.
FieldAccessorTable
<
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
,
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
Builder
>
internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable
;
public
static
pbd
::
FileDescriptor
Descriptor
{
#
endregion
get
{
return
descriptor
;
}
#
region
Descriptor
}
public
static
pbd
::
FileDescriptor
Descriptor
private
static
pbd
::
FileDescriptor
descriptor
;
{
get
{
return
descriptor
;
}
static
FieldPresenceTest
()
{
}
byte
[]
descriptorData
=
global
::
System
.
Convert
.
FromBase64String
(
private
static
pbd
::
FileDescriptor
descriptor
;
string
.
Concat
(
"CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu"
,
static
FieldPresenceTest
()
"cHJvdG8SL0dvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcy5GaWVs"
,
{
"ZFByZXNlbmNlIvYCCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIY"
,
byte
[]
descriptorData
=
global
::
System
.
Convert
.
FromBase64String
(
"ASABKAUSFwoPb3B0aW9uYWxfc3RyaW5nGAIgASgJEhYKDm9wdGlvbmFsX2J5"
,
string
.
Concat
(
"dGVzGAMgASgMEmYKFG9wdGlvbmFsX25lc3RlZF9lbnVtGAQgASgOMkguR29v"
,
"CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu"
,
"Z2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zLkZpZWxkUHJlc2VuY2Uu"
,
"cHJvdG8SE2ZpZWxkX3ByZXNlbmNlX3Rlc3QivgIKDFRlc3RBbGxUeXBlcxIW"
,
"VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SbAoXb3B0aW9uYWxfbmVzdGVkX21l"
,
"Cg5vcHRpb25hbF9pbnQzMhgBIAEoBRIXCg9vcHRpb25hbF9zdHJpbmcYAiAB"
,
"c3NhZ2UYBSABKAsySy5Hb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90"
,
"KAkSFgoOb3B0aW9uYWxfYnl0ZXMYAyABKAwSSgoUb3B0aW9uYWxfbmVzdGVk"
,
"b3MuRmllbGRQcmVzZW5jZS5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRoe"
,
"X2VudW0YBCABKA4yLC5maWVsZF9wcmVzZW5jZV90ZXN0LlRlc3RBbGxUeXBl"
,
"Cg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3RlZEVudW0S"
,
"cy5OZXN0ZWRFbnVtElAKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGAUgASgL"
,
"BwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJCMAoTY29tLmdvb2dsZS5wcm90"
,
"Mi8uZmllbGRfcHJlc2VuY2VfdGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVz"
,
"b2J1ZkIWRmllbGRQcmVzZW5jZVRlc3RQcm90b6ABAWIGcHJvdG8z"
));
"c2FnZRoeCg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3Rl"
,
pbd
::
FileDescriptor
.
InternalDescriptorAssigner
assigner
=
delegate
(
pbd
::
FileDescriptor
root
)
{
"ZEVudW0SBwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJCMAoTY29tLmdvb2ds"
,
descriptor
=
root
;
"ZS5wcm90b2J1ZkIWRmllbGRQcmVzZW5jZVRlc3RQcm90b6ABAWIGcHJvdG8z"
));
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor
=
Descriptor
.
MessageTypes
[
0
];
pbd
::
FileDescriptor
.
InternalDescriptorAssigner
assigner
=
delegate
(
pbd
::
FileDescriptor
root
)
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
,
descriptor
=
root
;
new
string
[]
{
"OptionalInt32"
,
"OptionalString"
,
"OptionalBytes"
,
"OptionalNestedEnum"
,
"OptionalNestedMessage"
,
});
internal__static_field_presence_test_TestAllTypes__Descriptor
=
Descriptor
.
MessageTypes
[
0
];
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor
=
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor
.
NestedTypes
[
0
];
internal__static_field_presence_test_TestAllTypes__FieldAccessorTable
=
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable
=
new
pb
::
FieldAccess
.
FieldAccessorTable
<
global
::
field_presence_test
.
TestAllTypes
,
global
::
field_presence_test
.
TestAllTypes
.
Builder
>(
internal__static_field_presence_test_TestAllTypes__Descriptor
,
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
[]
{
"OptionalInt32"
,
"OptionalString"
,
"OptionalBytes"
,
"OptionalNestedEnum"
,
"OptionalNestedMessage"
,
});
new
string
[]
{
"Value"
,
});
internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor
=
internal__static_field_presence_test_TestAllTypes__Descriptor
.
NestedTypes
[
0
];
pb
::
ExtensionRegistry
registry
=
pb
::
ExtensionRegistry
.
CreateInstance
();
internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable
=
RegisterAllExtensions
(
registry
);
new
pb
::
FieldAccess
.
FieldAccessorTable
<
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
,
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
Builder
>(
internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor
,
return
registry
;
new
string
[]
{
"Value"
,
});
};
pb
::
ExtensionRegistry
registry
=
pb
::
ExtensionRegistry
.
CreateInstance
();
pbd
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
RegisterAllExtensions
(
registry
);
new
pbd
::
FileDescriptor
[]
{
return
registry
;
},
assigner
);
};
}
pbd
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
#
endregion
new
pbd
::
FileDescriptor
[]
{
},
assigner
);
}
}
#
region
Messages
#
endregion
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
public
sealed
partial
class
TestAllTypes
:
pb
::
GeneratedMessage
<
TestAllTypes
,
TestAllTypes
.
Builder
>
{
}
private
TestAllTypes
()
{
}
#
region
Messages
private
static
readonly
TestAllTypes
defaultInstance
=
new
TestAllTypes
().
MakeReadOnly
();
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
private
static
readonly
string
[]
_testAllTypesFieldNames
=
new
string
[]
{
"optional_bytes"
,
"optional_int32"
,
"optional_nested_enum"
,
"optional_nested_message"
,
"optional_string"
};
public
sealed
partial
class
TestAllTypes
:
pb
::
GeneratedMessage
<
TestAllTypes
,
TestAllTypes
.
Builder
>
private
static
readonly
uint
[]
_testAllTypesFieldTags
=
new
uint
[]
{
26
,
8
,
32
,
42
,
18
};
{
public
static
TestAllTypes
DefaultInstance
{
private
TestAllTypes
()
{
}
get
{
return
defaultInstance
;
}
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
override
TestAllTypes
DefaultInstanceForType
{
public
static
TestAllTypes
DefaultInstance
get
{
return
DefaultInstance
;
}
{
}
get
{
return
defaultInstance
;
}
}
protected
override
TestAllTypes
ThisMessage
{
get
{
return
this
;
}
public
override
TestAllTypes
DefaultInstanceForType
}
{
get
{
return
DefaultInstance
;
}
public
static
pbd
::
MessageDescriptor
Descriptor
{
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
FieldPresenceTest
.
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor
;
}
}
protected
override
TestAllTypes
ThisMessage
{
protected
override
pb
::
FieldAccess
.
FieldAccessorTable
<
TestAllTypes
,
TestAllTypes
.
Builder
>
InternalFieldAccessors
{
get
{
return
this
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
FieldPresenceTest
.
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable
;
}
}
}
public
static
pbd
::
MessageDescriptor
Descriptor
#
region
Nested
types
{
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
get
{
return
global
::
field_presence_test
.
FieldPresenceTest
.
internal__static_field_presence_test_TestAllTypes__Descriptor
;
}
public
static
partial
class
Types
{
}
public
enum
NestedEnum
{
FOO
=
0
,
protected
override
pb
::
FieldAccess
.
FieldAccessorTable
<
TestAllTypes
,
TestAllTypes
.
Builder
>
InternalFieldAccessors
BAR
=
1
,
{
BAZ
=
2
,
get
{
return
global
::
field_presence_test
.
FieldPresenceTest
.
internal__static_field_presence_test_TestAllTypes__FieldAccessorTable
;
}
}
}
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
#
region
Nested
types
public
sealed
partial
class
NestedMessage
:
pb
::
GeneratedMessage
<
NestedMessage
,
NestedMessage
.
Builder
>
{
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
private
NestedMessage
()
{
}
public
static
partial
class
Types
private
static
readonly
NestedMessage
defaultInstance
=
new
NestedMessage
().
MakeReadOnly
();
{
private
static
readonly
string
[]
_nestedMessageFieldNames
=
new
string
[]
{
"value"
};
public
enum
NestedEnum
private
static
readonly
uint
[]
_nestedMessageFieldTags
=
new
uint
[]
{
8
};
{
public
static
NestedMessage
DefaultInstance
{
FOO
=
0
,
get
{
return
defaultInstance
;
}
BAR
=
1
,
}
BAZ
=
2
,
}
public
override
NestedMessage
DefaultInstanceForType
{
get
{
return
DefaultInstance
;
}
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
}
public
sealed
partial
class
NestedMessage
:
pb
::
GeneratedMessage
<
NestedMessage
,
NestedMessage
.
Builder
>
{
protected
override
NestedMessage
ThisMessage
{
private
NestedMessage
()
{
}
get
{
return
this
;
}
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
pbd
::
MessageDescriptor
Descriptor
{
public
static
NestedMessage
DefaultInstance
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
FieldPresenceTest
.
internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor
;
}
{
}
get
{
return
defaultInstance
;
}
}
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
override
NestedMessage
DefaultInstanceForType
}
{
get
{
return
DefaultInstance
;
}
public
const
int
ValueFieldNumber
=
1
;
}
private
int
value_
;
public
int
Value
{
protected
override
NestedMessage
ThisMessage
get
{
return
value_
;
}
{
}
get
{
return
this
;
}
}
public
override
void
WriteTo
(
pb
::
ICodedOutputStream
output
)
{
CalcSerializedSize
();
public
static
pbd
::
MessageDescriptor
Descriptor
string
[]
field_names
=
_nestedMessageFieldNames
;
{
if
(
Value
!=
0
)
{
get
{
return
global
::
field_presence_test
.
FieldPresenceTest
.
internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor
;
}
output
.
WriteInt32
(
1
,
field_names
[
0
],
Value
);
}
}
UnknownFields
.
WriteTo
(
output
);
protected
override
pb
::
FieldAccess
.
FieldAccessorTable
<
NestedMessage
,
NestedMessage
.
Builder
>
InternalFieldAccessors
}
{
get
{
return
global
::
field_presence_test
.
FieldPresenceTest
.
internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable
;
}
private
int
memoizedSerializedSize
=
-
1
;
}
public
override
int
SerializedSize
{
get
{
public
const
int
ValueFieldNumber
=
1
;
int
size
=
memoizedSerializedSize
;
private
int
value_
;
if
(
size
!=
-
1
)
return
size
;
public
int
Value
return
CalcSerializedSize
();
{
}
get
{
return
value_
;
}
}
}
private
int
CalcSerializedSize
()
{
public
override
void
WriteTo
(
pb
::
ICodedOutputStream
output
)
int
size
=
memoizedSerializedSize
;
{
if
(
size
!=
-
1
)
return
size
;
CalcSerializedSize
();
string
[]
field_names
=
_nestedMessageFieldNames
;
size
=
0
;
if
(
Value
!=
0
)
if
(
Value
!=
0
)
{
{
size
+=
pb
::
CodedOutputStream
.
ComputeInt32Size
(
1
,
Value
);
output
.
WriteInt32
(
1
,
field_names
[
0
],
Value
);
}
}
size
+=
UnknownFields
.
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
memoizedSerializedSize
=
size
;
}
return
size
;
}
private
int
memoizedSerializedSize
=
-
1
;
public
static
NestedMessage
ParseFrom
(
pb
::
ByteString
data
)
{
public
override
int
SerializedSize
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
{
}
get
public
static
NestedMessage
ParseFrom
(
pb
::
ByteString
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
int
size
=
memoizedSerializedSize
;
}
if
(
size
!=
-
1
)
return
size
;
public
static
NestedMessage
ParseFrom
(
byte
[]
data
)
{
return
CalcSerializedSize
();
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
}
}
}
public
static
NestedMessage
ParseFrom
(
byte
[]
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
private
int
CalcSerializedSize
()
}
{
public
static
NestedMessage
ParseFrom
(
global
::
System
.
IO
.
Stream
input
)
{
int
size
=
memoizedSerializedSize
;
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
if
(
size
!=
-
1
)
return
size
;
}
public
static
NestedMessage
ParseFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
size
=
0
;
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
if
(
Value
!=
0
)
}
{
public
static
NestedMessage
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeInt32Size
(
1
,
Value
);
return
CreateBuilder
().
MergeDelimitedFrom
(
input
).
BuildParsed
();
}
}
size
+=
UnknownFields
.
SerializedSize
;
public
static
NestedMessage
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
memoizedSerializedSize
=
size
;
return
CreateBuilder
().
MergeDelimitedFrom
(
input
,
extensionRegistry
).
BuildParsed
();
return
size
;
}
}
public
static
NestedMessage
ParseFrom
(
pb
::
ICodedInputStream
input
)
{
public
static
NestedMessage
ParseFrom
(
pb
::
ByteString
data
)
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
{
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
public
static
NestedMessage
ParseFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
public
static
NestedMessage
ParseFrom
(
pb
::
ByteString
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
}
{
private
NestedMessage
MakeReadOnly
()
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
return
this
;
}
}
public
static
NestedMessage
ParseFrom
(
byte
[]
data
)
{
public
static
Builder
CreateBuilder
()
{
return
new
Builder
();
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
public
override
Builder
ToBuilder
()
{
return
CreateBuilder
(
this
);
}
}
public
override
Builder
CreateBuilderForType
()
{
return
new
Builder
();
}
public
static
NestedMessage
ParseFrom
(
byte
[]
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
public
static
Builder
CreateBuilder
(
NestedMessage
prototype
)
{
{
return
new
Builder
(
prototype
);
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
}
}
public
static
NestedMessage
ParseFrom
(
global
::
System
.
IO
.
Stream
input
)
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
{
public
sealed
partial
class
Builder
:
pb
::
GeneratedBuilder
<
NestedMessage
,
Builder
>
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
protected
override
Builder
ThisBuilder
{
}
get
{
return
this
;
}
public
static
NestedMessage
ParseFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
}
{
public
Builder
()
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
result
=
DefaultInstance
;
}
resultIsReadOnly
=
true
;
public
static
NestedMessage
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
)
}
{
internal
Builder
(
NestedMessage
cloneFrom
)
{
return
CreateBuilder
().
MergeDelimitedFrom
(
input
).
BuildParsed
();
result
=
cloneFrom
;
}
resultIsReadOnly
=
true
;
public
static
NestedMessage
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
}
{
return
CreateBuilder
().
MergeDelimitedFrom
(
input
,
extensionRegistry
).
BuildParsed
();
private
bool
resultIsReadOnly
;
}
private
NestedMessage
result
;
public
static
NestedMessage
ParseFrom
(
pb
::
ICodedInputStream
input
)
{
private
NestedMessage
PrepareBuilder
()
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
if
(
resultIsReadOnly
)
{
}
NestedMessage
original
=
result
;
public
static
NestedMessage
ParseFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
result
=
new
NestedMessage
();
{
resultIsReadOnly
=
false
;
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
MergeFrom
(
original
);
}
}
private
NestedMessage
MakeReadOnly
()
return
result
;
{
}
return
this
;
}
public
override
bool
IsInitialized
{
get
{
return
result
.
IsInitialized
;
}
public
static
Builder
CreateBuilder
()
{
return
new
Builder
();
}
}
public
override
Builder
ToBuilder
()
{
return
CreateBuilder
(
this
);
}
public
override
Builder
CreateBuilderForType
()
{
return
new
Builder
();
}
protected
override
NestedMessage
MessageBeingBuilt
{
public
static
Builder
CreateBuilder
(
NestedMessage
prototype
)
get
{
return
PrepareBuilder
();
}
{
}
return
new
Builder
(
prototype
);
}
public
override
Builder
Clear
()
{
result
=
DefaultInstance
;
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
resultIsReadOnly
=
true
;
public
sealed
partial
class
Builder
:
pb
::
GeneratedBuilder
<
NestedMessage
,
Builder
>
return
this
;
{
}
protected
override
Builder
ThisBuilder
{
public
override
Builder
Clone
()
{
get
{
return
this
;
}
if
(
resultIsReadOnly
)
{
}
return
new
Builder
(
result
);
public
Builder
()
}
else
{
{
return
new
Builder
().
MergeFrom
(
result
);
result
=
DefaultInstance
;
}
resultIsReadOnly
=
true
;
}
}
internal
Builder
(
NestedMessage
cloneFrom
)
public
override
pbd
::
MessageDescriptor
DescriptorForType
{
{
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
Descriptor
;
}
result
=
cloneFrom
;
}
resultIsReadOnly
=
true
;
}
public
override
NestedMessage
DefaultInstanceForType
{
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
;
}
private
bool
resultIsReadOnly
;
}
private
NestedMessage
result
;
public
override
NestedMessage
BuildPartial
()
{
private
NestedMessage
PrepareBuilder
()
if
(
resultIsReadOnly
)
{
{
return
result
;
if
(
resultIsReadOnly
)
}
{
resultIsReadOnly
=
true
;
NestedMessage
original
=
result
;
return
result
.
MakeReadOnly
();
result
=
new
NestedMessage
();
}
resultIsReadOnly
=
false
;
MergeFrom
(
original
);
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
{
}
if
(
other
is
NestedMessage
)
{
return
result
;
return
MergeFrom
((
NestedMessage
)
other
);
}
}
else
{
base
.
MergeFrom
(
other
);
public
override
bool
IsInitialized
return
this
;
{
}
get
{
return
result
.
IsInitialized
;
}
}
}
public
override
Builder
MergeFrom
(
NestedMessage
other
)
{
protected
override
NestedMessage
MessageBeingBuilt
if
(
other
==
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
)
return
this
;
{
PrepareBuilder
();
get
{
return
PrepareBuilder
();
}
if
(
other
.
Value
!=
0
)
{
}
Value
=
other
.
Value
;
}
public
override
Builder
Clear
()
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
{
return
this
;
result
=
DefaultInstance
;
}
resultIsReadOnly
=
true
;
return
this
;
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
)
{
}
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
}
public
override
Builder
Clone
()
{
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
if
(
resultIsReadOnly
)
PrepareBuilder
();
{
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
return
new
Builder
(
result
);
uint
tag
;
}
string
field_name
;
else
while
(
input
.
ReadTag
(
out
tag
,
out
field_name
))
{
{
if
(
tag
==
0
&&
field_name
!=
null
)
{
return
new
Builder
().
MergeFrom
(
result
);
int
field_ordinal
=
global
::
System
.
Array
.
BinarySearch
(
_nestedMessageFieldNames
,
field_name
,
global
::
System
.
StringComparer
.
Ordinal
);
}
if
(
field_ordinal
>=
0
)
}
tag
=
_nestedMessageFieldTags
[
field_ordinal
];
else
{
public
override
pbd
::
MessageDescriptor
DescriptorForType
if
(
unknownFields
==
null
)
{
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
get
{
return
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
Descriptor
;
}
}
}
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
continue
;
public
override
NestedMessage
DefaultInstanceForType
}
{
}
get
{
return
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
;
}
switch
(
tag
)
{
}
case
0
:
{
throw
pb
::
InvalidProtocolBufferException
.
InvalidTag
();
public
override
NestedMessage
BuildPartial
()
}
{
default
:
{
if
(
resultIsReadOnly
)
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
{
{
if
(
unknownFields
!=
null
)
{
return
result
;
this
.
UnknownFields
=
unknownFields
.
Build
();
}
}
resultIsReadOnly
=
true
;
return
this
;
return
result
.
MakeReadOnly
();
}
}
if
(
unknownFields
==
null
)
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
}
{
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
if
(
other
is
NestedMessage
)
break
;
{
}
return
MergeFrom
((
NestedMessage
)
other
);
case
8
:
{
}
input
.
ReadInt32
(
ref
result
.
value_
);
else
break
;
{
}
base
.
MergeFrom
(
other
);
}
return
this
;
}
}
}
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
public
override
Builder
MergeFrom
(
NestedMessage
other
)
}
{
return
this
;
if
(
other
==
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
)
return
this
;
}
PrepareBuilder
();
if
(
other
.
Value
!=
0
)
{
public
int
Value
{
Value
=
other
.
Value
;
get
{
return
result
.
Value
;
}
}
set
{
SetValue
(
value
);
}
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
}
return
this
;
public
Builder
SetValue
(
int
value
)
{
}
PrepareBuilder
();
result
.
value_
=
value
;
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
)
return
this
;
{
}
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
public
Builder
ClearValue
()
{
}
PrepareBuilder
();
result
.
value_
=
0
;
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
return
this
;
{
}
PrepareBuilder
();
}
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
static
NestedMessage
()
{
uint
tag
;
object
.
ReferenceEquals
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
FieldPresenceTest
.
Descriptor
,
null
);
string
field_name
;
}
while
(
input
.
ReadTag
(
out
tag
,
out
field_name
))
}
{
if
(
tag
==
0
&&
field_name
!=
null
)
}
{
#
endregion
int
field_ordinal
=
global
::
System
.
Array
.
BinarySearch
(
_nestedMessageFieldNames
,
field_name
,
global
::
System
.
StringComparer
.
Ordinal
);
if
(
field_ordinal
>=
0
)
public
const
int
OptionalInt32FieldNumber
=
1
;
tag
=
_nestedMessageFieldTags
[
field_ordinal
];
private
int
optionalInt32_
;
else
public
int
OptionalInt32
{
{
get
{
return
optionalInt32_
;
}
if
(
unknownFields
==
null
)
}
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
public
const
int
OptionalStringFieldNumber
=
2
;
}
private
string
optionalString_
=
""
;
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
public
string
OptionalString
{
continue
;
get
{
return
optionalString_
;
}
}
}
}
switch
(
tag
)
public
const
int
OptionalBytesFieldNumber
=
3
;
{
private
pb
::
ByteString
optionalBytes_
=
pb
::
ByteString
.
Empty
;
case
0
:
public
pb
::
ByteString
OptionalBytes
{
{
get
{
return
optionalBytes_
;
}
throw
pb
::
InvalidProtocolBufferException
.
InvalidTag
();
}
}
default
:
public
const
int
OptionalNestedEnumFieldNumber
=
4
;
{
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
optionalNestedEnum_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
;
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
public
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
OptionalNestedEnum
{
{
get
{
return
optionalNestedEnum_
;
}
if
(
unknownFields
!=
null
)
}
{
this
.
UnknownFields
=
unknownFields
.
Build
();
public
const
int
OptionalNestedMessageFieldNumber
=
5
;
}
private
bool
hasOptionalNestedMessage
;
return
this
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
optionalNestedMessage_
;
}
public
bool
HasOptionalNestedMessage
{
if
(
unknownFields
==
null
)
get
{
return
hasOptionalNestedMessage
;
}
{
}
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
public
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
OptionalNestedMessage
{
}
get
{
return
optionalNestedMessage_
??
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
;
}
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
}
break
;
}
public
override
void
WriteTo
(
pb
::
ICodedOutputStream
output
)
{
case
8
:
CalcSerializedSize
();
{
string
[]
field_names
=
_testAllTypesFieldNames
;
input
.
ReadInt32
(
ref
result
.
value_
);
if
(
OptionalInt32
!=
0
)
{
break
;
output
.
WriteInt32
(
1
,
field_names
[
1
],
OptionalInt32
);
}
}
}
if
(
OptionalString
!=
""
)
{
}
output
.
WriteString
(
2
,
field_names
[
4
],
OptionalString
);
}
if
(
unknownFields
!=
null
)
if
(
OptionalBytes
!=
pb
::
ByteString
.
Empty
)
{
{
output
.
WriteBytes
(
3
,
field_names
[
0
],
OptionalBytes
);
this
.
UnknownFields
=
unknownFields
.
Build
();
}
}
if
(
OptionalNestedEnum
!=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
{
return
this
;
output
.
WriteEnum
(
4
,
field_names
[
2
],
(
int
)
OptionalNestedEnum
,
OptionalNestedEnum
);
}
}
if
(
hasOptionalNestedMessage
)
{
output
.
WriteMessage
(
5
,
field_names
[
3
],
OptionalNestedMessage
);
public
int
Value
}
{
UnknownFields
.
WriteTo
(
output
);
get
{
return
result
.
Value
;
}
}
set
{
SetValue
(
value
);
}
}
private
int
memoizedSerializedSize
=
-
1
;
public
Builder
SetValue
(
int
value
)
public
override
int
SerializedSize
{
{
get
{
PrepareBuilder
();
int
size
=
memoizedSerializedSize
;
result
.
value_
=
value
;
if
(
size
!=
-
1
)
return
size
;
return
this
;
return
CalcSerializedSize
();
}
}
public
Builder
ClearValue
()
}
{
PrepareBuilder
();
private
int
CalcSerializedSize
()
{
result
.
value_
=
0
;
int
size
=
memoizedSerializedSize
;
return
this
;
if
(
size
!=
-
1
)
return
size
;
}
}
size
=
0
;
static
NestedMessage
()
if
(
OptionalInt32
!=
0
)
{
{
size
+=
pb
::
CodedOutputStream
.
ComputeInt32Size
(
1
,
OptionalInt32
);
object
.
ReferenceEquals
(
global
::
field_presence_test
.
FieldPresenceTest
.
Descriptor
,
null
);
}
}
if
(
OptionalString
!=
""
)
{
}
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
2
,
OptionalString
);
}
}
if
(
OptionalBytes
!=
pb
::
ByteString
.
Empty
)
{
#
endregion
size
+=
pb
::
CodedOutputStream
.
ComputeBytesSize
(
3
,
OptionalBytes
);
}
public
const
int
OptionalInt32FieldNumber
=
1
;
if
(
OptionalNestedEnum
!=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
{
private
int
optionalInt32_
;
size
+=
pb
::
CodedOutputStream
.
ComputeEnumSize
(
4
,
(
int
)
OptionalNestedEnum
);
public
int
OptionalInt32
}
{
if
(
hasOptionalNestedMessage
)
{
get
{
return
optionalInt32_
;
}
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
5
,
OptionalNestedMessage
);
}
}
size
+=
UnknownFields
.
SerializedSize
;
public
const
int
OptionalStringFieldNumber
=
2
;
memoizedSerializedSize
=
size
;
private
string
optionalString_
=
""
;
return
size
;
public
string
OptionalString
}
{
public
static
TestAllTypes
ParseFrom
(
pb
::
ByteString
data
)
{
get
{
return
optionalString_
;
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
}
}
public
static
TestAllTypes
ParseFrom
(
pb
::
ByteString
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
public
const
int
OptionalBytesFieldNumber
=
3
;
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
private
pb
::
ByteString
optionalBytes_
=
pb
::
ByteString
.
Empty
;
}
public
pb
::
ByteString
OptionalBytes
public
static
TestAllTypes
ParseFrom
(
byte
[]
data
)
{
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
get
{
return
optionalBytes_
;
}
}
}
public
static
TestAllTypes
ParseFrom
(
byte
[]
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
public
const
int
OptionalNestedEnumFieldNumber
=
4
;
}
private
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
optionalNestedEnum_
=
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
;
public
static
TestAllTypes
ParseFrom
(
global
::
System
.
IO
.
Stream
input
)
{
public
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
OptionalNestedEnum
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
{
}
get
{
return
optionalNestedEnum_
;
}
public
static
TestAllTypes
ParseFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
}
public
const
int
OptionalNestedMessageFieldNumber
=
5
;
public
static
TestAllTypes
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
)
{
private
bool
hasOptionalNestedMessage
;
return
CreateBuilder
().
MergeDelimitedFrom
(
input
).
BuildParsed
();
private
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
optionalNestedMessage_
;
}
public
bool
HasOptionalNestedMessage
public
static
TestAllTypes
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
{
return
CreateBuilder
().
MergeDelimitedFrom
(
input
,
extensionRegistry
).
BuildParsed
();
get
{
return
hasOptionalNestedMessage
;
}
}
}
public
static
TestAllTypes
ParseFrom
(
pb
::
ICodedInputStream
input
)
{
public
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
OptionalNestedMessage
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
{
}
get
{
return
optionalNestedMessage_
??
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
;
}
public
static
TestAllTypes
ParseFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
}
public
override
void
WriteTo
(
pb
::
ICodedOutputStream
output
)
private
TestAllTypes
MakeReadOnly
()
{
{
return
this
;
CalcSerializedSize
();
}
string
[]
field_names
=
_testAllTypesFieldNames
;
if
(
OptionalInt32
!=
0
)
public
static
Builder
CreateBuilder
()
{
return
new
Builder
();
}
{
public
override
Builder
ToBuilder
()
{
return
CreateBuilder
(
this
);
}
output
.
WriteInt32
(
1
,
field_names
[
1
],
OptionalInt32
);
public
override
Builder
CreateBuilderForType
()
{
return
new
Builder
();
}
}
public
static
Builder
CreateBuilder
(
TestAllTypes
prototype
)
{
if
(
OptionalString
!=
""
)
return
new
Builder
(
prototype
);
{
}
output
.
WriteString
(
2
,
field_names
[
4
],
OptionalString
);
}
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
if
(
OptionalBytes
!=
pb
::
ByteString
.
Empty
)
public
sealed
partial
class
Builder
:
pb
::
GeneratedBuilder
<
TestAllTypes
,
Builder
>
{
{
protected
override
Builder
ThisBuilder
{
output
.
WriteBytes
(
3
,
field_names
[
0
],
OptionalBytes
);
get
{
return
this
;
}
}
}
if
(
OptionalNestedEnum
!=
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
public
Builder
()
{
{
result
=
DefaultInstance
;
output
.
WriteEnum
(
4
,
field_names
[
2
],
(
int
)
OptionalNestedEnum
,
OptionalNestedEnum
);
resultIsReadOnly
=
true
;
}
}
if
(
hasOptionalNestedMessage
)
internal
Builder
(
TestAllTypes
cloneFrom
)
{
{
result
=
cloneFrom
;
output
.
WriteMessage
(
5
,
field_names
[
3
],
OptionalNestedMessage
);
resultIsReadOnly
=
true
;
}
}
UnknownFields
.
WriteTo
(
output
);
}
private
bool
resultIsReadOnly
;
private
TestAllTypes
result
;
private
int
memoizedSerializedSize
=
-
1
;
public
override
int
SerializedSize
private
TestAllTypes
PrepareBuilder
()
{
{
if
(
resultIsReadOnly
)
{
get
TestAllTypes
original
=
result
;
{
result
=
new
TestAllTypes
();
int
size
=
memoizedSerializedSize
;
resultIsReadOnly
=
false
;
if
(
size
!=
-
1
)
return
size
;
MergeFrom
(
original
);
return
CalcSerializedSize
();
}
}
return
result
;
}
}
private
int
CalcSerializedSize
()
public
override
bool
IsInitialized
{
{
get
{
return
result
.
IsInitialized
;
}
int
size
=
memoizedSerializedSize
;
}
if
(
size
!=
-
1
)
return
size
;
protected
override
TestAllTypes
MessageBeingBuilt
{
size
=
0
;
get
{
return
PrepareBuilder
();
}
if
(
OptionalInt32
!=
0
)
}
{
size
+=
pb
::
CodedOutputStream
.
ComputeInt32Size
(
1
,
OptionalInt32
);
public
override
Builder
Clear
()
{
}
result
=
DefaultInstance
;
if
(
OptionalString
!=
""
)
resultIsReadOnly
=
true
;
{
return
this
;
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
2
,
OptionalString
);
}
}
if
(
OptionalBytes
!=
pb
::
ByteString
.
Empty
)
public
override
Builder
Clone
()
{
{
if
(
resultIsReadOnly
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeBytesSize
(
3
,
OptionalBytes
);
return
new
Builder
(
result
);
}
}
else
{
if
(
OptionalNestedEnum
!=
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
return
new
Builder
().
MergeFrom
(
result
);
{
}
size
+=
pb
::
CodedOutputStream
.
ComputeEnumSize
(
4
,
(
int
)
OptionalNestedEnum
);
}
}
if
(
hasOptionalNestedMessage
)
public
override
pbd
::
MessageDescriptor
DescriptorForType
{
{
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Descriptor
;
}
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
5
,
OptionalNestedMessage
);
}
}
size
+=
UnknownFields
.
SerializedSize
;
public
override
TestAllTypes
DefaultInstanceForType
{
memoizedSerializedSize
=
size
;
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
DefaultInstance
;
}
return
size
;
}
}
public
static
TestAllTypes
ParseFrom
(
pb
::
ByteString
data
)
public
override
TestAllTypes
BuildPartial
()
{
{
if
(
resultIsReadOnly
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
return
result
;
}
}
public
static
TestAllTypes
ParseFrom
(
pb
::
ByteString
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
resultIsReadOnly
=
true
;
{
return
result
.
MakeReadOnly
();
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
}
}
public
static
TestAllTypes
ParseFrom
(
byte
[]
data
)
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
{
{
if
(
other
is
TestAllTypes
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
return
MergeFrom
((
TestAllTypes
)
other
);
}
}
else
{
public
static
TestAllTypes
ParseFrom
(
byte
[]
data
,
pb
::
ExtensionRegistry
extensionRegistry
)
base
.
MergeFrom
(
other
);
{
return
this
;
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
,
extensionRegistry
)).
BuildParsed
();
}
}
}
public
static
TestAllTypes
ParseFrom
(
global
::
System
.
IO
.
Stream
input
)
{
public
override
Builder
MergeFrom
(
TestAllTypes
other
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
if
(
other
==
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
DefaultInstance
)
return
this
;
}
PrepareBuilder
();
public
static
TestAllTypes
ParseFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
if
(
other
.
OptionalInt32
!=
0
)
{
{
OptionalInt32
=
other
.
OptionalInt32
;
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
}
}
if
(
other
.
OptionalString
!=
""
)
{
public
static
TestAllTypes
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
)
OptionalString
=
other
.
OptionalString
;
{
}
return
CreateBuilder
().
MergeDelimitedFrom
(
input
).
BuildParsed
();
if
(
other
.
OptionalBytes
!=
pb
::
ByteString
.
Empty
)
{
}
OptionalBytes
=
other
.
OptionalBytes
;
public
static
TestAllTypes
ParseDelimitedFrom
(
global
::
System
.
IO
.
Stream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
}
{
if
(
other
.
OptionalNestedEnum
!=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
{
return
CreateBuilder
().
MergeDelimitedFrom
(
input
,
extensionRegistry
).
BuildParsed
();
OptionalNestedEnum
=
other
.
OptionalNestedEnum
;
}
}
public
static
TestAllTypes
ParseFrom
(
pb
::
ICodedInputStream
input
)
if
(
other
.
HasOptionalNestedMessage
)
{
{
MergeOptionalNestedMessage
(
other
.
OptionalNestedMessage
);
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
)).
BuildParsed
();
}
}
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
public
static
TestAllTypes
ParseFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
return
this
;
{
}
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
input
,
extensionRegistry
)).
BuildParsed
();
}
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
)
{
private
TestAllTypes
MakeReadOnly
()
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
{
}
return
this
;
}
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
PrepareBuilder
();
public
static
Builder
CreateBuilder
()
{
return
new
Builder
();
}
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
public
override
Builder
ToBuilder
()
{
return
CreateBuilder
(
this
);
}
uint
tag
;
public
override
Builder
CreateBuilderForType
()
{
return
new
Builder
();
}
string
field_name
;
public
static
Builder
CreateBuilder
(
TestAllTypes
prototype
)
while
(
input
.
ReadTag
(
out
tag
,
out
field_name
))
{
{
if
(
tag
==
0
&&
field_name
!=
null
)
{
return
new
Builder
(
prototype
);
int
field_ordinal
=
global
::
System
.
Array
.
BinarySearch
(
_testAllTypesFieldNames
,
field_name
,
global
::
System
.
StringComparer
.
Ordinal
);
}
if
(
field_ordinal
>=
0
)
tag
=
_testAllTypesFieldTags
[
field_ordinal
];
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
else
{
public
sealed
partial
class
Builder
:
pb
::
GeneratedBuilder
<
TestAllTypes
,
Builder
>
if
(
unknownFields
==
null
)
{
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
protected
override
Builder
ThisBuilder
}
{
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
get
{
return
this
;
}
continue
;
}
}
public
Builder
()
}
{
switch
(
tag
)
{
result
=
DefaultInstance
;
case
0
:
{
resultIsReadOnly
=
true
;
throw
pb
::
InvalidProtocolBufferException
.
InvalidTag
();
}
}
internal
Builder
(
TestAllTypes
cloneFrom
)
default
:
{
{
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
{
result
=
cloneFrom
;
if
(
unknownFields
!=
null
)
{
resultIsReadOnly
=
true
;
this
.
UnknownFields
=
unknownFields
.
Build
();
}
}
return
this
;
private
bool
resultIsReadOnly
;
}
private
TestAllTypes
result
;
if
(
unknownFields
==
null
)
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
private
TestAllTypes
PrepareBuilder
()
}
{
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
if
(
resultIsReadOnly
)
break
;
{
}
TestAllTypes
original
=
result
;
case
8
:
{
result
=
new
TestAllTypes
();
input
.
ReadInt32
(
ref
result
.
optionalInt32_
);
resultIsReadOnly
=
false
;
break
;
MergeFrom
(
original
);
}
}
case
18
:
{
return
result
;
input
.
ReadString
(
ref
result
.
optionalString_
);
}
break
;
}
public
override
bool
IsInitialized
case
26
:
{
{
input
.
ReadBytes
(
ref
result
.
optionalBytes_
);
get
{
return
result
.
IsInitialized
;
}
break
;
}
}
case
32
:
{
protected
override
TestAllTypes
MessageBeingBuilt
object
unknown
;
{
if
(
input
.
ReadEnum
(
ref
result
.
optionalNestedEnum_
,
out
unknown
))
{
get
{
return
PrepareBuilder
();
}
}
else
if
(
unknown
is
int
)
{
}
if
(
unknownFields
==
null
)
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
public
override
Builder
Clear
()
}
{
unknownFields
.
MergeVarintField
(
4
,
(
ulong
)(
int
)
unknown
);
result
=
DefaultInstance
;
}
resultIsReadOnly
=
true
;
break
;
return
this
;
}
}
case
42
:
{
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
Builder
subBuilder
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
CreateBuilder
();
public
override
Builder
Clone
()
if
(
result
.
hasOptionalNestedMessage
)
{
{
subBuilder
.
MergeFrom
(
OptionalNestedMessage
);
if
(
resultIsReadOnly
)
}
{
input
.
ReadMessage
(
subBuilder
,
extensionRegistry
);
return
new
Builder
(
result
);
OptionalNestedMessage
=
subBuilder
.
BuildPartial
();
}
break
;
else
}
{
}
return
new
Builder
().
MergeFrom
(
result
);
}
}
}
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
public
override
pbd
::
MessageDescriptor
DescriptorForType
}
{
return
this
;
get
{
return
global
::
field_presence_test
.
TestAllTypes
.
Descriptor
;
}
}
}
public
override
TestAllTypes
DefaultInstanceForType
public
int
OptionalInt32
{
{
get
{
return
result
.
OptionalInt32
;
}
get
{
return
global
::
field_presence_test
.
TestAllTypes
.
DefaultInstance
;
}
set
{
SetOptionalInt32
(
value
);
}
}
}
public
Builder
SetOptionalInt32
(
int
value
)
{
public
override
TestAllTypes
BuildPartial
()
PrepareBuilder
();
{
result
.
optionalInt32_
=
value
;
if
(
resultIsReadOnly
)
return
this
;
{
}
return
result
;
public
Builder
ClearOptionalInt32
()
{
}
PrepareBuilder
();
resultIsReadOnly
=
true
;
result
.
optionalInt32_
=
0
;
return
result
.
MakeReadOnly
();
return
this
;
}
}
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
public
string
OptionalString
{
{
get
{
return
result
.
OptionalString
;
}
if
(
other
is
TestAllTypes
)
set
{
SetOptionalString
(
value
);
}
{
}
return
MergeFrom
((
TestAllTypes
)
other
);
public
Builder
SetOptionalString
(
string
value
)
{
}
pb
::
ThrowHelper
.
ThrowIfNull
(
value
,
"value"
);
else
PrepareBuilder
();
{
result
.
optionalString_
=
value
;
base
.
MergeFrom
(
other
);
return
this
;
return
this
;
}
}
public
Builder
ClearOptionalString
()
{
}
PrepareBuilder
();
result
.
optionalString_
=
""
;
public
override
Builder
MergeFrom
(
TestAllTypes
other
)
return
this
;
{
}
if
(
other
==
global
::
field_presence_test
.
TestAllTypes
.
DefaultInstance
)
return
this
;
PrepareBuilder
();
public
pb
::
ByteString
OptionalBytes
{
if
(
other
.
OptionalInt32
!=
0
)
get
{
return
result
.
OptionalBytes
;
}
{
set
{
SetOptionalBytes
(
value
);
}
OptionalInt32
=
other
.
OptionalInt32
;
}
}
public
Builder
SetOptionalBytes
(
pb
::
ByteString
value
)
{
if
(
other
.
OptionalString
!=
""
)
pb
::
ThrowHelper
.
ThrowIfNull
(
value
,
"value"
);
{
PrepareBuilder
();
OptionalString
=
other
.
OptionalString
;
result
.
optionalBytes_
=
value
;
}
return
this
;
if
(
other
.
OptionalBytes
!=
pb
::
ByteString
.
Empty
)
}
{
public
Builder
ClearOptionalBytes
()
{
OptionalBytes
=
other
.
OptionalBytes
;
PrepareBuilder
();
}
result
.
optionalBytes_
=
pb
::
ByteString
.
Empty
;
if
(
other
.
OptionalNestedEnum
!=
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
)
return
this
;
{
}
OptionalNestedEnum
=
other
.
OptionalNestedEnum
;
}
public
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
OptionalNestedEnum
{
if
(
other
.
HasOptionalNestedMessage
)
get
{
return
result
.
OptionalNestedEnum
;
}
{
set
{
SetOptionalNestedEnum
(
value
);
}
MergeOptionalNestedMessage
(
other
.
OptionalNestedMessage
);
}
}
public
Builder
SetOptionalNestedEnum
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
value
)
{
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
PrepareBuilder
();
return
this
;
result
.
optionalNestedEnum_
=
value
;
}
return
this
;
}
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
)
public
Builder
ClearOptionalNestedEnum
()
{
{
PrepareBuilder
();
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
result
.
optionalNestedEnum_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
;
}
return
this
;
}
public
override
Builder
MergeFrom
(
pb
::
ICodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
public
bool
HasOptionalNestedMessage
{
PrepareBuilder
();
get
{
return
result
.
hasOptionalNestedMessage
;
}
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
}
uint
tag
;
public
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
OptionalNestedMessage
{
string
field_name
;
get
{
return
result
.
OptionalNestedMessage
;
}
while
(
input
.
ReadTag
(
out
tag
,
out
field_name
))
set
{
SetOptionalNestedMessage
(
value
);
}
{
}
if
(
tag
==
0
&&
field_name
!=
null
)
public
Builder
SetOptionalNestedMessage
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
value
)
{
{
pb
::
ThrowHelper
.
ThrowIfNull
(
value
,
"value"
);
int
field_ordinal
=
global
::
System
.
Array
.
BinarySearch
(
_testAllTypesFieldNames
,
field_name
,
global
::
System
.
StringComparer
.
Ordinal
);
PrepareBuilder
();
if
(
field_ordinal
>=
0
)
result
.
hasOptionalNestedMessage
=
true
;
tag
=
_testAllTypesFieldTags
[
field_ordinal
];
result
.
optionalNestedMessage_
=
value
;
else
return
this
;
{
}
if
(
unknownFields
==
null
)
public
Builder
SetOptionalNestedMessage
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
Builder
builderForValue
)
{
{
pb
::
ThrowHelper
.
ThrowIfNull
(
builderForValue
,
"builderForValue"
);
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
PrepareBuilder
();
}
result
.
hasOptionalNestedMessage
=
true
;
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
result
.
optionalNestedMessage_
=
builderForValue
.
Build
();
continue
;
return
this
;
}
}
}
public
Builder
MergeOptionalNestedMessage
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
value
)
{
switch
(
tag
)
pb
::
ThrowHelper
.
ThrowIfNull
(
value
,
"value"
);
{
PrepareBuilder
();
case
0
:
if
(
result
.
hasOptionalNestedMessage
&&
{
result
.
optionalNestedMessage_
!=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
)
{
throw
pb
::
InvalidProtocolBufferException
.
InvalidTag
();
result
.
optionalNestedMessage_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
TestAllTypes
.
Types
.
NestedMessage
.
CreateBuilder
(
result
.
optionalNestedMessage_
).
MergeFrom
(
value
).
BuildPartial
();
}
}
else
{
default
:
result
.
optionalNestedMessage_
=
value
;
{
}
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
result
.
hasOptionalNestedMessage
=
true
;
{
return
this
;
if
(
unknownFields
!=
null
)
}
{
public
Builder
ClearOptionalNestedMessage
()
{
this
.
UnknownFields
=
unknownFields
.
Build
();
PrepareBuilder
();
}
result
.
hasOptionalNestedMessage
=
false
;
return
this
;
result
.
optionalNestedMessage_
=
null
;
}
return
this
;
if
(
unknownFields
==
null
)
}
{
}
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
static
TestAllTypes
()
{
}
object
.
ReferenceEquals
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
FieldPresence
.
FieldPresenceTest
.
Descriptor
,
null
);
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
,
field_name
);
}
break
;
}
}
case
8
:
#
endregion
{
input
.
ReadInt32
(
ref
result
.
optionalInt32_
);
}
break
;
}
#endregion Designer generated code
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
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
Builder
subBuilder
=
global
::
field_presence_test
.
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
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
OptionalNestedEnum
{
get
{
return
result
.
OptionalNestedEnum
;
}
set
{
SetOptionalNestedEnum
(
value
);
}
}
public
Builder
SetOptionalNestedEnum
(
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
value
)
{
PrepareBuilder
();
result
.
optionalNestedEnum_
=
value
;
return
this
;
}
public
Builder
ClearOptionalNestedEnum
()
{
PrepareBuilder
();
result
.
optionalNestedEnum_
=
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedEnum
.
FOO
;
return
this
;
}
public
bool
HasOptionalNestedMessage
{
get
{
return
result
.
hasOptionalNestedMessage
;
}
}
public
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
OptionalNestedMessage
{
get
{
return
result
.
OptionalNestedMessage
;
}
set
{
SetOptionalNestedMessage
(
value
);
}
}
public
Builder
SetOptionalNestedMessage
(
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
value
)
{
pb
::
ThrowHelper
.
ThrowIfNull
(
value
,
"value"
);
PrepareBuilder
();
result
.
hasOptionalNestedMessage
=
true
;
result
.
optionalNestedMessage_
=
value
;
return
this
;
}
public
Builder
SetOptionalNestedMessage
(
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
Builder
builderForValue
)
{
pb
::
ThrowHelper
.
ThrowIfNull
(
builderForValue
,
"builderForValue"
);
PrepareBuilder
();
result
.
hasOptionalNestedMessage
=
true
;
result
.
optionalNestedMessage_
=
builderForValue
.
Build
();
return
this
;
}
public
Builder
MergeOptionalNestedMessage
(
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
value
)
{
pb
::
ThrowHelper
.
ThrowIfNull
(
value
,
"value"
);
PrepareBuilder
();
if
(
result
.
hasOptionalNestedMessage
&&
result
.
optionalNestedMessage_
!=
global
::
field_presence_test
.
TestAllTypes
.
Types
.
NestedMessage
.
DefaultInstance
)
{
result
.
optionalNestedMessage_
=
global
::
field_presence_test
.
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
::
field_presence_test
.
FieldPresenceTest
.
Descriptor
,
null
);
}
}
#
endregion
}
#endregion Designer generated code
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment