PageRenderTime 51ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/JGameSocketServer/src/main/java/com/glu/rpc/service/RpcProtobuf.java

http://flex-mmorpg-server.googlecode.com/
Java | 889 lines | 788 code | 82 blank | 19 comment | 75 complexity | 48cad235096e3f9fd556263866145cd1 MD5 | raw file
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. package com.glu.rpc.service;
  3. import com.google.protobuf.UninitializedMessageException;
  4. public final class RpcProtobuf {
  5. private RpcProtobuf() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public enum ErrorReason
  10. implements com.google.protobuf.ProtocolMessageEnum {
  11. BAD_REQUEST_DATA(0, 0),
  12. BAD_REQUEST_PROTO(1, 1),
  13. SERVICE_NOT_FOUND(2, 2),
  14. METHOD_NOT_FOUND(3, 3),
  15. RPC_ERROR(4, 4),
  16. RPC_FAILED(5, 5),
  17. ;
  18. public final int getNumber() { return value; }
  19. public static ErrorReason valueOf(int value) {
  20. switch (value) {
  21. case 0: return BAD_REQUEST_DATA;
  22. case 1: return BAD_REQUEST_PROTO;
  23. case 2: return SERVICE_NOT_FOUND;
  24. case 3: return METHOD_NOT_FOUND;
  25. case 4: return RPC_ERROR;
  26. case 5: return RPC_FAILED;
  27. default: return null;
  28. }
  29. }
  30. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  31. getValueDescriptor() {
  32. return getDescriptor().getValues().get(index);
  33. }
  34. public final com.google.protobuf.Descriptors.EnumDescriptor
  35. getDescriptorForType() {
  36. return getDescriptor();
  37. }
  38. public static final com.google.protobuf.Descriptors.EnumDescriptor
  39. getDescriptor() {
  40. return com.glu.rpc.service.RpcProtobuf.getDescriptor().getEnumTypes().get(0);
  41. }
  42. private static final ErrorReason[] VALUES = {
  43. BAD_REQUEST_DATA, BAD_REQUEST_PROTO, SERVICE_NOT_FOUND, METHOD_NOT_FOUND, RPC_ERROR, RPC_FAILED,
  44. };
  45. public static ErrorReason valueOf(
  46. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  47. if (desc.getType() != getDescriptor()) {
  48. throw new java.lang.IllegalArgumentException(
  49. "EnumValueDescriptor is not for this type.");
  50. }
  51. return VALUES[desc.getIndex()];
  52. }
  53. private final int index;
  54. private final int value;
  55. private ErrorReason(int index, int value) {
  56. this.index = index;
  57. this.value = value;
  58. }
  59. static {
  60. com.glu.rpc.service.RpcProtobuf.getDescriptor();
  61. }
  62. }
  63. public static final class Request extends
  64. com.google.protobuf.GeneratedMessage {
  65. // Use Request.newBuilder() to construct.
  66. private Request() {}
  67. private static final Request defaultInstance = new Request();
  68. public static Request getDefaultInstance() {
  69. return defaultInstance;
  70. }
  71. public Request getDefaultInstanceForType() {
  72. return defaultInstance;
  73. }
  74. public static final com.google.protobuf.Descriptors.Descriptor
  75. getDescriptor() {
  76. return com.glu.rpc.service.RpcProtobuf.internal_static_com_glu_rpc_service_Request_descriptor;
  77. }
  78. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  79. internalGetFieldAccessorTable() {
  80. return com.glu.rpc.service.RpcProtobuf.internal_static_com_glu_rpc_service_Request_fieldAccessorTable;
  81. }
  82. // required string service_name = 1;
  83. public static final int SERVICE_NAME_FIELD_NUMBER = 1;
  84. private boolean hasServiceName;
  85. private java.lang.String serviceName_ = "";
  86. public boolean hasServiceName() { return hasServiceName; }
  87. public java.lang.String getServiceName() { return serviceName_; }
  88. // required string method_name = 2;
  89. public static final int METHOD_NAME_FIELD_NUMBER = 2;
  90. private boolean hasMethodName;
  91. private java.lang.String methodName_ = "";
  92. public boolean hasMethodName() { return hasMethodName; }
  93. public java.lang.String getMethodName() { return methodName_; }
  94. // optional bytes request_proto = 3;
  95. public static final int REQUEST_PROTO_FIELD_NUMBER = 3;
  96. private boolean hasRequestProto;
  97. private com.google.protobuf.ByteString requestProto_ = com.google.protobuf.ByteString.EMPTY;
  98. public boolean hasRequestProto() { return hasRequestProto; }
  99. public com.google.protobuf.ByteString getRequestProto() { return requestProto_; }
  100. public final boolean isInitialized() {
  101. if (!hasServiceName) return false;
  102. if (!hasMethodName) return false;
  103. return true;
  104. }
  105. public void writeTo(com.google.protobuf.CodedOutputStream output)
  106. throws java.io.IOException {
  107. if (hasServiceName()) {
  108. output.writeString(1, getServiceName());
  109. }
  110. if (hasMethodName()) {
  111. output.writeString(2, getMethodName());
  112. }
  113. if (hasRequestProto()) {
  114. output.writeBytes(3, getRequestProto());
  115. }
  116. getUnknownFields().writeTo(output);
  117. }
  118. private int memoizedSerializedSize = -1;
  119. public int getSerializedSize() {
  120. int size = memoizedSerializedSize;
  121. if (size != -1) return size;
  122. size = 0;
  123. if (hasServiceName()) {
  124. size += com.google.protobuf.CodedOutputStream
  125. .computeStringSize(1, getServiceName());
  126. }
  127. if (hasMethodName()) {
  128. size += com.google.protobuf.CodedOutputStream
  129. .computeStringSize(2, getMethodName());
  130. }
  131. if (hasRequestProto()) {
  132. size += com.google.protobuf.CodedOutputStream
  133. .computeBytesSize(3, getRequestProto());
  134. }
  135. size += getUnknownFields().getSerializedSize();
  136. memoizedSerializedSize = size;
  137. return size;
  138. }
  139. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(
  140. com.google.protobuf.ByteString data)
  141. throws com.google.protobuf.InvalidProtocolBufferException {
  142. return newBuilder().mergeFrom(data).buildParsed();
  143. }
  144. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(
  145. com.google.protobuf.ByteString data,
  146. com.google.protobuf.ExtensionRegistry extensionRegistry)
  147. throws com.google.protobuf.InvalidProtocolBufferException {
  148. return newBuilder().mergeFrom(data, extensionRegistry)
  149. .buildParsed();
  150. }
  151. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(byte[] data)
  152. throws com.google.protobuf.InvalidProtocolBufferException {
  153. return newBuilder().mergeFrom(data).buildParsed();
  154. }
  155. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(
  156. byte[] data,
  157. com.google.protobuf.ExtensionRegistry extensionRegistry)
  158. throws com.google.protobuf.InvalidProtocolBufferException {
  159. return newBuilder().mergeFrom(data, extensionRegistry)
  160. .buildParsed();
  161. }
  162. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(java.io.InputStream input)
  163. throws java.io.IOException {
  164. return newBuilder().mergeFrom(input).buildParsed();
  165. }
  166. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(
  167. java.io.InputStream input,
  168. com.google.protobuf.ExtensionRegistry extensionRegistry)
  169. throws java.io.IOException {
  170. return newBuilder().mergeFrom(input, extensionRegistry)
  171. .buildParsed();
  172. }
  173. public static com.glu.rpc.service.RpcProtobuf.Request parseDelimitedFrom(java.io.InputStream input)
  174. throws java.io.IOException {
  175. return newBuilder().mergeDelimitedFrom(input).buildParsed();
  176. }
  177. public static com.glu.rpc.service.RpcProtobuf.Request parseDelimitedFrom(
  178. java.io.InputStream input,
  179. com.google.protobuf.ExtensionRegistry extensionRegistry)
  180. throws java.io.IOException {
  181. return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
  182. .buildParsed();
  183. }
  184. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(
  185. com.google.protobuf.CodedInputStream input)
  186. throws java.io.IOException {
  187. return newBuilder().mergeFrom(input).buildParsed();
  188. }
  189. public static com.glu.rpc.service.RpcProtobuf.Request parseFrom(
  190. com.google.protobuf.CodedInputStream input,
  191. com.google.protobuf.ExtensionRegistry extensionRegistry)
  192. throws java.io.IOException {
  193. return newBuilder().mergeFrom(input, extensionRegistry)
  194. .buildParsed();
  195. }
  196. public static Builder newBuilder() { return Builder.create(); }
  197. public Builder newBuilderForType() { return newBuilder(); }
  198. public static Builder newBuilder(com.glu.rpc.service.RpcProtobuf.Request prototype) {
  199. return newBuilder().mergeFrom(prototype);
  200. }
  201. public Builder toBuilder() { return newBuilder(this); }
  202. public static final class Builder extends
  203. com.google.protobuf.GeneratedMessage.Builder<Builder> {
  204. private com.glu.rpc.service.RpcProtobuf.Request result;
  205. // Construct using com.glu.rpc.service.RpcProtobuf.Request.newBuilder()
  206. private Builder() {}
  207. private static Builder create() {
  208. Builder builder = new Builder();
  209. builder.result = new com.glu.rpc.service.RpcProtobuf.Request();
  210. return builder;
  211. }
  212. protected com.glu.rpc.service.RpcProtobuf.Request internalGetResult() {
  213. return result;
  214. }
  215. public Builder clear() {
  216. if (result == null) {
  217. throw new IllegalStateException(
  218. "Cannot call clear() after build().");
  219. }
  220. result = new com.glu.rpc.service.RpcProtobuf.Request();
  221. return this;
  222. }
  223. public Builder clone() {
  224. return create().mergeFrom(result);
  225. }
  226. public com.google.protobuf.Descriptors.Descriptor
  227. getDescriptorForType() {
  228. return com.glu.rpc.service.RpcProtobuf.Request.getDescriptor();
  229. }
  230. public com.glu.rpc.service.RpcProtobuf.Request getDefaultInstanceForType() {
  231. return com.glu.rpc.service.RpcProtobuf.Request.getDefaultInstance();
  232. }
  233. public boolean isInitialized() {
  234. return result.isInitialized();
  235. }
  236. public com.glu.rpc.service.RpcProtobuf.Request build() {
  237. if (result != null && !isInitialized()) {
  238. throw new UninitializedMessageException(result);
  239. }
  240. return buildPartial();
  241. }
  242. private com.glu.rpc.service.RpcProtobuf.Request buildParsed()
  243. throws com.google.protobuf.InvalidProtocolBufferException {
  244. if (!isInitialized()) {
  245. throw new UninitializedMessageException(
  246. result).asInvalidProtocolBufferException();
  247. }
  248. return buildPartial();
  249. }
  250. public com.glu.rpc.service.RpcProtobuf.Request buildPartial() {
  251. if (result == null) {
  252. throw new IllegalStateException(
  253. "build() has already been called on this Builder.");
  254. }
  255. com.glu.rpc.service.RpcProtobuf.Request returnMe = result;
  256. result = null;
  257. return returnMe;
  258. }
  259. public Builder mergeFrom(com.google.protobuf.Message other) {
  260. if (other instanceof com.glu.rpc.service.RpcProtobuf.Request) {
  261. return mergeFrom((com.glu.rpc.service.RpcProtobuf.Request)other);
  262. } else {
  263. super.mergeFrom(other);
  264. return this;
  265. }
  266. }
  267. public Builder mergeFrom(com.glu.rpc.service.RpcProtobuf.Request other) {
  268. if (other == com.glu.rpc.service.RpcProtobuf.Request.getDefaultInstance()) return this;
  269. if (other.hasServiceName()) {
  270. setServiceName(other.getServiceName());
  271. }
  272. if (other.hasMethodName()) {
  273. setMethodName(other.getMethodName());
  274. }
  275. if (other.hasRequestProto()) {
  276. setRequestProto(other.getRequestProto());
  277. }
  278. this.mergeUnknownFields(other.getUnknownFields());
  279. return this;
  280. }
  281. public Builder mergeFrom(
  282. com.google.protobuf.CodedInputStream input,
  283. com.google.protobuf.ExtensionRegistry extensionRegistry)
  284. throws java.io.IOException {
  285. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  286. com.google.protobuf.UnknownFieldSet.newBuilder(
  287. this.getUnknownFields());
  288. while (true) {
  289. int tag = input.readTag();
  290. switch (tag) {
  291. case 0:
  292. this.setUnknownFields(unknownFields.build());
  293. return this;
  294. default: {
  295. if (!parseUnknownField(input, unknownFields,
  296. extensionRegistry, tag)) {
  297. this.setUnknownFields(unknownFields.build());
  298. return this;
  299. }
  300. break;
  301. }
  302. case 10: {
  303. setServiceName(input.readString());
  304. break;
  305. }
  306. case 18: {
  307. setMethodName(input.readString());
  308. break;
  309. }
  310. case 26: {
  311. setRequestProto(input.readBytes());
  312. break;
  313. }
  314. }
  315. }
  316. }
  317. // required string service_name = 1;
  318. public boolean hasServiceName() {
  319. return result.hasServiceName();
  320. }
  321. public java.lang.String getServiceName() {
  322. return result.getServiceName();
  323. }
  324. public Builder setServiceName(java.lang.String value) {
  325. if (value == null) {
  326. throw new NullPointerException();
  327. }
  328. result.hasServiceName = true;
  329. result.serviceName_ = value;
  330. return this;
  331. }
  332. public Builder clearServiceName() {
  333. result.hasServiceName = false;
  334. result.serviceName_ = getDefaultInstance().getServiceName();
  335. return this;
  336. }
  337. // required string method_name = 2;
  338. public boolean hasMethodName() {
  339. return result.hasMethodName();
  340. }
  341. public java.lang.String getMethodName() {
  342. return result.getMethodName();
  343. }
  344. public Builder setMethodName(java.lang.String value) {
  345. if (value == null) {
  346. throw new NullPointerException();
  347. }
  348. result.hasMethodName = true;
  349. result.methodName_ = value;
  350. return this;
  351. }
  352. public Builder clearMethodName() {
  353. result.hasMethodName = false;
  354. result.methodName_ = getDefaultInstance().getMethodName();
  355. return this;
  356. }
  357. // optional bytes request_proto = 3;
  358. public boolean hasRequestProto() {
  359. return result.hasRequestProto();
  360. }
  361. public com.google.protobuf.ByteString getRequestProto() {
  362. return result.getRequestProto();
  363. }
  364. public Builder setRequestProto(com.google.protobuf.ByteString value) {
  365. if (value == null) {
  366. throw new NullPointerException();
  367. }
  368. result.hasRequestProto = true;
  369. result.requestProto_ = value;
  370. return this;
  371. }
  372. public Builder clearRequestProto() {
  373. result.hasRequestProto = false;
  374. result.requestProto_ = getDefaultInstance().getRequestProto();
  375. return this;
  376. }
  377. }
  378. static {
  379. com.glu.rpc.service.RpcProtobuf.getDescriptor();
  380. }
  381. static {
  382. com.glu.rpc.service.RpcProtobuf.internalForceInit();
  383. }
  384. }
  385. public static final class Response extends
  386. com.google.protobuf.GeneratedMessage {
  387. // Use Response.newBuilder() to construct.
  388. private Response() {}
  389. private static final Response defaultInstance = new Response();
  390. public static Response getDefaultInstance() {
  391. return defaultInstance;
  392. }
  393. public Response getDefaultInstanceForType() {
  394. return defaultInstance;
  395. }
  396. public static final com.google.protobuf.Descriptors.Descriptor
  397. getDescriptor() {
  398. return com.glu.rpc.service.RpcProtobuf.internal_static_com_glu_rpc_service_Response_descriptor;
  399. }
  400. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  401. internalGetFieldAccessorTable() {
  402. return com.glu.rpc.service.RpcProtobuf.internal_static_com_glu_rpc_service_Response_fieldAccessorTable;
  403. }
  404. // optional bytes response_proto = 1;
  405. public static final int RESPONSE_PROTO_FIELD_NUMBER = 1;
  406. private boolean hasResponseProto;
  407. private com.google.protobuf.ByteString responseProto_ = com.google.protobuf.ByteString.EMPTY;
  408. public boolean hasResponseProto() { return hasResponseProto; }
  409. public com.google.protobuf.ByteString getResponseProto() { return responseProto_; }
  410. // optional string error = 2;
  411. public static final int ERROR_FIELD_NUMBER = 2;
  412. private boolean hasError;
  413. private java.lang.String error_ = "";
  414. public boolean hasError() { return hasError; }
  415. public java.lang.String getError() { return error_; }
  416. // optional bool callback = 3 [default = false];
  417. public static final int CALLBACK_FIELD_NUMBER = 3;
  418. private boolean hasCallback;
  419. private boolean callback_ = false;
  420. public boolean hasCallback() { return hasCallback; }
  421. public boolean getCallback() { return callback_; }
  422. // optional .com.glu.rpc.service.ErrorReason error_reason = 4 [default = BAD_REQUEST_PROTO];
  423. public static final int ERROR_REASON_FIELD_NUMBER = 4;
  424. private boolean hasErrorReason;
  425. private com.glu.rpc.service.RpcProtobuf.ErrorReason errorReason_ = com.glu.rpc.service.RpcProtobuf.ErrorReason.BAD_REQUEST_PROTO;
  426. public boolean hasErrorReason() { return hasErrorReason; }
  427. public com.glu.rpc.service.RpcProtobuf.ErrorReason getErrorReason() { return errorReason_; }
  428. public final boolean isInitialized() {
  429. return true;
  430. }
  431. public void writeTo(com.google.protobuf.CodedOutputStream output)
  432. throws java.io.IOException {
  433. if (hasResponseProto()) {
  434. output.writeBytes(1, getResponseProto());
  435. }
  436. if (hasError()) {
  437. output.writeString(2, getError());
  438. }
  439. if (hasCallback()) {
  440. output.writeBool(3, getCallback());
  441. }
  442. if (hasErrorReason()) {
  443. output.writeEnum(4, getErrorReason().getNumber());
  444. }
  445. getUnknownFields().writeTo(output);
  446. }
  447. private int memoizedSerializedSize = -1;
  448. public int getSerializedSize() {
  449. int size = memoizedSerializedSize;
  450. if (size != -1) return size;
  451. size = 0;
  452. if (hasResponseProto()) {
  453. size += com.google.protobuf.CodedOutputStream
  454. .computeBytesSize(1, getResponseProto());
  455. }
  456. if (hasError()) {
  457. size += com.google.protobuf.CodedOutputStream
  458. .computeStringSize(2, getError());
  459. }
  460. if (hasCallback()) {
  461. size += com.google.protobuf.CodedOutputStream
  462. .computeBoolSize(3, getCallback());
  463. }
  464. if (hasErrorReason()) {
  465. size += com.google.protobuf.CodedOutputStream
  466. .computeEnumSize(4, getErrorReason().getNumber());
  467. }
  468. size += getUnknownFields().getSerializedSize();
  469. memoizedSerializedSize = size;
  470. return size;
  471. }
  472. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(
  473. com.google.protobuf.ByteString data)
  474. throws com.google.protobuf.InvalidProtocolBufferException {
  475. return newBuilder().mergeFrom(data).buildParsed();
  476. }
  477. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(
  478. com.google.protobuf.ByteString data,
  479. com.google.protobuf.ExtensionRegistry extensionRegistry)
  480. throws com.google.protobuf.InvalidProtocolBufferException {
  481. return newBuilder().mergeFrom(data, extensionRegistry)
  482. .buildParsed();
  483. }
  484. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(byte[] data)
  485. throws com.google.protobuf.InvalidProtocolBufferException {
  486. return newBuilder().mergeFrom(data).buildParsed();
  487. }
  488. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(
  489. byte[] data,
  490. com.google.protobuf.ExtensionRegistry extensionRegistry)
  491. throws com.google.protobuf.InvalidProtocolBufferException {
  492. return newBuilder().mergeFrom(data, extensionRegistry)
  493. .buildParsed();
  494. }
  495. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(java.io.InputStream input)
  496. throws java.io.IOException {
  497. return newBuilder().mergeFrom(input).buildParsed();
  498. }
  499. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(
  500. java.io.InputStream input,
  501. com.google.protobuf.ExtensionRegistry extensionRegistry)
  502. throws java.io.IOException {
  503. return newBuilder().mergeFrom(input, extensionRegistry)
  504. .buildParsed();
  505. }
  506. public static com.glu.rpc.service.RpcProtobuf.Response parseDelimitedFrom(java.io.InputStream input)
  507. throws java.io.IOException {
  508. return newBuilder().mergeDelimitedFrom(input).buildParsed();
  509. }
  510. public static com.glu.rpc.service.RpcProtobuf.Response parseDelimitedFrom(
  511. java.io.InputStream input,
  512. com.google.protobuf.ExtensionRegistry extensionRegistry)
  513. throws java.io.IOException {
  514. return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
  515. .buildParsed();
  516. }
  517. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(
  518. com.google.protobuf.CodedInputStream input)
  519. throws java.io.IOException {
  520. return newBuilder().mergeFrom(input).buildParsed();
  521. }
  522. public static com.glu.rpc.service.RpcProtobuf.Response parseFrom(
  523. com.google.protobuf.CodedInputStream input,
  524. com.google.protobuf.ExtensionRegistry extensionRegistry)
  525. throws java.io.IOException {
  526. return newBuilder().mergeFrom(input, extensionRegistry)
  527. .buildParsed();
  528. }
  529. public static Builder newBuilder() { return Builder.create(); }
  530. public Builder newBuilderForType() { return newBuilder(); }
  531. public static Builder newBuilder(com.glu.rpc.service.RpcProtobuf.Response prototype) {
  532. return newBuilder().mergeFrom(prototype);
  533. }
  534. public Builder toBuilder() { return newBuilder(this); }
  535. public static final class Builder extends
  536. com.google.protobuf.GeneratedMessage.Builder<Builder> {
  537. private com.glu.rpc.service.RpcProtobuf.Response result;
  538. // Construct using com.glu.rpc.service.RpcProtobuf.Response.newBuilder()
  539. private Builder() {}
  540. private static Builder create() {
  541. Builder builder = new Builder();
  542. builder.result = new com.glu.rpc.service.RpcProtobuf.Response();
  543. return builder;
  544. }
  545. protected com.glu.rpc.service.RpcProtobuf.Response internalGetResult() {
  546. return result;
  547. }
  548. public Builder clear() {
  549. if (result == null) {
  550. throw new IllegalStateException(
  551. "Cannot call clear() after build().");
  552. }
  553. result = new com.glu.rpc.service.RpcProtobuf.Response();
  554. return this;
  555. }
  556. public Builder clone() {
  557. return create().mergeFrom(result);
  558. }
  559. public com.google.protobuf.Descriptors.Descriptor
  560. getDescriptorForType() {
  561. return com.glu.rpc.service.RpcProtobuf.Response.getDescriptor();
  562. }
  563. public com.glu.rpc.service.RpcProtobuf.Response getDefaultInstanceForType() {
  564. return com.glu.rpc.service.RpcProtobuf.Response.getDefaultInstance();
  565. }
  566. public boolean isInitialized() {
  567. return result.isInitialized();
  568. }
  569. public com.glu.rpc.service.RpcProtobuf.Response build() {
  570. if (result != null && !isInitialized()) {
  571. throw new UninitializedMessageException(result);
  572. }
  573. return buildPartial();
  574. }
  575. private com.glu.rpc.service.RpcProtobuf.Response buildParsed()
  576. throws com.google.protobuf.InvalidProtocolBufferException {
  577. if (!isInitialized()) {
  578. throw new UninitializedMessageException(
  579. result).asInvalidProtocolBufferException();
  580. }
  581. return buildPartial();
  582. }
  583. public com.glu.rpc.service.RpcProtobuf.Response buildPartial() {
  584. if (result == null) {
  585. throw new IllegalStateException(
  586. "build() has already been called on this Builder.");
  587. }
  588. com.glu.rpc.service.RpcProtobuf.Response returnMe = result;
  589. result = null;
  590. return returnMe;
  591. }
  592. public Builder mergeFrom(com.google.protobuf.Message other) {
  593. if (other instanceof com.glu.rpc.service.RpcProtobuf.Response) {
  594. return mergeFrom((com.glu.rpc.service.RpcProtobuf.Response)other);
  595. } else {
  596. super.mergeFrom(other);
  597. return this;
  598. }
  599. }
  600. public Builder mergeFrom(com.glu.rpc.service.RpcProtobuf.Response other) {
  601. if (other == com.glu.rpc.service.RpcProtobuf.Response.getDefaultInstance()) return this;
  602. if (other.hasResponseProto()) {
  603. setResponseProto(other.getResponseProto());
  604. }
  605. if (other.hasError()) {
  606. setError(other.getError());
  607. }
  608. if (other.hasCallback()) {
  609. setCallback(other.getCallback());
  610. }
  611. if (other.hasErrorReason()) {
  612. setErrorReason(other.getErrorReason());
  613. }
  614. this.mergeUnknownFields(other.getUnknownFields());
  615. return this;
  616. }
  617. public Builder mergeFrom(
  618. com.google.protobuf.CodedInputStream input,
  619. com.google.protobuf.ExtensionRegistry extensionRegistry)
  620. throws java.io.IOException {
  621. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  622. com.google.protobuf.UnknownFieldSet.newBuilder(
  623. this.getUnknownFields());
  624. while (true) {
  625. int tag = input.readTag();
  626. switch (tag) {
  627. case 0:
  628. this.setUnknownFields(unknownFields.build());
  629. return this;
  630. default: {
  631. if (!parseUnknownField(input, unknownFields,
  632. extensionRegistry, tag)) {
  633. this.setUnknownFields(unknownFields.build());
  634. return this;
  635. }
  636. break;
  637. }
  638. case 10: {
  639. setResponseProto(input.readBytes());
  640. break;
  641. }
  642. case 18: {
  643. setError(input.readString());
  644. break;
  645. }
  646. case 24: {
  647. setCallback(input.readBool());
  648. break;
  649. }
  650. case 32: {
  651. int rawValue = input.readEnum();
  652. com.glu.rpc.service.RpcProtobuf.ErrorReason value = com.glu.rpc.service.RpcProtobuf.ErrorReason.valueOf(rawValue);
  653. if (value == null) {
  654. unknownFields.mergeVarintField(4, rawValue);
  655. } else {
  656. setErrorReason(value);
  657. }
  658. break;
  659. }
  660. }
  661. }
  662. }
  663. // optional bytes response_proto = 1;
  664. public boolean hasResponseProto() {
  665. return result.hasResponseProto();
  666. }
  667. public com.google.protobuf.ByteString getResponseProto() {
  668. return result.getResponseProto();
  669. }
  670. public Builder setResponseProto(com.google.protobuf.ByteString value) {
  671. if (value == null) {
  672. throw new NullPointerException();
  673. }
  674. result.hasResponseProto = true;
  675. result.responseProto_ = value;
  676. return this;
  677. }
  678. public Builder clearResponseProto() {
  679. result.hasResponseProto = false;
  680. result.responseProto_ = getDefaultInstance().getResponseProto();
  681. return this;
  682. }
  683. // optional string error = 2;
  684. public boolean hasError() {
  685. return result.hasError();
  686. }
  687. public java.lang.String getError() {
  688. return result.getError();
  689. }
  690. public Builder setError(java.lang.String value) {
  691. if (value == null) {
  692. throw new NullPointerException();
  693. }
  694. result.hasError = true;
  695. result.error_ = value;
  696. return this;
  697. }
  698. public Builder clearError() {
  699. result.hasError = false;
  700. result.error_ = getDefaultInstance().getError();
  701. return this;
  702. }
  703. // optional bool callback = 3 [default = false];
  704. public boolean hasCallback() {
  705. return result.hasCallback();
  706. }
  707. public boolean getCallback() {
  708. return result.getCallback();
  709. }
  710. public Builder setCallback(boolean value) {
  711. result.hasCallback = true;
  712. result.callback_ = value;
  713. return this;
  714. }
  715. public Builder clearCallback() {
  716. result.hasCallback = false;
  717. result.callback_ = false;
  718. return this;
  719. }
  720. // optional .com.glu.rpc.service.ErrorReason error_reason = 4 [default = BAD_REQUEST_PROTO];
  721. public boolean hasErrorReason() {
  722. return result.hasErrorReason();
  723. }
  724. public com.glu.rpc.service.RpcProtobuf.ErrorReason getErrorReason() {
  725. return result.getErrorReason();
  726. }
  727. public Builder setErrorReason(com.glu.rpc.service.RpcProtobuf.ErrorReason value) {
  728. if (value == null) {
  729. throw new NullPointerException();
  730. }
  731. result.hasErrorReason = true;
  732. result.errorReason_ = value;
  733. return this;
  734. }
  735. public Builder clearErrorReason() {
  736. result.hasErrorReason = false;
  737. result.errorReason_ = com.glu.rpc.service.RpcProtobuf.ErrorReason.BAD_REQUEST_PROTO;
  738. return this;
  739. }
  740. }
  741. static {
  742. com.glu.rpc.service.RpcProtobuf.getDescriptor();
  743. }
  744. static {
  745. com.glu.rpc.service.RpcProtobuf.internalForceInit();
  746. }
  747. }
  748. private static com.google.protobuf.Descriptors.Descriptor
  749. internal_static_com_glu_rpc_service_Request_descriptor;
  750. private static
  751. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  752. internal_static_com_glu_rpc_service_Request_fieldAccessorTable;
  753. private static com.google.protobuf.Descriptors.Descriptor
  754. internal_static_com_glu_rpc_service_Response_descriptor;
  755. private static
  756. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  757. internal_static_com_glu_rpc_service_Response_fieldAccessorTable;
  758. public static com.google.protobuf.Descriptors.FileDescriptor
  759. getDescriptor() {
  760. return descriptor;
  761. }
  762. private static com.google.protobuf.Descriptors.FileDescriptor
  763. descriptor;
  764. static {
  765. java.lang.String descriptorData =
  766. "\n\trpc.proto\022\023com.glu.rpc.service\"K\n\007Requ" +
  767. "est\022\024\n\014service_name\030\001 \002(\t\022\023\n\013method_name" +
  768. "\030\002 \002(\t\022\025\n\rrequest_proto\030\003 \001(\014\"\225\001\n\010Respon" +
  769. "se\022\026\n\016response_proto\030\001 \001(\014\022\r\n\005error\030\002 \001(" +
  770. "\t\022\027\n\010callback\030\003 \001(\010:\005false\022I\n\014error_reas" +
  771. "on\030\004 \001(\0162 .com.glu.rpc.service.ErrorReas" +
  772. "on:\021BAD_REQUEST_PROTO*\206\001\n\013ErrorReason\022\024\n" +
  773. "\020BAD_REQUEST_DATA\020\000\022\025\n\021BAD_REQUEST_PROTO" +
  774. "\020\001\022\025\n\021SERVICE_NOT_FOUND\020\002\022\024\n\020METHOD_NOT_" +
  775. "FOUND\020\003\022\r\n\tRPC_ERROR\020\004\022\016\n\nRPC_FAILED\020\005B$" +
  776. "\n\023com.glu.rpc.serviceB\013RpcProtobufH\001";
  777. com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
  778. new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  779. public com.google.protobuf.ExtensionRegistry assignDescriptors(
  780. com.google.protobuf.Descriptors.FileDescriptor root) {
  781. descriptor = root;
  782. internal_static_com_glu_rpc_service_Request_descriptor =
  783. getDescriptor().getMessageTypes().get(0);
  784. internal_static_com_glu_rpc_service_Request_fieldAccessorTable = new
  785. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  786. internal_static_com_glu_rpc_service_Request_descriptor,
  787. new java.lang.String[] { "ServiceName", "MethodName", "RequestProto", },
  788. com.glu.rpc.service.RpcProtobuf.Request.class,
  789. com.glu.rpc.service.RpcProtobuf.Request.Builder.class);
  790. internal_static_com_glu_rpc_service_Response_descriptor =
  791. getDescriptor().getMessageTypes().get(1);
  792. internal_static_com_glu_rpc_service_Response_fieldAccessorTable = new
  793. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  794. internal_static_com_glu_rpc_service_Response_descriptor,
  795. new java.lang.String[] { "ResponseProto", "Error", "Callback", "ErrorReason", },
  796. com.glu.rpc.service.RpcProtobuf.Response.class,
  797. com.glu.rpc.service.RpcProtobuf.Response.Builder.class);
  798. return null;
  799. }
  800. };
  801. com.google.protobuf.Descriptors.FileDescriptor
  802. .internalBuildGeneratedFileFrom(descriptorData,
  803. new com.google.protobuf.Descriptors.FileDescriptor[] {
  804. }, assigner);
  805. }
  806. public static void internalForceInit() {}
  807. }