/src/test/java/tap/formats/tapproto/Testmsg.java

https://github.com/dmoore247/tap · Java · 380 lines · 331 code · 38 blank · 11 comment · 30 complexity · 2e0f85304aeae00ea26275a6891db1b5 MD5 · raw file

  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: testmsg.proto
  3. package tap.formats.tapproto;
  4. public final class Testmsg {
  5. private Testmsg() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public static final class TestMsg extends
  10. com.google.protobuf.GeneratedMessage {
  11. // Use TestMsg.newBuilder() to construct.
  12. private TestMsg() {
  13. initFields();
  14. }
  15. private TestMsg(boolean noInit) {}
  16. private static final TestMsg defaultInstance;
  17. public static TestMsg getDefaultInstance() {
  18. return defaultInstance;
  19. }
  20. public TestMsg getDefaultInstanceForType() {
  21. return defaultInstance;
  22. }
  23. public static final com.google.protobuf.Descriptors.Descriptor
  24. getDescriptor() {
  25. return tap.formats.tapproto.Testmsg.internal_static_tap_formats_tapproto_TestMsg_descriptor;
  26. }
  27. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  28. internalGetFieldAccessorTable() {
  29. return tap.formats.tapproto.Testmsg.internal_static_tap_formats_tapproto_TestMsg_fieldAccessorTable;
  30. }
  31. // optional int32 size = 1;
  32. public static final int SIZE_FIELD_NUMBER = 1;
  33. private boolean hasSize;
  34. private int size_ = 0;
  35. public boolean hasSize() { return hasSize; }
  36. public int getSize() { return size_; }
  37. // required string data = 2;
  38. public static final int DATA_FIELD_NUMBER = 2;
  39. private boolean hasData;
  40. private java.lang.String data_ = "";
  41. public boolean hasData() { return hasData; }
  42. public java.lang.String getData() { return data_; }
  43. private void initFields() {
  44. }
  45. public final boolean isInitialized() {
  46. if (!hasData) return false;
  47. return true;
  48. }
  49. public void writeTo(com.google.protobuf.CodedOutputStream output)
  50. throws java.io.IOException {
  51. getSerializedSize();
  52. if (hasSize()) {
  53. output.writeInt32(1, getSize());
  54. }
  55. if (hasData()) {
  56. output.writeString(2, getData());
  57. }
  58. getUnknownFields().writeTo(output);
  59. }
  60. private int memoizedSerializedSize = -1;
  61. public int getSerializedSize() {
  62. int size = memoizedSerializedSize;
  63. if (size != -1) return size;
  64. size = 0;
  65. if (hasSize()) {
  66. size += com.google.protobuf.CodedOutputStream
  67. .computeInt32Size(1, getSize());
  68. }
  69. if (hasData()) {
  70. size += com.google.protobuf.CodedOutputStream
  71. .computeStringSize(2, getData());
  72. }
  73. size += getUnknownFields().getSerializedSize();
  74. memoizedSerializedSize = size;
  75. return size;
  76. }
  77. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
  78. com.google.protobuf.ByteString data)
  79. throws com.google.protobuf.InvalidProtocolBufferException {
  80. return newBuilder().mergeFrom(data).buildParsed();
  81. }
  82. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
  83. com.google.protobuf.ByteString data,
  84. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  85. throws com.google.protobuf.InvalidProtocolBufferException {
  86. return newBuilder().mergeFrom(data, extensionRegistry)
  87. .buildParsed();
  88. }
  89. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(byte[] data)
  90. throws com.google.protobuf.InvalidProtocolBufferException {
  91. return newBuilder().mergeFrom(data).buildParsed();
  92. }
  93. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
  94. byte[] data,
  95. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  96. throws com.google.protobuf.InvalidProtocolBufferException {
  97. return newBuilder().mergeFrom(data, extensionRegistry)
  98. .buildParsed();
  99. }
  100. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(java.io.InputStream input)
  101. throws java.io.IOException {
  102. return newBuilder().mergeFrom(input).buildParsed();
  103. }
  104. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
  105. java.io.InputStream input,
  106. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  107. throws java.io.IOException {
  108. return newBuilder().mergeFrom(input, extensionRegistry)
  109. .buildParsed();
  110. }
  111. public static tap.formats.tapproto.Testmsg.TestMsg parseDelimitedFrom(java.io.InputStream input)
  112. throws java.io.IOException {
  113. Builder builder = newBuilder();
  114. if (builder.mergeDelimitedFrom(input)) {
  115. return builder.buildParsed();
  116. } else {
  117. return null;
  118. }
  119. }
  120. public static tap.formats.tapproto.Testmsg.TestMsg parseDelimitedFrom(
  121. java.io.InputStream input,
  122. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  123. throws java.io.IOException {
  124. Builder builder = newBuilder();
  125. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  126. return builder.buildParsed();
  127. } else {
  128. return null;
  129. }
  130. }
  131. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
  132. com.google.protobuf.CodedInputStream input)
  133. throws java.io.IOException {
  134. return newBuilder().mergeFrom(input).buildParsed();
  135. }
  136. public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
  137. com.google.protobuf.CodedInputStream input,
  138. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  139. throws java.io.IOException {
  140. return newBuilder().mergeFrom(input, extensionRegistry)
  141. .buildParsed();
  142. }
  143. public static Builder newBuilder() { return Builder.create(); }
  144. public Builder newBuilderForType() { return newBuilder(); }
  145. public static Builder newBuilder(tap.formats.tapproto.Testmsg.TestMsg prototype) {
  146. return newBuilder().mergeFrom(prototype);
  147. }
  148. public Builder toBuilder() { return newBuilder(this); }
  149. public static final class Builder extends
  150. com.google.protobuf.GeneratedMessage.Builder<Builder> {
  151. private tap.formats.tapproto.Testmsg.TestMsg result;
  152. // Construct using tap.formats.tapproto.Testmsg.TestMsg.newBuilder()
  153. private Builder() {}
  154. private static Builder create() {
  155. Builder builder = new Builder();
  156. builder.result = new tap.formats.tapproto.Testmsg.TestMsg();
  157. return builder;
  158. }
  159. protected tap.formats.tapproto.Testmsg.TestMsg internalGetResult() {
  160. return result;
  161. }
  162. public Builder clear() {
  163. if (result == null) {
  164. throw new IllegalStateException(
  165. "Cannot call clear() after build().");
  166. }
  167. result = new tap.formats.tapproto.Testmsg.TestMsg();
  168. return this;
  169. }
  170. public Builder clone() {
  171. return create().mergeFrom(result);
  172. }
  173. public com.google.protobuf.Descriptors.Descriptor
  174. getDescriptorForType() {
  175. return tap.formats.tapproto.Testmsg.TestMsg.getDescriptor();
  176. }
  177. public tap.formats.tapproto.Testmsg.TestMsg getDefaultInstanceForType() {
  178. return tap.formats.tapproto.Testmsg.TestMsg.getDefaultInstance();
  179. }
  180. public boolean isInitialized() {
  181. return result.isInitialized();
  182. }
  183. public tap.formats.tapproto.Testmsg.TestMsg build() {
  184. if (result != null && !isInitialized()) {
  185. throw newUninitializedMessageException(result);
  186. }
  187. return buildPartial();
  188. }
  189. private tap.formats.tapproto.Testmsg.TestMsg buildParsed()
  190. throws com.google.protobuf.InvalidProtocolBufferException {
  191. if (!isInitialized()) {
  192. throw newUninitializedMessageException(
  193. result).asInvalidProtocolBufferException();
  194. }
  195. return buildPartial();
  196. }
  197. public tap.formats.tapproto.Testmsg.TestMsg buildPartial() {
  198. if (result == null) {
  199. throw new IllegalStateException(
  200. "build() has already been called on this Builder.");
  201. }
  202. tap.formats.tapproto.Testmsg.TestMsg returnMe = result;
  203. result = null;
  204. return returnMe;
  205. }
  206. public Builder mergeFrom(com.google.protobuf.Message other) {
  207. if (other instanceof tap.formats.tapproto.Testmsg.TestMsg) {
  208. return mergeFrom((tap.formats.tapproto.Testmsg.TestMsg)other);
  209. } else {
  210. super.mergeFrom(other);
  211. return this;
  212. }
  213. }
  214. public Builder mergeFrom(tap.formats.tapproto.Testmsg.TestMsg other) {
  215. if (other == tap.formats.tapproto.Testmsg.TestMsg.getDefaultInstance()) return this;
  216. if (other.hasSize()) {
  217. setSize(other.getSize());
  218. }
  219. if (other.hasData()) {
  220. setData(other.getData());
  221. }
  222. this.mergeUnknownFields(other.getUnknownFields());
  223. return this;
  224. }
  225. public Builder mergeFrom(
  226. com.google.protobuf.CodedInputStream input,
  227. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  228. throws java.io.IOException {
  229. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  230. com.google.protobuf.UnknownFieldSet.newBuilder(
  231. this.getUnknownFields());
  232. while (true) {
  233. int tag = input.readTag();
  234. switch (tag) {
  235. case 0:
  236. this.setUnknownFields(unknownFields.build());
  237. return this;
  238. default: {
  239. if (!parseUnknownField(input, unknownFields,
  240. extensionRegistry, tag)) {
  241. this.setUnknownFields(unknownFields.build());
  242. return this;
  243. }
  244. break;
  245. }
  246. case 8: {
  247. setSize(input.readInt32());
  248. break;
  249. }
  250. case 18: {
  251. setData(input.readString());
  252. break;
  253. }
  254. }
  255. }
  256. }
  257. // optional int32 size = 1;
  258. public boolean hasSize() {
  259. return result.hasSize();
  260. }
  261. public int getSize() {
  262. return result.getSize();
  263. }
  264. public Builder setSize(int value) {
  265. result.hasSize = true;
  266. result.size_ = value;
  267. return this;
  268. }
  269. public Builder clearSize() {
  270. result.hasSize = false;
  271. result.size_ = 0;
  272. return this;
  273. }
  274. // required string data = 2;
  275. public boolean hasData() {
  276. return result.hasData();
  277. }
  278. public java.lang.String getData() {
  279. return result.getData();
  280. }
  281. public Builder setData(java.lang.String value) {
  282. if (value == null) {
  283. throw new NullPointerException();
  284. }
  285. result.hasData = true;
  286. result.data_ = value;
  287. return this;
  288. }
  289. public Builder clearData() {
  290. result.hasData = false;
  291. result.data_ = getDefaultInstance().getData();
  292. return this;
  293. }
  294. // @@protoc_insertion_point(builder_scope:tap.formats.tapproto.TestMsg)
  295. }
  296. static {
  297. defaultInstance = new TestMsg(true);
  298. tap.formats.tapproto.Testmsg.internalForceInit();
  299. defaultInstance.initFields();
  300. }
  301. // @@protoc_insertion_point(class_scope:tap.formats.tapproto.TestMsg)
  302. }
  303. private static com.google.protobuf.Descriptors.Descriptor
  304. internal_static_tap_formats_tapproto_TestMsg_descriptor;
  305. private static
  306. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  307. internal_static_tap_formats_tapproto_TestMsg_fieldAccessorTable;
  308. public static com.google.protobuf.Descriptors.FileDescriptor
  309. getDescriptor() {
  310. return descriptor;
  311. }
  312. private static com.google.protobuf.Descriptors.FileDescriptor
  313. descriptor;
  314. static {
  315. java.lang.String[] descriptorData = {
  316. "\n\rtestmsg.proto\022\024tap.formats.tapproto\"%\n" +
  317. "\007TestMsg\022\014\n\004size\030\001 \001(\005\022\014\n\004data\030\002 \002(\t"
  318. };
  319. com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
  320. new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  321. public com.google.protobuf.ExtensionRegistry assignDescriptors(
  322. com.google.protobuf.Descriptors.FileDescriptor root) {
  323. descriptor = root;
  324. internal_static_tap_formats_tapproto_TestMsg_descriptor =
  325. getDescriptor().getMessageTypes().get(0);
  326. internal_static_tap_formats_tapproto_TestMsg_fieldAccessorTable = new
  327. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  328. internal_static_tap_formats_tapproto_TestMsg_descriptor,
  329. new java.lang.String[] { "Size", "Data", },
  330. tap.formats.tapproto.Testmsg.TestMsg.class,
  331. tap.formats.tapproto.Testmsg.TestMsg.Builder.class);
  332. return null;
  333. }
  334. };
  335. com.google.protobuf.Descriptors.FileDescriptor
  336. .internalBuildGeneratedFileFrom(descriptorData,
  337. new com.google.protobuf.Descriptors.FileDescriptor[] {
  338. }, assigner);
  339. }
  340. public static void internalForceInit() {}
  341. // @@protoc_insertion_point(outer_class_scope)
  342. }