UnitTestOptimizeForProtoFile.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. using pb = global::Google.ProtocolBuffers;
  3. using pbc = global::Google.ProtocolBuffers.Collections;
  4. using pbd = global::Google.ProtocolBuffers.Descriptors;
  5. using scg = global::System.Collections.Generic;
  6. namespace Google.ProtocolBuffers.TestProtos {
  7. public static partial class UnitTestOptimizeForProtoFile {
  8. #region Descriptor
  9. public static pbd::FileDescriptor Descriptor {
  10. get { return descriptor; }
  11. }
  12. private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
  13. new byte[] {
  14. 0x0a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
  15. 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e,
  16. 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
  17. 0x74, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
  18. 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a,
  19. 0x14, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a,
  20. 0x65, 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x2e, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
  21. 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
  22. 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
  23. 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x32, 0x40, 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x5f,
  24. 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
  25. 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69,
  26. 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0xd2, 0x09, 0x20, 0x01, 0x28, 0x05, 0x22, 0x29, 0x0a,
  27. 0x1c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,
  28. 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x09, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05,
  29. 0x22, 0x5a, 0x0a, 0x1c, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69,
  30. 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3a, 0x0a, 0x01, 0x6f, 0x18, 0x01, 0x20,
  31. 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74,
  32. 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69,
  33. 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x45, 0x48, 0x02, 0xc2, 0x3e, 0x21, 0x47,
  34. 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72,
  35. 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x1c, 0x55, 0x6e, 0x69, 0x74, 0x54,
  36. 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46,
  37. 0x69, 0x6c, 0x65,
  38. }, new pbd::FileDescriptor[] {
  39. global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor,
  40. });
  41. #endregion
  42. #region Extensions
  43. #endregion
  44. #region Static variables
  45. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor
  46. = Descriptor.MessageTypes[0];
  47. internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder> internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
  48. = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor,
  49. new string[] { "I", "Msg", });
  50. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor
  51. = Descriptor.MessageTypes[1];
  52. internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder> internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable
  53. = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor,
  54. new string[] { "X", });
  55. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor
  56. = Descriptor.MessageTypes[2];
  57. internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Builder> internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable
  58. = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor,
  59. new string[] { "O", });
  60. #endregion
  61. }
  62. #region Enums
  63. #endregion
  64. #region Messages
  65. public sealed partial class TestOptimizedForSize : pb::ExtendableMessage<TestOptimizedForSize, TestOptimizedForSize.Builder> {
  66. private static readonly TestOptimizedForSize defaultInstance = new Builder().BuildPartial();
  67. public static TestOptimizedForSize DefaultInstance {
  68. get { return defaultInstance; }
  69. }
  70. public override TestOptimizedForSize DefaultInstanceForType {
  71. get { return defaultInstance; }
  72. }
  73. protected override TestOptimizedForSize ThisMessage {
  74. get { return this; }
  75. }
  76. public static pbd::MessageDescriptor Descriptor {
  77. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; }
  78. }
  79. protected override pb::FieldAccess.FieldAccessorTable<TestOptimizedForSize, TestOptimizedForSize.Builder> InternalFieldAccessors {
  80. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; }
  81. }
  82. public static readonly pb::GeneratedExtensionBase<int> TestExtension =
  83. pb::GeneratedSingleExtension<int>.CreateInstance(Descriptor.Extensions[0]);
  84. #region Nested types
  85. public static class Types {
  86. }
  87. #endregion
  88. // optional int32 i = 1;
  89. private bool hasI;
  90. private int i_ = 0;
  91. public bool HasI {
  92. get { return hasI; }
  93. }
  94. public int I {
  95. get { return i_; }
  96. }
  97. // optional .protobuf_unittest.ForeignMessage msg = 19;
  98. private bool hasMsg;
  99. private global::Google.ProtocolBuffers.TestProtos.ForeignMessage msg_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
  100. public bool HasMsg {
  101. get { return hasMsg; }
  102. }
  103. public global::Google.ProtocolBuffers.TestProtos.ForeignMessage Msg {
  104. get { return msg_; }
  105. }
  106. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::ByteString data) {
  107. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  108. }
  109. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::ByteString data,
  110. pb::ExtensionRegistry extensionRegistry) {
  111. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  112. .BuildParsed();
  113. }
  114. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(byte[] data) {
  115. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  116. }
  117. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(byte[] data,
  118. pb::ExtensionRegistry extensionRegistry) {
  119. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  120. .BuildParsed();
  121. }
  122. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(global::System.IO.Stream input) {
  123. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  124. }
  125. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(
  126. global::System.IO.Stream input,
  127. pb::ExtensionRegistry extensionRegistry) {
  128. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  129. .BuildParsed();
  130. }
  131. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::CodedInputStream input) {
  132. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  133. }
  134. public static global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize ParseFrom(pb::CodedInputStream input,
  135. pb::ExtensionRegistry extensionRegistry) {
  136. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  137. .BuildParsed();
  138. }
  139. public static Builder CreateBuilder() { return new Builder(); }
  140. public override Builder CreateBuilderForType() { return new Builder(); }
  141. public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize prototype) {
  142. return (Builder) new Builder().MergeFrom(prototype);
  143. }
  144. public sealed partial class Builder : pb::ExtendableBuilder<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder> {
  145. protected override Builder ThisBuilder {
  146. get { return this; }
  147. }
  148. // Construct using global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder()
  149. public Builder() {}
  150. global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize();
  151. protected override global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize MessageBeingBuilt {
  152. get { return result; }
  153. }
  154. public override Builder Clear() {
  155. result = new global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize();
  156. return this;
  157. }
  158. public override Builder Clone() {
  159. return new Builder().MergeFrom(result);
  160. }
  161. public override pbd::MessageDescriptor DescriptorForType {
  162. get { return global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Descriptor; }
  163. }
  164. public override global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize DefaultInstanceForType {
  165. get { return global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; }
  166. }
  167. public override global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize BuildPartial() {
  168. global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize returnMe = result;
  169. result = null;
  170. return returnMe;
  171. }
  172. // optional int32 i = 1;
  173. public bool HasI {
  174. get { return result.HasI; }
  175. }
  176. public int I {
  177. get { return result.I; }
  178. set { SetI(value); }
  179. }
  180. public Builder SetI(int value) {
  181. result.hasI = true;
  182. result.i_ = value;
  183. return this;
  184. }
  185. public Builder ClearI() {
  186. result.hasI = false;
  187. result.i_ = 0;
  188. return this;
  189. }
  190. // optional .protobuf_unittest.ForeignMessage msg = 19;
  191. public bool HasMsg {
  192. get { return result.HasMsg; }
  193. }
  194. public global::Google.ProtocolBuffers.TestProtos.ForeignMessage Msg {
  195. get { return result.Msg; }
  196. set { SetMsg(value); }
  197. }
  198. public Builder SetMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
  199. result.hasMsg = true;
  200. result.msg_ = value;
  201. return this;
  202. }
  203. public Builder SetMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) {
  204. result.hasMsg = true;
  205. result.msg_ = builderForValue.Build();
  206. return this;
  207. }
  208. public Builder MergeMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) {
  209. if (result.HasMsg &&
  210. result.msg_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) {
  211. result.msg_ =
  212. global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.msg_).MergeFrom(value).BuildPartial();
  213. } else {
  214. result.msg_ = value;
  215. }
  216. result.hasMsg = true;
  217. return this;
  218. }
  219. public Builder ClearMsg() {
  220. result.hasMsg = false;
  221. result.msg_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance;
  222. return this;
  223. }
  224. }
  225. }
  226. public sealed partial class TestRequiredOptimizedForSize : pb::GeneratedMessage<TestRequiredOptimizedForSize, TestRequiredOptimizedForSize.Builder> {
  227. private static readonly TestRequiredOptimizedForSize defaultInstance = new Builder().BuildPartial();
  228. public static TestRequiredOptimizedForSize DefaultInstance {
  229. get { return defaultInstance; }
  230. }
  231. public override TestRequiredOptimizedForSize DefaultInstanceForType {
  232. get { return defaultInstance; }
  233. }
  234. protected override TestRequiredOptimizedForSize ThisMessage {
  235. get { return this; }
  236. }
  237. public static pbd::MessageDescriptor Descriptor {
  238. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor; }
  239. }
  240. protected override pb::FieldAccess.FieldAccessorTable<TestRequiredOptimizedForSize, TestRequiredOptimizedForSize.Builder> InternalFieldAccessors {
  241. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable; }
  242. }
  243. // required int32 x = 1;
  244. private bool hasX;
  245. private int x_ = 0;
  246. public bool HasX {
  247. get { return hasX; }
  248. }
  249. public int X {
  250. get { return x_; }
  251. }
  252. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::ByteString data) {
  253. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  254. }
  255. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::ByteString data,
  256. pb::ExtensionRegistry extensionRegistry) {
  257. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  258. .BuildParsed();
  259. }
  260. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(byte[] data) {
  261. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  262. }
  263. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(byte[] data,
  264. pb::ExtensionRegistry extensionRegistry) {
  265. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  266. .BuildParsed();
  267. }
  268. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(global::System.IO.Stream input) {
  269. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  270. }
  271. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(
  272. global::System.IO.Stream input,
  273. pb::ExtensionRegistry extensionRegistry) {
  274. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  275. .BuildParsed();
  276. }
  277. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::CodedInputStream input) {
  278. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  279. }
  280. public static global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize ParseFrom(pb::CodedInputStream input,
  281. pb::ExtensionRegistry extensionRegistry) {
  282. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  283. .BuildParsed();
  284. }
  285. public static Builder CreateBuilder() { return new Builder(); }
  286. public override Builder CreateBuilderForType() { return new Builder(); }
  287. public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize prototype) {
  288. return (Builder) new Builder().MergeFrom(prototype);
  289. }
  290. public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize, Builder> {
  291. protected override Builder ThisBuilder {
  292. get { return this; }
  293. }
  294. // Construct using global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.CreateBuilder()
  295. public Builder() {}
  296. global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize();
  297. protected override global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize MessageBeingBuilt {
  298. get { return result; }
  299. }
  300. public override Builder Clear() {
  301. result = new global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize();
  302. return this;
  303. }
  304. public override Builder Clone() {
  305. return new Builder().MergeFrom(result);
  306. }
  307. public override pbd::MessageDescriptor DescriptorForType {
  308. get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Descriptor; }
  309. }
  310. public override global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize DefaultInstanceForType {
  311. get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance; }
  312. }
  313. public override global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize BuildPartial() {
  314. global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize returnMe = result;
  315. result = null;
  316. return returnMe;
  317. }
  318. // required int32 x = 1;
  319. public bool HasX {
  320. get { return result.HasX; }
  321. }
  322. public int X {
  323. get { return result.X; }
  324. set { SetX(value); }
  325. }
  326. public Builder SetX(int value) {
  327. result.hasX = true;
  328. result.x_ = value;
  329. return this;
  330. }
  331. public Builder ClearX() {
  332. result.hasX = false;
  333. result.x_ = 0;
  334. return this;
  335. }
  336. }
  337. }
  338. public sealed partial class TestOptionalOptimizedForSize : pb::GeneratedMessage<TestOptionalOptimizedForSize, TestOptionalOptimizedForSize.Builder> {
  339. private static readonly TestOptionalOptimizedForSize defaultInstance = new Builder().BuildPartial();
  340. public static TestOptionalOptimizedForSize DefaultInstance {
  341. get { return defaultInstance; }
  342. }
  343. public override TestOptionalOptimizedForSize DefaultInstanceForType {
  344. get { return defaultInstance; }
  345. }
  346. protected override TestOptionalOptimizedForSize ThisMessage {
  347. get { return this; }
  348. }
  349. public static pbd::MessageDescriptor Descriptor {
  350. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor; }
  351. }
  352. protected override pb::FieldAccess.FieldAccessorTable<TestOptionalOptimizedForSize, TestOptionalOptimizedForSize.Builder> InternalFieldAccessors {
  353. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable; }
  354. }
  355. // optional .protobuf_unittest.TestRequiredOptimizedForSize o = 1;
  356. private bool hasO;
  357. private global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize o_ = global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance;
  358. public bool HasO {
  359. get { return hasO; }
  360. }
  361. public global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize O {
  362. get { return o_; }
  363. }
  364. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::ByteString data) {
  365. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  366. }
  367. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::ByteString data,
  368. pb::ExtensionRegistry extensionRegistry) {
  369. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  370. .BuildParsed();
  371. }
  372. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(byte[] data) {
  373. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  374. }
  375. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(byte[] data,
  376. pb::ExtensionRegistry extensionRegistry) {
  377. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  378. .BuildParsed();
  379. }
  380. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(global::System.IO.Stream input) {
  381. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  382. }
  383. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(
  384. global::System.IO.Stream input,
  385. pb::ExtensionRegistry extensionRegistry) {
  386. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  387. .BuildParsed();
  388. }
  389. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::CodedInputStream input) {
  390. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  391. }
  392. public static global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize ParseFrom(pb::CodedInputStream input,
  393. pb::ExtensionRegistry extensionRegistry) {
  394. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  395. .BuildParsed();
  396. }
  397. public static Builder CreateBuilder() { return new Builder(); }
  398. public override Builder CreateBuilderForType() { return new Builder(); }
  399. public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize prototype) {
  400. return (Builder) new Builder().MergeFrom(prototype);
  401. }
  402. public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize, Builder> {
  403. protected override Builder ThisBuilder {
  404. get { return this; }
  405. }
  406. // Construct using global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.CreateBuilder()
  407. public Builder() {}
  408. global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize();
  409. protected override global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize MessageBeingBuilt {
  410. get { return result; }
  411. }
  412. public override Builder Clear() {
  413. result = new global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize();
  414. return this;
  415. }
  416. public override Builder Clone() {
  417. return new Builder().MergeFrom(result);
  418. }
  419. public override pbd::MessageDescriptor DescriptorForType {
  420. get { return global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Descriptor; }
  421. }
  422. public override global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize DefaultInstanceForType {
  423. get { return global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.DefaultInstance; }
  424. }
  425. public override global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize BuildPartial() {
  426. global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize returnMe = result;
  427. result = null;
  428. return returnMe;
  429. }
  430. // optional .protobuf_unittest.TestRequiredOptimizedForSize o = 1;
  431. public bool HasO {
  432. get { return result.HasO; }
  433. }
  434. public global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize O {
  435. get { return result.O; }
  436. set { SetO(value); }
  437. }
  438. public Builder SetO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize value) {
  439. result.hasO = true;
  440. result.o_ = value;
  441. return this;
  442. }
  443. public Builder SetO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder builderForValue) {
  444. result.hasO = true;
  445. result.o_ = builderForValue.Build();
  446. return this;
  447. }
  448. public Builder MergeO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize value) {
  449. if (result.HasO &&
  450. result.o_ != global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance) {
  451. result.o_ =
  452. global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.CreateBuilder(result.o_).MergeFrom(value).BuildPartial();
  453. } else {
  454. result.o_ = value;
  455. }
  456. result.hasO = true;
  457. return this;
  458. }
  459. public Builder ClearO() {
  460. result.hasO = false;
  461. result.o_ = global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance;
  462. return this;
  463. }
  464. }
  465. }
  466. #endregion
  467. #region Services
  468. #endregion
  469. }