From f81bf208d40ddec7857147be1ba31f8699c5bc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9B=84=E5=B3=B0?= Date: Tue, 8 Aug 2017 19:18:15 +0800 Subject: [PATCH] initial version --- eclipse-java-google-style.xml | 337 ++ jigsaw-payment-docs/LICENSE | 201 + jigsaw-payment-docs/README.md | 2 + jigsaw-payment-docs/{ => docs}/design.vsd | Bin .../{ => docs}/支付系统设计.pptx | Bin .../{ => docs}/支付系统设计.xmind | Bin jigsaw-payment-docs/{ => docs}/账务处理.xlsx | Bin .../{ => docs}/账户账务系统设计.pptx | Bin .../main/gen/org/jigsaw/payment/Account.java | 4224 +++++++++++++++++ .../jigsaw/payment/AccountClassification.java | 184 + .../org/jigsaw/payment/AccountOrBuilder.java | 143 + .../org/jigsaw/payment/AccountSubject.java | 1485 ++++++ .../payment/AccountSubjectOrBuilder.java | 154 + .../main/gen/org/jigsaw/payment/Currency.java | 100 + .../src/main/gen/org/jigsaw/payment/Dict.java | 47 + .../main/gen/org/jigsaw/payment/Entity.java | 169 + .../main/gen/org/jigsaw/payment/Payment.java | 2681 +++++++++++ .../gen/org/jigsaw/payment/PaymentEntity.java | 948 ++++ .../payment/PaymentEntityOrBuilder.java | 77 + .../org/jigsaw/payment/PaymentOrBuilder.java | 333 ++ .../main/gen/org/jigsaw/payment/Property.java | 61 + .../main/gen/org/jigsaw/payment/Version.java | 1591 +++++++ .../org/jigsaw/payment/VersionOrBuilder.java | 173 + .../main/gen/org/jigsaw/payment/Voucher.java | 1291 +++++ .../org/jigsaw/payment/VoucherOrBuilder.java | 128 + .../main/gen/org/jigsaw/payment/Hello.java | 3500 ++++++++++++++ .../jigsaw/payment/rpc/hello/HelloClient.java | 54 + .../payment/rpc/hello/HelloClientConfig.java | 104 + .../main/resources/hello.client.properties | 10 + .../src/main/resources/hello.proto | 29 + .../src/main/resources/log4j.properties | 37 + .../src/main}/resources/logback-test.xml | 36 +- .../main/gen/org/jigsaw/payment/Hello.java | 3500 ++++++++++++++ .../payment/rpc/config/HelloClientConfig.java | 112 + .../rpc/hello/server/FooController.java | 28 + .../rpc/hello/server/HelloController.java | 27 + .../payment/rpc/hello/server/HelloServer.java | 20 + .../rpc/hello/server/HelloServerConfig.java | 95 +- .../src/main/resources/hello.proto | 29 + .../main/resources/hello.server.properties | 14 + .../src/main/resources/log4j.properties | 37 + .../src/main/resources/logback-test.xml | 68 + .../src/conf/deployment.yml | 53 - .../org/jigsaw/payment/rpc/BaseService.java | 1344 ++++++ .../jigsaw/payment/rpc/NotFoundException.java | 489 ++ .../jigsaw/payment/rpc/SystemException.java | 486 ++ .../org/jigsaw/payment/rpc/UserException.java | 488 ++ .../thrift/exception/InvokeException.java | 19 - .../thrift/exception/MysqlDBException.java | 15 - .../thrift/register/JsonSerializer.java | 108 - .../thrift/server/BaseController.java | 66 - .../thrift/server/BaseProtobufRepository.java | 694 --- .../thrift/server/BaseRPCServer.java | 33 - .../knowledge/thrift/server/Controller.java | 28 - .../thrift/server/TProtobufProcessor.java | 265 -- .../thrift/sharder/PooledTransport.java | 29 - .../thrift/sharder/TransportPoolType.java | 7 - .../knowledge/thrift/utils/JsonBinder.java | 109 - .../knowledge/thrift/utils/PidRecorder.java | 104 - .../knowledge/thrift/utils/ProtoBinder.java | 195 - .../thrift/utils/RpcServiceBinder.java | 289 -- .../payment/rpc}/register/DigestAuthInfo.java | 12 +- .../payment/rpc/register/JsonSerializer.java | 137 + .../payment/rpc}/register/RpcPayload.java | 14 +- .../payment/rpc/server/BaseController.java | 46 + .../jigsaw/payment/rpc/server/Controller.java | 25 + .../payment/rpc/server/IpPortResolver.java} | 25 +- .../payment/rpc/server/PidRecorder.java | 100 + .../rpc/server/RpcServerConfiguration.java | 183 + .../payment/rpc}/server/ServerRunner.java | 87 +- .../rpc/server/TProtobufProcessor.java | 255 + .../rpc}/sharder/AbstractTransportPool.java | 22 +- .../rpc}/sharder/BasicQosTransportPool.java | 12 +- .../rpc}/sharder/BasicTransportPool.java | 36 +- .../payment/rpc}/sharder/PooledException.java | 14 +- .../payment/rpc/sharder/PooledTransport.java | 20 + .../sharder/RefreshableTransportPool.java | 33 +- .../payment/rpc/sharder/RpcPayload.java | 71 + .../payment/rpc/sharder/RpcServiceClient.java | 104 + .../rpc}/sharder/StaticQpsTransportPool.java | 11 +- .../rpc}/sharder/TTransportWrapper.java | 14 +- .../rpc}/sharder/TransportManager.java | 12 +- .../src/main/resources/rpc_service.thrift | 79 + .../knowledge/thrift/server/Appconfig.java | 35 - .../server/BaseProtobufRepositoryTest.java | 311 -- .../thrift/server/TradeRepository.java | 72 - .../src/test/resources/application.properties | 19 - ...gsaw-rpc-example-server-1.0.0-SNAPSHOT.jar | Bin 0 -> 68588 bytes 88 files changed, 25918 insertions(+), 2681 deletions(-) create mode 100644 eclipse-java-google-style.xml create mode 100644 jigsaw-payment-docs/LICENSE create mode 100644 jigsaw-payment-docs/README.md rename jigsaw-payment-docs/{ => docs}/design.vsd (100%) rename jigsaw-payment-docs/{ => docs}/支付系统设计.pptx (100%) rename jigsaw-payment-docs/{ => docs}/支付系统设计.xmind (100%) rename jigsaw-payment-docs/{ => docs}/账务处理.xlsx (100%) rename jigsaw-payment-docs/{ => docs}/账户账务系统设计.pptx (100%) create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Account.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountClassification.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountOrBuilder.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubject.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubjectOrBuilder.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Currency.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Dict.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Entity.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Payment.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntity.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntityOrBuilder.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentOrBuilder.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Property.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Version.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VersionOrBuilder.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Voucher.java create mode 100644 jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VoucherOrBuilder.java create mode 100644 jigsaw-rpc-example-client/src/main/gen/org/jigsaw/payment/Hello.java create mode 100644 jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClient.java create mode 100644 jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClientConfig.java create mode 100644 jigsaw-rpc-example-client/src/main/resources/hello.client.properties create mode 100644 jigsaw-rpc-example-client/src/main/resources/hello.proto create mode 100644 jigsaw-rpc-example-client/src/main/resources/log4j.properties rename {jigsaw-thrift-protobuf/src/test => jigsaw-rpc-example-client/src/main}/resources/logback-test.xml (64%) create mode 100644 jigsaw-rpc-example-server/src/main/gen/org/jigsaw/payment/Hello.java create mode 100644 jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/config/HelloClientConfig.java create mode 100644 jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/FooController.java create mode 100644 jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloController.java create mode 100644 jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServer.java rename jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/config/RpcServerAutoConfiguration.java => jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServerConfig.java (74%) create mode 100644 jigsaw-rpc-example-server/src/main/resources/hello.proto create mode 100644 jigsaw-rpc-example-server/src/main/resources/hello.server.properties create mode 100644 jigsaw-rpc-example-server/src/main/resources/log4j.properties create mode 100644 jigsaw-rpc-example-server/src/main/resources/logback-test.xml delete mode 100644 jigsaw-thrift-protobuf/src/conf/deployment.yml create mode 100644 jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/BaseService.java create mode 100644 jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/NotFoundException.java create mode 100644 jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/SystemException.java create mode 100644 jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/UserException.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/InvokeException.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/MysqlDBException.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/JsonSerializer.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseController.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepository.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseRPCServer.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/Controller.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/TProtobufProcessor.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledTransport.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportPoolType.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/JsonBinder.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/PidRecorder.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/ProtoBinder.java delete mode 100644 jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/RpcServiceBinder.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/register/DigestAuthInfo.java (74%) create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/JsonSerializer.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/register/RpcPayload.java (84%) create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/BaseController.java create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/Controller.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift/utils/IpPortUtil.java => org/jigsaw/payment/rpc/server/IpPortResolver.java} (85%) create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/PidRecorder.java create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/RpcServerConfiguration.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/server/ServerRunner.java (60%) create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/TProtobufProcessor.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/AbstractTransportPool.java (94%) rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/BasicQosTransportPool.java (96%) rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/BasicTransportPool.java (89%) rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/PooledException.java (59%) create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledTransport.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/RefreshableTransportPool.java (91%) create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcPayload.java create mode 100644 jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcServiceClient.java rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/StaticQpsTransportPool.java (89%) rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/TTransportWrapper.java (89%) rename jigsaw-thrift-protobuf/src/main/java/{com/qiyi/knowledge/thrift => org/jigsaw/payment/rpc}/sharder/TransportManager.java (76%) create mode 100644 jigsaw-thrift-protobuf/src/main/resources/rpc_service.thrift delete mode 100644 jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/Appconfig.java delete mode 100644 jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepositoryTest.java delete mode 100644 jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/TradeRepository.java delete mode 100644 jigsaw-thrift-protobuf/src/test/resources/application.properties create mode 100644 libs/jigsaw-rpc-example-server-1.0.0-SNAPSHOT.jar diff --git a/eclipse-java-google-style.xml b/eclipse-java-google-style.xml new file mode 100644 index 0000000..08d930a --- /dev/null +++ b/eclipse-java-google-style.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jigsaw-payment-docs/LICENSE b/jigsaw-payment-docs/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/jigsaw-payment-docs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/jigsaw-payment-docs/README.md b/jigsaw-payment-docs/README.md new file mode 100644 index 0000000..4cbc41d --- /dev/null +++ b/jigsaw-payment-docs/README.md @@ -0,0 +1,2 @@ +# jigsaw-payment-schema +支付相关的数据标准 diff --git a/jigsaw-payment-docs/design.vsd b/jigsaw-payment-docs/docs/design.vsd similarity index 100% rename from jigsaw-payment-docs/design.vsd rename to jigsaw-payment-docs/docs/design.vsd diff --git a/jigsaw-payment-docs/支付系统设计.pptx b/jigsaw-payment-docs/docs/支付系统设计.pptx similarity index 100% rename from jigsaw-payment-docs/支付系统设计.pptx rename to jigsaw-payment-docs/docs/支付系统设计.pptx diff --git a/jigsaw-payment-docs/支付系统设计.xmind b/jigsaw-payment-docs/docs/支付系统设计.xmind similarity index 100% rename from jigsaw-payment-docs/支付系统设计.xmind rename to jigsaw-payment-docs/docs/支付系统设计.xmind diff --git a/jigsaw-payment-docs/账务处理.xlsx b/jigsaw-payment-docs/docs/账务处理.xlsx similarity index 100% rename from jigsaw-payment-docs/账务处理.xlsx rename to jigsaw-payment-docs/docs/账务处理.xlsx diff --git a/jigsaw-payment-docs/账户账务系统设计.pptx b/jigsaw-payment-docs/docs/账户账务系统设计.pptx similarity index 100% rename from jigsaw-payment-docs/账户账务系统设计.pptx rename to jigsaw-payment-docs/docs/账户账务系统设计.pptx diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Account.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Account.java new file mode 100644 index 0000000..70098bd --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Account.java @@ -0,0 +1,4224 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 支付账户(外部)
+ * 
+ * 
+ * + * Protobuf type {@code org.jigsaw.payment.Account} + */ +public final class Account extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.Account) + AccountOrBuilder { + // Use Account.newBuilder() to construct. + private Account(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Account() { + id_ = 0L; + status_ = 1; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Account( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt64(); + break; + } + case 74: { + org.jigsaw.payment.Version.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = version_.toBuilder(); + } + version_ = input.readMessage(org.jigsaw.payment.Version.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 168: { + int rawValue = input.readEnum(); + org.jigsaw.payment.Account.Status value = org.jigsaw.payment.Account.Status.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(21, rawValue); + } else { + bitField0_ |= 0x00000004; + status_ = rawValue; + } + break; + } + case 178: { + org.jigsaw.payment.AccountSubject.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = subject_.toBuilder(); + } + subject_ = input.readMessage(org.jigsaw.payment.AccountSubject.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(subject_); + subject_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 186: { + org.jigsaw.payment.Account.Balance.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = balance_.toBuilder(); + } + balance_ = input.readMessage(org.jigsaw.payment.Account.Balance.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(balance_); + balance_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 194: { + org.jigsaw.payment.Account.Permission.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = permission_.toBuilder(); + } + permission_ = input.readMessage(org.jigsaw.payment.Account.Permission.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(permission_); + permission_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Account.class, org.jigsaw.payment.Account.Builder.class); + } + + /** + * Protobuf enum {@code org.jigsaw.payment.Account.Status} + */ + public enum Status + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     *初始
+     * 
+ * + * INITIALIZED = 1; + */ + INITIALIZED(1), + /** + *
+     *激活
+     * 
+ * + * ACTIVIED = 2; + */ + ACTIVIED(2), + /** + *
+     *冻结
+     * 
+ * + * FROZEN = 3; + */ + FROZEN(3), + /** + *
+     *关闭
+     * 
+ * + * CLOSED = 4; + */ + CLOSED(4), + ; + + /** + *
+     *初始
+     * 
+ * + * INITIALIZED = 1; + */ + public static final int INITIALIZED_VALUE = 1; + /** + *
+     *激活
+     * 
+ * + * ACTIVIED = 2; + */ + public static final int ACTIVIED_VALUE = 2; + /** + *
+     *冻结
+     * 
+ * + * FROZEN = 3; + */ + public static final int FROZEN_VALUE = 3; + /** + *
+     *关闭
+     * 
+ * + * CLOSED = 4; + */ + public static final int CLOSED_VALUE = 4; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Status valueOf(int value) { + return forNumber(value); + } + + public static Status forNumber(int value) { + switch (value) { + case 1: return INITIALIZED; + case 2: return ACTIVIED; + case 3: return FROZEN; + case 4: return CLOSED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Status findValueByNumber(int number) { + return Status.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jigsaw.payment.Account.getDescriptor().getEnumTypes().get(0); + } + + private static final Status[] VALUES = values(); + + public static Status valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jigsaw.payment.Account.Status) + } + + public interface BalanceOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.Account.Balance) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *货币单位,可以是ISO
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + boolean hasCurrency(); + /** + *
+     *货币单位,可以是ISO
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + org.jigsaw.payment.Currency getCurrency(); + + /** + *
+     *余额
+     * 
+ * + * required int64 rest_balance = 2; + */ + boolean hasRestBalance(); + /** + *
+     *余额
+     * 
+ * + * required int64 rest_balance = 2; + */ + long getRestBalance(); + + /** + *
+     *充值金额
+     * 
+ * + * required int64 total_balance = 3; + */ + boolean hasTotalBalance(); + /** + *
+     *充值金额
+     * 
+ * + * required int64 total_balance = 3; + */ + long getTotalBalance(); + + /** + *
+     *冻结金额
+     * 
+ * + * required int64 frozen_balance = 4; + */ + boolean hasFrozenBalance(); + /** + *
+     *冻结金额
+     * 
+ * + * required int64 frozen_balance = 4; + */ + long getFrozenBalance(); + } + /** + *
+   **
+   * 账户余额信息
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.Account.Balance} + */ + public static final class Balance extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.Account.Balance) + BalanceOrBuilder { + // Use Balance.newBuilder() to construct. + private Balance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Balance() { + currency_ = 1; + restBalance_ = 0L; + totalBalance_ = 0L; + frozenBalance_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Balance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.jigsaw.payment.Currency value = org.jigsaw.payment.Currency.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + currency_ = rawValue; + } + break; + } + case 16: { + bitField0_ |= 0x00000002; + restBalance_ = input.readInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + totalBalance_ = input.readInt64(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + frozenBalance_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Balance_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Balance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Account.Balance.class, org.jigsaw.payment.Account.Balance.Builder.class); + } + + private int bitField0_; + public static final int CURRENCY_FIELD_NUMBER = 1; + private int currency_; + /** + *
+     *货币单位,可以是ISO
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + public boolean hasCurrency() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *货币单位,可以是ISO
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + public org.jigsaw.payment.Currency getCurrency() { + org.jigsaw.payment.Currency result = org.jigsaw.payment.Currency.valueOf(currency_); + return result == null ? org.jigsaw.payment.Currency.RMB : result; + } + + public static final int REST_BALANCE_FIELD_NUMBER = 2; + private long restBalance_; + /** + *
+     *余额
+     * 
+ * + * required int64 rest_balance = 2; + */ + public boolean hasRestBalance() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     *余额
+     * 
+ * + * required int64 rest_balance = 2; + */ + public long getRestBalance() { + return restBalance_; + } + + public static final int TOTAL_BALANCE_FIELD_NUMBER = 3; + private long totalBalance_; + /** + *
+     *充值金额
+     * 
+ * + * required int64 total_balance = 3; + */ + public boolean hasTotalBalance() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     *充值金额
+     * 
+ * + * required int64 total_balance = 3; + */ + public long getTotalBalance() { + return totalBalance_; + } + + public static final int FROZEN_BALANCE_FIELD_NUMBER = 4; + private long frozenBalance_; + /** + *
+     *冻结金额
+     * 
+ * + * required int64 frozen_balance = 4; + */ + public boolean hasFrozenBalance() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     *冻结金额
+     * 
+ * + * required int64 frozen_balance = 4; + */ + public long getFrozenBalance() { + return frozenBalance_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasCurrency()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRestBalance()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTotalBalance()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasFrozenBalance()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, currency_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, restBalance_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, totalBalance_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, frozenBalance_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, currency_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, restBalance_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, totalBalance_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, frozenBalance_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Account.Balance)) { + return super.equals(obj); + } + org.jigsaw.payment.Account.Balance other = (org.jigsaw.payment.Account.Balance) obj; + + boolean result = true; + result = result && (hasCurrency() == other.hasCurrency()); + if (hasCurrency()) { + result = result && currency_ == other.currency_; + } + result = result && (hasRestBalance() == other.hasRestBalance()); + if (hasRestBalance()) { + result = result && (getRestBalance() + == other.getRestBalance()); + } + result = result && (hasTotalBalance() == other.hasTotalBalance()); + if (hasTotalBalance()) { + result = result && (getTotalBalance() + == other.getTotalBalance()); + } + result = result && (hasFrozenBalance() == other.hasFrozenBalance()); + if (hasFrozenBalance()) { + result = result && (getFrozenBalance() + == other.getFrozenBalance()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCurrency()) { + hash = (37 * hash) + CURRENCY_FIELD_NUMBER; + hash = (53 * hash) + currency_; + } + if (hasRestBalance()) { + hash = (37 * hash) + REST_BALANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRestBalance()); + } + if (hasTotalBalance()) { + hash = (37 * hash) + TOTAL_BALANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalBalance()); + } + if (hasFrozenBalance()) { + hash = (37 * hash) + FROZEN_BALANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFrozenBalance()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Account.Balance parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account.Balance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account.Balance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Account.Balance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account.Balance parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account.Balance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Account.Balance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     **
+     * 账户余额信息
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.Account.Balance} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.Account.Balance) + org.jigsaw.payment.Account.BalanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Balance_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Balance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Account.Balance.class, org.jigsaw.payment.Account.Balance.Builder.class); + } + + // Construct using org.jigsaw.payment.Account.Balance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + currency_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + restBalance_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + totalBalance_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + frozenBalance_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Balance_descriptor; + } + + public org.jigsaw.payment.Account.Balance getDefaultInstanceForType() { + return org.jigsaw.payment.Account.Balance.getDefaultInstance(); + } + + public org.jigsaw.payment.Account.Balance build() { + org.jigsaw.payment.Account.Balance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Account.Balance buildPartial() { + org.jigsaw.payment.Account.Balance result = new org.jigsaw.payment.Account.Balance(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.currency_ = currency_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.restBalance_ = restBalance_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.totalBalance_ = totalBalance_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.frozenBalance_ = frozenBalance_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Account.Balance) { + return mergeFrom((org.jigsaw.payment.Account.Balance)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Account.Balance other) { + if (other == org.jigsaw.payment.Account.Balance.getDefaultInstance()) return this; + if (other.hasCurrency()) { + setCurrency(other.getCurrency()); + } + if (other.hasRestBalance()) { + setRestBalance(other.getRestBalance()); + } + if (other.hasTotalBalance()) { + setTotalBalance(other.getTotalBalance()); + } + if (other.hasFrozenBalance()) { + setFrozenBalance(other.getFrozenBalance()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasCurrency()) { + return false; + } + if (!hasRestBalance()) { + return false; + } + if (!hasTotalBalance()) { + return false; + } + if (!hasFrozenBalance()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Account.Balance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Account.Balance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int currency_ = 1; + /** + *
+       *货币单位,可以是ISO
+       * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + public boolean hasCurrency() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       *货币单位,可以是ISO
+       * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + public org.jigsaw.payment.Currency getCurrency() { + org.jigsaw.payment.Currency result = org.jigsaw.payment.Currency.valueOf(currency_); + return result == null ? org.jigsaw.payment.Currency.RMB : result; + } + /** + *
+       *货币单位,可以是ISO
+       * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + public Builder setCurrency(org.jigsaw.payment.Currency value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + currency_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       *货币单位,可以是ISO
+       * 
+ * + * required .org.jigsaw.payment.Currency currency = 1; + */ + public Builder clearCurrency() { + bitField0_ = (bitField0_ & ~0x00000001); + currency_ = 1; + onChanged(); + return this; + } + + private long restBalance_ ; + /** + *
+       *余额
+       * 
+ * + * required int64 rest_balance = 2; + */ + public boolean hasRestBalance() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       *余额
+       * 
+ * + * required int64 rest_balance = 2; + */ + public long getRestBalance() { + return restBalance_; + } + /** + *
+       *余额
+       * 
+ * + * required int64 rest_balance = 2; + */ + public Builder setRestBalance(long value) { + bitField0_ |= 0x00000002; + restBalance_ = value; + onChanged(); + return this; + } + /** + *
+       *余额
+       * 
+ * + * required int64 rest_balance = 2; + */ + public Builder clearRestBalance() { + bitField0_ = (bitField0_ & ~0x00000002); + restBalance_ = 0L; + onChanged(); + return this; + } + + private long totalBalance_ ; + /** + *
+       *充值金额
+       * 
+ * + * required int64 total_balance = 3; + */ + public boolean hasTotalBalance() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       *充值金额
+       * 
+ * + * required int64 total_balance = 3; + */ + public long getTotalBalance() { + return totalBalance_; + } + /** + *
+       *充值金额
+       * 
+ * + * required int64 total_balance = 3; + */ + public Builder setTotalBalance(long value) { + bitField0_ |= 0x00000004; + totalBalance_ = value; + onChanged(); + return this; + } + /** + *
+       *充值金额
+       * 
+ * + * required int64 total_balance = 3; + */ + public Builder clearTotalBalance() { + bitField0_ = (bitField0_ & ~0x00000004); + totalBalance_ = 0L; + onChanged(); + return this; + } + + private long frozenBalance_ ; + /** + *
+       *冻结金额
+       * 
+ * + * required int64 frozen_balance = 4; + */ + public boolean hasFrozenBalance() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       *冻结金额
+       * 
+ * + * required int64 frozen_balance = 4; + */ + public long getFrozenBalance() { + return frozenBalance_; + } + /** + *
+       *冻结金额
+       * 
+ * + * required int64 frozen_balance = 4; + */ + public Builder setFrozenBalance(long value) { + bitField0_ |= 0x00000008; + frozenBalance_ = value; + onChanged(); + return this; + } + /** + *
+       *冻结金额
+       * 
+ * + * required int64 frozen_balance = 4; + */ + public Builder clearFrozenBalance() { + bitField0_ = (bitField0_ & ~0x00000008); + frozenBalance_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.Account.Balance) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.Account.Balance) + private static final org.jigsaw.payment.Account.Balance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Account.Balance(); + } + + public static org.jigsaw.payment.Account.Balance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Balance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Balance(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Account.Balance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PermissionOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.Account.Permission) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *是否允许充值;
+     * 
+ * + * required bool enable_recharge = 1; + */ + boolean hasEnableRecharge(); + /** + *
+     *是否允许充值;
+     * 
+ * + * required bool enable_recharge = 1; + */ + boolean getEnableRecharge(); + + /** + *
+     *是否允许提现;
+     * 
+ * + * required bool enable_withdraw = 2; + */ + boolean hasEnableWithdraw(); + /** + *
+     *是否允许提现;
+     * 
+ * + * required bool enable_withdraw = 2; + */ + boolean getEnableWithdraw(); + + /** + *
+     *是否允许透支;
+     * 
+ * + * required bool enable_overdraw = 3; + */ + boolean hasEnableOverdraw(); + /** + *
+     *是否允许透支;
+     * 
+ * + * required bool enable_overdraw = 3; + */ + boolean getEnableOverdraw(); + + /** + *
+     *是否允许支付;
+     * 
+ * + * required bool enable_payment = 4; + */ + boolean hasEnablePayment(); + /** + *
+     *是否允许支付;
+     * 
+ * + * required bool enable_payment = 4; + */ + boolean getEnablePayment(); + + /** + *
+     *是否允许转账进入;
+     * 
+ * + * required bool enable_transfer_in = 5; + */ + boolean hasEnableTransferIn(); + /** + *
+     *是否允许转账进入;
+     * 
+ * + * required bool enable_transfer_in = 5; + */ + boolean getEnableTransferIn(); + + /** + *
+     *是否允许转账转出;
+     * 
+ * + * required bool enable_transfer_out = 6; + */ + boolean hasEnableTransferOut(); + /** + *
+     *是否允许转账转出;
+     * 
+ * + * required bool enable_transfer_out = 6; + */ + boolean getEnableTransferOut(); + + /** + *
+     *是否有安全保障;
+     * 
+ * + * required bool is_protected = 7; + */ + boolean hasIsProtected(); + /** + *
+     *是否有安全保障;
+     * 
+ * + * required bool is_protected = 7; + */ + boolean getIsProtected(); + + /** + *
+     *是否激活;
+     * 
+ * + * required bool is_actived = 8; + */ + boolean hasIsActived(); + /** + *
+     *是否激活;
+     * 
+ * + * required bool is_actived = 8; + */ + boolean getIsActived(); + + /** + *
+     *是否冻;
+     * 
+ * + * required bool is_frozen = 9; + */ + boolean hasIsFrozen(); + /** + *
+     *是否冻;
+     * 
+ * + * required bool is_frozen = 9; + */ + boolean getIsFrozen(); + } + /** + *
+   **
+   * 账户权限设置
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.Account.Permission} + */ + public static final class Permission extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.Account.Permission) + PermissionOrBuilder { + // Use Permission.newBuilder() to construct. + private Permission(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Permission() { + enableRecharge_ = false; + enableWithdraw_ = false; + enableOverdraw_ = false; + enablePayment_ = false; + enableTransferIn_ = false; + enableTransferOut_ = false; + isProtected_ = false; + isActived_ = false; + isFrozen_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Permission( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + enableRecharge_ = input.readBool(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + enableWithdraw_ = input.readBool(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + enableOverdraw_ = input.readBool(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + enablePayment_ = input.readBool(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + enableTransferIn_ = input.readBool(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + enableTransferOut_ = input.readBool(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + isProtected_ = input.readBool(); + break; + } + case 64: { + bitField0_ |= 0x00000080; + isActived_ = input.readBool(); + break; + } + case 72: { + bitField0_ |= 0x00000100; + isFrozen_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Permission_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Permission_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Account.Permission.class, org.jigsaw.payment.Account.Permission.Builder.class); + } + + private int bitField0_; + public static final int ENABLE_RECHARGE_FIELD_NUMBER = 1; + private boolean enableRecharge_; + /** + *
+     *是否允许充值;
+     * 
+ * + * required bool enable_recharge = 1; + */ + public boolean hasEnableRecharge() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *是否允许充值;
+     * 
+ * + * required bool enable_recharge = 1; + */ + public boolean getEnableRecharge() { + return enableRecharge_; + } + + public static final int ENABLE_WITHDRAW_FIELD_NUMBER = 2; + private boolean enableWithdraw_; + /** + *
+     *是否允许提现;
+     * 
+ * + * required bool enable_withdraw = 2; + */ + public boolean hasEnableWithdraw() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     *是否允许提现;
+     * 
+ * + * required bool enable_withdraw = 2; + */ + public boolean getEnableWithdraw() { + return enableWithdraw_; + } + + public static final int ENABLE_OVERDRAW_FIELD_NUMBER = 3; + private boolean enableOverdraw_; + /** + *
+     *是否允许透支;
+     * 
+ * + * required bool enable_overdraw = 3; + */ + public boolean hasEnableOverdraw() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     *是否允许透支;
+     * 
+ * + * required bool enable_overdraw = 3; + */ + public boolean getEnableOverdraw() { + return enableOverdraw_; + } + + public static final int ENABLE_PAYMENT_FIELD_NUMBER = 4; + private boolean enablePayment_; + /** + *
+     *是否允许支付;
+     * 
+ * + * required bool enable_payment = 4; + */ + public boolean hasEnablePayment() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     *是否允许支付;
+     * 
+ * + * required bool enable_payment = 4; + */ + public boolean getEnablePayment() { + return enablePayment_; + } + + public static final int ENABLE_TRANSFER_IN_FIELD_NUMBER = 5; + private boolean enableTransferIn_; + /** + *
+     *是否允许转账进入;
+     * 
+ * + * required bool enable_transfer_in = 5; + */ + public boolean hasEnableTransferIn() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     *是否允许转账进入;
+     * 
+ * + * required bool enable_transfer_in = 5; + */ + public boolean getEnableTransferIn() { + return enableTransferIn_; + } + + public static final int ENABLE_TRANSFER_OUT_FIELD_NUMBER = 6; + private boolean enableTransferOut_; + /** + *
+     *是否允许转账转出;
+     * 
+ * + * required bool enable_transfer_out = 6; + */ + public boolean hasEnableTransferOut() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     *是否允许转账转出;
+     * 
+ * + * required bool enable_transfer_out = 6; + */ + public boolean getEnableTransferOut() { + return enableTransferOut_; + } + + public static final int IS_PROTECTED_FIELD_NUMBER = 7; + private boolean isProtected_; + /** + *
+     *是否有安全保障;
+     * 
+ * + * required bool is_protected = 7; + */ + public boolean hasIsProtected() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+     *是否有安全保障;
+     * 
+ * + * required bool is_protected = 7; + */ + public boolean getIsProtected() { + return isProtected_; + } + + public static final int IS_ACTIVED_FIELD_NUMBER = 8; + private boolean isActived_; + /** + *
+     *是否激活;
+     * 
+ * + * required bool is_actived = 8; + */ + public boolean hasIsActived() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+     *是否激活;
+     * 
+ * + * required bool is_actived = 8; + */ + public boolean getIsActived() { + return isActived_; + } + + public static final int IS_FROZEN_FIELD_NUMBER = 9; + private boolean isFrozen_; + /** + *
+     *是否冻;
+     * 
+ * + * required bool is_frozen = 9; + */ + public boolean hasIsFrozen() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + *
+     *是否冻;
+     * 
+ * + * required bool is_frozen = 9; + */ + public boolean getIsFrozen() { + return isFrozen_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasEnableRecharge()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEnableWithdraw()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEnableOverdraw()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEnablePayment()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEnableTransferIn()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEnableTransferOut()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasIsProtected()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasIsActived()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasIsFrozen()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, enableRecharge_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBool(2, enableWithdraw_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, enableOverdraw_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBool(4, enablePayment_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBool(5, enableTransferIn_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(6, enableTransferOut_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBool(7, isProtected_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBool(8, isActived_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeBool(9, isFrozen_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enableRecharge_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, enableWithdraw_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, enableOverdraw_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, enablePayment_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, enableTransferIn_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, enableTransferOut_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, isProtected_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, isActived_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, isFrozen_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Account.Permission)) { + return super.equals(obj); + } + org.jigsaw.payment.Account.Permission other = (org.jigsaw.payment.Account.Permission) obj; + + boolean result = true; + result = result && (hasEnableRecharge() == other.hasEnableRecharge()); + if (hasEnableRecharge()) { + result = result && (getEnableRecharge() + == other.getEnableRecharge()); + } + result = result && (hasEnableWithdraw() == other.hasEnableWithdraw()); + if (hasEnableWithdraw()) { + result = result && (getEnableWithdraw() + == other.getEnableWithdraw()); + } + result = result && (hasEnableOverdraw() == other.hasEnableOverdraw()); + if (hasEnableOverdraw()) { + result = result && (getEnableOverdraw() + == other.getEnableOverdraw()); + } + result = result && (hasEnablePayment() == other.hasEnablePayment()); + if (hasEnablePayment()) { + result = result && (getEnablePayment() + == other.getEnablePayment()); + } + result = result && (hasEnableTransferIn() == other.hasEnableTransferIn()); + if (hasEnableTransferIn()) { + result = result && (getEnableTransferIn() + == other.getEnableTransferIn()); + } + result = result && (hasEnableTransferOut() == other.hasEnableTransferOut()); + if (hasEnableTransferOut()) { + result = result && (getEnableTransferOut() + == other.getEnableTransferOut()); + } + result = result && (hasIsProtected() == other.hasIsProtected()); + if (hasIsProtected()) { + result = result && (getIsProtected() + == other.getIsProtected()); + } + result = result && (hasIsActived() == other.hasIsActived()); + if (hasIsActived()) { + result = result && (getIsActived() + == other.getIsActived()); + } + result = result && (hasIsFrozen() == other.hasIsFrozen()); + if (hasIsFrozen()) { + result = result && (getIsFrozen() + == other.getIsFrozen()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnableRecharge()) { + hash = (37 * hash) + ENABLE_RECHARGE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableRecharge()); + } + if (hasEnableWithdraw()) { + hash = (37 * hash) + ENABLE_WITHDRAW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableWithdraw()); + } + if (hasEnableOverdraw()) { + hash = (37 * hash) + ENABLE_OVERDRAW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableOverdraw()); + } + if (hasEnablePayment()) { + hash = (37 * hash) + ENABLE_PAYMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnablePayment()); + } + if (hasEnableTransferIn()) { + hash = (37 * hash) + ENABLE_TRANSFER_IN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableTransferIn()); + } + if (hasEnableTransferOut()) { + hash = (37 * hash) + ENABLE_TRANSFER_OUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableTransferOut()); + } + if (hasIsProtected()) { + hash = (37 * hash) + IS_PROTECTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsProtected()); + } + if (hasIsActived()) { + hash = (37 * hash) + IS_ACTIVED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsActived()); + } + if (hasIsFrozen()) { + hash = (37 * hash) + IS_FROZEN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFrozen()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Account.Permission parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account.Permission parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account.Permission parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Account.Permission parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account.Permission parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account.Permission parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Account.Permission prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     **
+     * 账户权限设置
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.Account.Permission} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.Account.Permission) + org.jigsaw.payment.Account.PermissionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Permission_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Permission_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Account.Permission.class, org.jigsaw.payment.Account.Permission.Builder.class); + } + + // Construct using org.jigsaw.payment.Account.Permission.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + enableRecharge_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + enableWithdraw_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + enableOverdraw_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + enablePayment_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + enableTransferIn_ = false; + bitField0_ = (bitField0_ & ~0x00000010); + enableTransferOut_ = false; + bitField0_ = (bitField0_ & ~0x00000020); + isProtected_ = false; + bitField0_ = (bitField0_ & ~0x00000040); + isActived_ = false; + bitField0_ = (bitField0_ & ~0x00000080); + isFrozen_ = false; + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_Permission_descriptor; + } + + public org.jigsaw.payment.Account.Permission getDefaultInstanceForType() { + return org.jigsaw.payment.Account.Permission.getDefaultInstance(); + } + + public org.jigsaw.payment.Account.Permission build() { + org.jigsaw.payment.Account.Permission result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Account.Permission buildPartial() { + org.jigsaw.payment.Account.Permission result = new org.jigsaw.payment.Account.Permission(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.enableRecharge_ = enableRecharge_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.enableWithdraw_ = enableWithdraw_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.enableOverdraw_ = enableOverdraw_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.enablePayment_ = enablePayment_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.enableTransferIn_ = enableTransferIn_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.enableTransferOut_ = enableTransferOut_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.isProtected_ = isProtected_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.isActived_ = isActived_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.isFrozen_ = isFrozen_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Account.Permission) { + return mergeFrom((org.jigsaw.payment.Account.Permission)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Account.Permission other) { + if (other == org.jigsaw.payment.Account.Permission.getDefaultInstance()) return this; + if (other.hasEnableRecharge()) { + setEnableRecharge(other.getEnableRecharge()); + } + if (other.hasEnableWithdraw()) { + setEnableWithdraw(other.getEnableWithdraw()); + } + if (other.hasEnableOverdraw()) { + setEnableOverdraw(other.getEnableOverdraw()); + } + if (other.hasEnablePayment()) { + setEnablePayment(other.getEnablePayment()); + } + if (other.hasEnableTransferIn()) { + setEnableTransferIn(other.getEnableTransferIn()); + } + if (other.hasEnableTransferOut()) { + setEnableTransferOut(other.getEnableTransferOut()); + } + if (other.hasIsProtected()) { + setIsProtected(other.getIsProtected()); + } + if (other.hasIsActived()) { + setIsActived(other.getIsActived()); + } + if (other.hasIsFrozen()) { + setIsFrozen(other.getIsFrozen()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasEnableRecharge()) { + return false; + } + if (!hasEnableWithdraw()) { + return false; + } + if (!hasEnableOverdraw()) { + return false; + } + if (!hasEnablePayment()) { + return false; + } + if (!hasEnableTransferIn()) { + return false; + } + if (!hasEnableTransferOut()) { + return false; + } + if (!hasIsProtected()) { + return false; + } + if (!hasIsActived()) { + return false; + } + if (!hasIsFrozen()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Account.Permission parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Account.Permission) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private boolean enableRecharge_ ; + /** + *
+       *是否允许充值;
+       * 
+ * + * required bool enable_recharge = 1; + */ + public boolean hasEnableRecharge() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       *是否允许充值;
+       * 
+ * + * required bool enable_recharge = 1; + */ + public boolean getEnableRecharge() { + return enableRecharge_; + } + /** + *
+       *是否允许充值;
+       * 
+ * + * required bool enable_recharge = 1; + */ + public Builder setEnableRecharge(boolean value) { + bitField0_ |= 0x00000001; + enableRecharge_ = value; + onChanged(); + return this; + } + /** + *
+       *是否允许充值;
+       * 
+ * + * required bool enable_recharge = 1; + */ + public Builder clearEnableRecharge() { + bitField0_ = (bitField0_ & ~0x00000001); + enableRecharge_ = false; + onChanged(); + return this; + } + + private boolean enableWithdraw_ ; + /** + *
+       *是否允许提现;
+       * 
+ * + * required bool enable_withdraw = 2; + */ + public boolean hasEnableWithdraw() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       *是否允许提现;
+       * 
+ * + * required bool enable_withdraw = 2; + */ + public boolean getEnableWithdraw() { + return enableWithdraw_; + } + /** + *
+       *是否允许提现;
+       * 
+ * + * required bool enable_withdraw = 2; + */ + public Builder setEnableWithdraw(boolean value) { + bitField0_ |= 0x00000002; + enableWithdraw_ = value; + onChanged(); + return this; + } + /** + *
+       *是否允许提现;
+       * 
+ * + * required bool enable_withdraw = 2; + */ + public Builder clearEnableWithdraw() { + bitField0_ = (bitField0_ & ~0x00000002); + enableWithdraw_ = false; + onChanged(); + return this; + } + + private boolean enableOverdraw_ ; + /** + *
+       *是否允许透支;
+       * 
+ * + * required bool enable_overdraw = 3; + */ + public boolean hasEnableOverdraw() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       *是否允许透支;
+       * 
+ * + * required bool enable_overdraw = 3; + */ + public boolean getEnableOverdraw() { + return enableOverdraw_; + } + /** + *
+       *是否允许透支;
+       * 
+ * + * required bool enable_overdraw = 3; + */ + public Builder setEnableOverdraw(boolean value) { + bitField0_ |= 0x00000004; + enableOverdraw_ = value; + onChanged(); + return this; + } + /** + *
+       *是否允许透支;
+       * 
+ * + * required bool enable_overdraw = 3; + */ + public Builder clearEnableOverdraw() { + bitField0_ = (bitField0_ & ~0x00000004); + enableOverdraw_ = false; + onChanged(); + return this; + } + + private boolean enablePayment_ ; + /** + *
+       *是否允许支付;
+       * 
+ * + * required bool enable_payment = 4; + */ + public boolean hasEnablePayment() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       *是否允许支付;
+       * 
+ * + * required bool enable_payment = 4; + */ + public boolean getEnablePayment() { + return enablePayment_; + } + /** + *
+       *是否允许支付;
+       * 
+ * + * required bool enable_payment = 4; + */ + public Builder setEnablePayment(boolean value) { + bitField0_ |= 0x00000008; + enablePayment_ = value; + onChanged(); + return this; + } + /** + *
+       *是否允许支付;
+       * 
+ * + * required bool enable_payment = 4; + */ + public Builder clearEnablePayment() { + bitField0_ = (bitField0_ & ~0x00000008); + enablePayment_ = false; + onChanged(); + return this; + } + + private boolean enableTransferIn_ ; + /** + *
+       *是否允许转账进入;
+       * 
+ * + * required bool enable_transfer_in = 5; + */ + public boolean hasEnableTransferIn() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       *是否允许转账进入;
+       * 
+ * + * required bool enable_transfer_in = 5; + */ + public boolean getEnableTransferIn() { + return enableTransferIn_; + } + /** + *
+       *是否允许转账进入;
+       * 
+ * + * required bool enable_transfer_in = 5; + */ + public Builder setEnableTransferIn(boolean value) { + bitField0_ |= 0x00000010; + enableTransferIn_ = value; + onChanged(); + return this; + } + /** + *
+       *是否允许转账进入;
+       * 
+ * + * required bool enable_transfer_in = 5; + */ + public Builder clearEnableTransferIn() { + bitField0_ = (bitField0_ & ~0x00000010); + enableTransferIn_ = false; + onChanged(); + return this; + } + + private boolean enableTransferOut_ ; + /** + *
+       *是否允许转账转出;
+       * 
+ * + * required bool enable_transfer_out = 6; + */ + public boolean hasEnableTransferOut() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+       *是否允许转账转出;
+       * 
+ * + * required bool enable_transfer_out = 6; + */ + public boolean getEnableTransferOut() { + return enableTransferOut_; + } + /** + *
+       *是否允许转账转出;
+       * 
+ * + * required bool enable_transfer_out = 6; + */ + public Builder setEnableTransferOut(boolean value) { + bitField0_ |= 0x00000020; + enableTransferOut_ = value; + onChanged(); + return this; + } + /** + *
+       *是否允许转账转出;
+       * 
+ * + * required bool enable_transfer_out = 6; + */ + public Builder clearEnableTransferOut() { + bitField0_ = (bitField0_ & ~0x00000020); + enableTransferOut_ = false; + onChanged(); + return this; + } + + private boolean isProtected_ ; + /** + *
+       *是否有安全保障;
+       * 
+ * + * required bool is_protected = 7; + */ + public boolean hasIsProtected() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+       *是否有安全保障;
+       * 
+ * + * required bool is_protected = 7; + */ + public boolean getIsProtected() { + return isProtected_; + } + /** + *
+       *是否有安全保障;
+       * 
+ * + * required bool is_protected = 7; + */ + public Builder setIsProtected(boolean value) { + bitField0_ |= 0x00000040; + isProtected_ = value; + onChanged(); + return this; + } + /** + *
+       *是否有安全保障;
+       * 
+ * + * required bool is_protected = 7; + */ + public Builder clearIsProtected() { + bitField0_ = (bitField0_ & ~0x00000040); + isProtected_ = false; + onChanged(); + return this; + } + + private boolean isActived_ ; + /** + *
+       *是否激活;
+       * 
+ * + * required bool is_actived = 8; + */ + public boolean hasIsActived() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+       *是否激活;
+       * 
+ * + * required bool is_actived = 8; + */ + public boolean getIsActived() { + return isActived_; + } + /** + *
+       *是否激活;
+       * 
+ * + * required bool is_actived = 8; + */ + public Builder setIsActived(boolean value) { + bitField0_ |= 0x00000080; + isActived_ = value; + onChanged(); + return this; + } + /** + *
+       *是否激活;
+       * 
+ * + * required bool is_actived = 8; + */ + public Builder clearIsActived() { + bitField0_ = (bitField0_ & ~0x00000080); + isActived_ = false; + onChanged(); + return this; + } + + private boolean isFrozen_ ; + /** + *
+       *是否冻;
+       * 
+ * + * required bool is_frozen = 9; + */ + public boolean hasIsFrozen() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + *
+       *是否冻;
+       * 
+ * + * required bool is_frozen = 9; + */ + public boolean getIsFrozen() { + return isFrozen_; + } + /** + *
+       *是否冻;
+       * 
+ * + * required bool is_frozen = 9; + */ + public Builder setIsFrozen(boolean value) { + bitField0_ |= 0x00000100; + isFrozen_ = value; + onChanged(); + return this; + } + /** + *
+       *是否冻;
+       * 
+ * + * required bool is_frozen = 9; + */ + public Builder clearIsFrozen() { + bitField0_ = (bitField0_ & ~0x00000100); + isFrozen_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.Account.Permission) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.Account.Permission) + private static final org.jigsaw.payment.Account.Permission DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Account.Permission(); + } + + public static org.jigsaw.payment.Account.Permission getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Permission parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Permission(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Account.Permission getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int VERSION_FIELD_NUMBER = 9; + private org.jigsaw.payment.Version version_; + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version getVersion() { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder() { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + + public static final int STATUS_FIELD_NUMBER = 21; + private int status_; + /** + *
+   *状态
+   * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+   *状态
+   * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + public org.jigsaw.payment.Account.Status getStatus() { + org.jigsaw.payment.Account.Status result = org.jigsaw.payment.Account.Status.valueOf(status_); + return result == null ? org.jigsaw.payment.Account.Status.INITIALIZED : result; + } + + public static final int SUBJECT_FIELD_NUMBER = 22; + private org.jigsaw.payment.AccountSubject subject_; + /** + *
+   *会计科目
+   * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public boolean hasSubject() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+   *会计科目
+   * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public org.jigsaw.payment.AccountSubject getSubject() { + return subject_ == null ? org.jigsaw.payment.AccountSubject.getDefaultInstance() : subject_; + } + /** + *
+   *会计科目
+   * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public org.jigsaw.payment.AccountSubjectOrBuilder getSubjectOrBuilder() { + return subject_ == null ? org.jigsaw.payment.AccountSubject.getDefaultInstance() : subject_; + } + + public static final int BALANCE_FIELD_NUMBER = 23; + private org.jigsaw.payment.Account.Balance balance_; + /** + *
+   *余额信息
+   * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public boolean hasBalance() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+   *余额信息
+   * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public org.jigsaw.payment.Account.Balance getBalance() { + return balance_ == null ? org.jigsaw.payment.Account.Balance.getDefaultInstance() : balance_; + } + /** + *
+   *余额信息
+   * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public org.jigsaw.payment.Account.BalanceOrBuilder getBalanceOrBuilder() { + return balance_ == null ? org.jigsaw.payment.Account.Balance.getDefaultInstance() : balance_; + } + + public static final int PERMISSION_FIELD_NUMBER = 24; + private org.jigsaw.payment.Account.Permission permission_; + /** + *
+   *权限设置
+   * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public boolean hasPermission() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+   *权限设置
+   * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public org.jigsaw.payment.Account.Permission getPermission() { + return permission_ == null ? org.jigsaw.payment.Account.Permission.getDefaultInstance() : permission_; + } + /** + *
+   *权限设置
+   * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public org.jigsaw.payment.Account.PermissionOrBuilder getPermissionOrBuilder() { + return permission_ == null ? org.jigsaw.payment.Account.Permission.getDefaultInstance() : permission_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasStatus()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasSubject()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasBalance()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPermission()) { + memoizedIsInitialized = 0; + return false; + } + if (!getVersion().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + if (!getSubject().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + if (!getBalance().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + if (!getPermission().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(9, getVersion()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(21, status_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(22, getSubject()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(23, getBalance()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(24, getPermission()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getVersion()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(21, status_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, getSubject()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getBalance()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, getPermission()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Account)) { + return super.equals(obj); + } + org.jigsaw.payment.Account other = (org.jigsaw.payment.Account) obj; + + boolean result = true; + result = result && (hasId() == other.hasId()); + if (hasId()) { + result = result && (getId() + == other.getId()); + } + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && getVersion() + .equals(other.getVersion()); + } + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && status_ == other.status_; + } + result = result && (hasSubject() == other.hasSubject()); + if (hasSubject()) { + result = result && getSubject() + .equals(other.getSubject()); + } + result = result && (hasBalance() == other.hasBalance()); + if (hasBalance()) { + result = result && getBalance() + .equals(other.getBalance()); + } + result = result && (hasPermission() == other.hasPermission()); + if (hasPermission()) { + result = result && getPermission() + .equals(other.getPermission()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + } + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + } + if (hasSubject()) { + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); + } + if (hasBalance()) { + hash = (37 * hash) + BALANCE_FIELD_NUMBER; + hash = (53 * hash) + getBalance().hashCode(); + } + if (hasPermission()) { + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + getPermission().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Account parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Account parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Account parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Account parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Account parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Account parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Account prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   **
+   * 支付账户(外部)
+   * 
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.Account} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.Account) + org.jigsaw.payment.AccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Account.class, org.jigsaw.payment.Account.Builder.class); + } + + // Construct using org.jigsaw.payment.Account.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + getSubjectFieldBuilder(); + getBalanceFieldBuilder(); + getPermissionFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + id_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + if (versionBuilder_ == null) { + version_ = null; + } else { + versionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + status_ = 1; + bitField0_ = (bitField0_ & ~0x00000004); + if (subjectBuilder_ == null) { + subject_ = null; + } else { + subjectBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (balanceBuilder_ == null) { + balance_ = null; + } else { + balanceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (permissionBuilder_ == null) { + permission_ = null; + } else { + permissionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Account_descriptor; + } + + public org.jigsaw.payment.Account getDefaultInstanceForType() { + return org.jigsaw.payment.Account.getDefaultInstance(); + } + + public org.jigsaw.payment.Account build() { + org.jigsaw.payment.Account result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Account buildPartial() { + org.jigsaw.payment.Account result = new org.jigsaw.payment.Account(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + if (subjectBuilder_ == null) { + result.subject_ = subject_; + } else { + result.subject_ = subjectBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + if (balanceBuilder_ == null) { + result.balance_ = balance_; + } else { + result.balance_ = balanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + if (permissionBuilder_ == null) { + result.permission_ = permission_; + } else { + result.permission_ = permissionBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Account) { + return mergeFrom((org.jigsaw.payment.Account)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Account other) { + if (other == org.jigsaw.payment.Account.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + if (other.hasStatus()) { + setStatus(other.getStatus()); + } + if (other.hasSubject()) { + mergeSubject(other.getSubject()); + } + if (other.hasBalance()) { + mergeBalance(other.getBalance()); + } + if (other.hasPermission()) { + mergePermission(other.getPermission()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + if (!hasVersion()) { + return false; + } + if (!hasStatus()) { + return false; + } + if (!hasSubject()) { + return false; + } + if (!hasBalance()) { + return false; + } + if (!hasPermission()) { + return false; + } + if (!getVersion().isInitialized()) { + return false; + } + if (!getSubject().isInitialized()) { + return false; + } + if (!getBalance().isInitialized()) { + return false; + } + if (!getPermission().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Account parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Account) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public Builder setId(long value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private org.jigsaw.payment.Version version_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder> versionBuilder_; + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder setVersion(org.jigsaw.payment.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder setVersion( + org.jigsaw.payment.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder mergeVersion(org.jigsaw.payment.Version value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + version_ != null && + version_ != org.jigsaw.payment.Version.getDefaultInstance()) { + version_ = + org.jigsaw.payment.Version.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + versionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version.Builder getVersionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + + private int status_ = 1; + /** + *
+     *状态
+     * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     *状态
+     * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + public org.jigsaw.payment.Account.Status getStatus() { + org.jigsaw.payment.Account.Status result = org.jigsaw.payment.Account.Status.valueOf(status_); + return result == null ? org.jigsaw.payment.Account.Status.INITIALIZED : result; + } + /** + *
+     *状态
+     * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + public Builder setStatus(org.jigsaw.payment.Account.Status value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     *状态
+     * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 1; + onChanged(); + return this; + } + + private org.jigsaw.payment.AccountSubject subject_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.AccountSubject, org.jigsaw.payment.AccountSubject.Builder, org.jigsaw.payment.AccountSubjectOrBuilder> subjectBuilder_; + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public boolean hasSubject() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public org.jigsaw.payment.AccountSubject getSubject() { + if (subjectBuilder_ == null) { + return subject_ == null ? org.jigsaw.payment.AccountSubject.getDefaultInstance() : subject_; + } else { + return subjectBuilder_.getMessage(); + } + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public Builder setSubject(org.jigsaw.payment.AccountSubject value) { + if (subjectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subject_ = value; + onChanged(); + } else { + subjectBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + return this; + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public Builder setSubject( + org.jigsaw.payment.AccountSubject.Builder builderForValue) { + if (subjectBuilder_ == null) { + subject_ = builderForValue.build(); + onChanged(); + } else { + subjectBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + return this; + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public Builder mergeSubject(org.jigsaw.payment.AccountSubject value) { + if (subjectBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + subject_ != null && + subject_ != org.jigsaw.payment.AccountSubject.getDefaultInstance()) { + subject_ = + org.jigsaw.payment.AccountSubject.newBuilder(subject_).mergeFrom(value).buildPartial(); + } else { + subject_ = value; + } + onChanged(); + } else { + subjectBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + return this; + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public Builder clearSubject() { + if (subjectBuilder_ == null) { + subject_ = null; + onChanged(); + } else { + subjectBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public org.jigsaw.payment.AccountSubject.Builder getSubjectBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getSubjectFieldBuilder().getBuilder(); + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + public org.jigsaw.payment.AccountSubjectOrBuilder getSubjectOrBuilder() { + if (subjectBuilder_ != null) { + return subjectBuilder_.getMessageOrBuilder(); + } else { + return subject_ == null ? + org.jigsaw.payment.AccountSubject.getDefaultInstance() : subject_; + } + } + /** + *
+     *会计科目
+     * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.AccountSubject, org.jigsaw.payment.AccountSubject.Builder, org.jigsaw.payment.AccountSubjectOrBuilder> + getSubjectFieldBuilder() { + if (subjectBuilder_ == null) { + subjectBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.AccountSubject, org.jigsaw.payment.AccountSubject.Builder, org.jigsaw.payment.AccountSubjectOrBuilder>( + getSubject(), + getParentForChildren(), + isClean()); + subject_ = null; + } + return subjectBuilder_; + } + + private org.jigsaw.payment.Account.Balance balance_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Account.Balance, org.jigsaw.payment.Account.Balance.Builder, org.jigsaw.payment.Account.BalanceOrBuilder> balanceBuilder_; + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public boolean hasBalance() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public org.jigsaw.payment.Account.Balance getBalance() { + if (balanceBuilder_ == null) { + return balance_ == null ? org.jigsaw.payment.Account.Balance.getDefaultInstance() : balance_; + } else { + return balanceBuilder_.getMessage(); + } + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public Builder setBalance(org.jigsaw.payment.Account.Balance value) { + if (balanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + balance_ = value; + onChanged(); + } else { + balanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public Builder setBalance( + org.jigsaw.payment.Account.Balance.Builder builderForValue) { + if (balanceBuilder_ == null) { + balance_ = builderForValue.build(); + onChanged(); + } else { + balanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public Builder mergeBalance(org.jigsaw.payment.Account.Balance value) { + if (balanceBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + balance_ != null && + balance_ != org.jigsaw.payment.Account.Balance.getDefaultInstance()) { + balance_ = + org.jigsaw.payment.Account.Balance.newBuilder(balance_).mergeFrom(value).buildPartial(); + } else { + balance_ = value; + } + onChanged(); + } else { + balanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public Builder clearBalance() { + if (balanceBuilder_ == null) { + balance_ = null; + onChanged(); + } else { + balanceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public org.jigsaw.payment.Account.Balance.Builder getBalanceBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBalanceFieldBuilder().getBuilder(); + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + public org.jigsaw.payment.Account.BalanceOrBuilder getBalanceOrBuilder() { + if (balanceBuilder_ != null) { + return balanceBuilder_.getMessageOrBuilder(); + } else { + return balance_ == null ? + org.jigsaw.payment.Account.Balance.getDefaultInstance() : balance_; + } + } + /** + *
+     *余额信息
+     * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Account.Balance, org.jigsaw.payment.Account.Balance.Builder, org.jigsaw.payment.Account.BalanceOrBuilder> + getBalanceFieldBuilder() { + if (balanceBuilder_ == null) { + balanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Account.Balance, org.jigsaw.payment.Account.Balance.Builder, org.jigsaw.payment.Account.BalanceOrBuilder>( + getBalance(), + getParentForChildren(), + isClean()); + balance_ = null; + } + return balanceBuilder_; + } + + private org.jigsaw.payment.Account.Permission permission_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Account.Permission, org.jigsaw.payment.Account.Permission.Builder, org.jigsaw.payment.Account.PermissionOrBuilder> permissionBuilder_; + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public boolean hasPermission() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public org.jigsaw.payment.Account.Permission getPermission() { + if (permissionBuilder_ == null) { + return permission_ == null ? org.jigsaw.payment.Account.Permission.getDefaultInstance() : permission_; + } else { + return permissionBuilder_.getMessage(); + } + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public Builder setPermission(org.jigsaw.payment.Account.Permission value) { + if (permissionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + permission_ = value; + onChanged(); + } else { + permissionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public Builder setPermission( + org.jigsaw.payment.Account.Permission.Builder builderForValue) { + if (permissionBuilder_ == null) { + permission_ = builderForValue.build(); + onChanged(); + } else { + permissionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + return this; + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public Builder mergePermission(org.jigsaw.payment.Account.Permission value) { + if (permissionBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020) && + permission_ != null && + permission_ != org.jigsaw.payment.Account.Permission.getDefaultInstance()) { + permission_ = + org.jigsaw.payment.Account.Permission.newBuilder(permission_).mergeFrom(value).buildPartial(); + } else { + permission_ = value; + } + onChanged(); + } else { + permissionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public Builder clearPermission() { + if (permissionBuilder_ == null) { + permission_ = null; + onChanged(); + } else { + permissionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public org.jigsaw.payment.Account.Permission.Builder getPermissionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getPermissionFieldBuilder().getBuilder(); + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + public org.jigsaw.payment.Account.PermissionOrBuilder getPermissionOrBuilder() { + if (permissionBuilder_ != null) { + return permissionBuilder_.getMessageOrBuilder(); + } else { + return permission_ == null ? + org.jigsaw.payment.Account.Permission.getDefaultInstance() : permission_; + } + } + /** + *
+     *权限设置
+     * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Account.Permission, org.jigsaw.payment.Account.Permission.Builder, org.jigsaw.payment.Account.PermissionOrBuilder> + getPermissionFieldBuilder() { + if (permissionBuilder_ == null) { + permissionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Account.Permission, org.jigsaw.payment.Account.Permission.Builder, org.jigsaw.payment.Account.PermissionOrBuilder>( + getPermission(), + getParentForChildren(), + isClean()); + permission_ = null; + } + return permissionBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.Account) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.Account) + private static final org.jigsaw.payment.Account DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Account(); + } + + public static org.jigsaw.payment.Account getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Account parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Account(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Account getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountClassification.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountClassification.java new file mode 100644 index 0000000..b0128b1 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountClassification.java @@ -0,0 +1,184 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dict.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 科目类别,必须按照公司的会计准则来设计。科目类别编号将作为科目标号的起始。
+ * 
+ * + * Protobuf enum {@code org.jigsaw.payment.AccountClassification} + */ +public enum AccountClassification + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   *资产
+   * 
+ * + * ASSETS = 1; + */ + ASSETS(1), + /** + *
+   *负债
+   * 
+ * + * LIABILITIES = 2; + */ + LIABILITIES(2), + /** + *
+   *共同类    
+   * 
+ * + * COMMON = 3; + */ + COMMON(3), + /** + *
+   *所有者权益
+   * 
+ * + * EQUITY = 4; + */ + EQUITY(4), + /** + *
+   *成本类
+   * 
+ * + * COST = 5; + */ + COST(5), + /** + *
+   *损益类
+   * 
+ * + * PROFIT_LOSS = 6; + */ + PROFIT_LOSS(6), + ; + + /** + *
+   *资产
+   * 
+ * + * ASSETS = 1; + */ + public static final int ASSETS_VALUE = 1; + /** + *
+   *负债
+   * 
+ * + * LIABILITIES = 2; + */ + public static final int LIABILITIES_VALUE = 2; + /** + *
+   *共同类    
+   * 
+ * + * COMMON = 3; + */ + public static final int COMMON_VALUE = 3; + /** + *
+   *所有者权益
+   * 
+ * + * EQUITY = 4; + */ + public static final int EQUITY_VALUE = 4; + /** + *
+   *成本类
+   * 
+ * + * COST = 5; + */ + public static final int COST_VALUE = 5; + /** + *
+   *损益类
+   * 
+ * + * PROFIT_LOSS = 6; + */ + public static final int PROFIT_LOSS_VALUE = 6; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AccountClassification valueOf(int value) { + return forNumber(value); + } + + public static AccountClassification forNumber(int value) { + switch (value) { + case 1: return ASSETS; + case 2: return LIABILITIES; + case 3: return COMMON; + case 4: return EQUITY; + case 5: return COST; + case 6: return PROFIT_LOSS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AccountClassification> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AccountClassification findValueByNumber(int number) { + return AccountClassification.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jigsaw.payment.Dict.getDescriptor().getEnumTypes().get(1); + } + + private static final AccountClassification[] VALUES = values(); + + public static AccountClassification valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AccountClassification(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jigsaw.payment.AccountClassification) +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountOrBuilder.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountOrBuilder.java new file mode 100644 index 0000000..9682f6f --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountOrBuilder.java @@ -0,0 +1,143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +public interface AccountOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.Account) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + boolean hasId(); + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + long getId(); + + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + boolean hasVersion(); + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + org.jigsaw.payment.Version getVersion(); + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder(); + + /** + *
+   *状态
+   * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + boolean hasStatus(); + /** + *
+   *状态
+   * 
+ * + * required .org.jigsaw.payment.Account.Status status = 21; + */ + org.jigsaw.payment.Account.Status getStatus(); + + /** + *
+   *会计科目
+   * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + boolean hasSubject(); + /** + *
+   *会计科目
+   * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + org.jigsaw.payment.AccountSubject getSubject(); + /** + *
+   *会计科目
+   * 
+ * + * required .org.jigsaw.payment.AccountSubject subject = 22; + */ + org.jigsaw.payment.AccountSubjectOrBuilder getSubjectOrBuilder(); + + /** + *
+   *余额信息
+   * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + boolean hasBalance(); + /** + *
+   *余额信息
+   * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + org.jigsaw.payment.Account.Balance getBalance(); + /** + *
+   *余额信息
+   * 
+ * + * required .org.jigsaw.payment.Account.Balance balance = 23; + */ + org.jigsaw.payment.Account.BalanceOrBuilder getBalanceOrBuilder(); + + /** + *
+   *权限设置
+   * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + boolean hasPermission(); + /** + *
+   *权限设置
+   * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + org.jigsaw.payment.Account.Permission getPermission(); + /** + *
+   *权限设置
+   * 
+ * + * required .org.jigsaw.payment.Account.Permission permission = 24; + */ + org.jigsaw.payment.Account.PermissionOrBuilder getPermissionOrBuilder(); +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubject.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubject.java new file mode 100644 index 0000000..be46e8b --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubject.java @@ -0,0 +1,1485 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 会计科目
+ * 
+ * + * Protobuf type {@code org.jigsaw.payment.AccountSubject} + */ +public final class AccountSubject extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.AccountSubject) + AccountSubjectOrBuilder { + // Use AccountSubject.newBuilder() to construct. + private AccountSubject(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AccountSubject() { + id_ = 0L; + level_ = 0; + title_ = ""; + classification_ = 1; + description_ = ""; + isDetail_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AccountSubject( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt64(); + break; + } + case 74: { + org.jigsaw.payment.Version.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = version_.toBuilder(); + } + version_ = input.readMessage(org.jigsaw.payment.Version.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 168: { + bitField0_ |= 0x00000004; + level_ = input.readInt32(); + break; + } + case 178: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + title_ = bs; + break; + } + case 184: { + int rawValue = input.readEnum(); + org.jigsaw.payment.AccountClassification value = org.jigsaw.payment.AccountClassification.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(23, rawValue); + } else { + bitField0_ |= 0x00000010; + classification_ = rawValue; + } + break; + } + case 194: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + description_ = bs; + break; + } + case 200: { + bitField0_ |= 0x00000040; + isDetail_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_AccountSubject_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_AccountSubject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.AccountSubject.class, org.jigsaw.payment.AccountSubject.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int VERSION_FIELD_NUMBER = 9; + private org.jigsaw.payment.Version version_; + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version getVersion() { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder() { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + + public static final int LEVEL_FIELD_NUMBER = 21; + private int level_; + /** + *
+   *层级
+   * 
+ * + * required int32 level = 21; + */ + public boolean hasLevel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+   *层级
+   * 
+ * + * required int32 level = 21; + */ + public int getLevel() { + return level_; + } + + public static final int TITLE_FIELD_NUMBER = 22; + private volatile java.lang.Object title_; + /** + *
+   *科目名称,默认为中文
+   * 
+ * + * required string title = 22; + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+   *科目名称,默认为中文
+   * 
+ * + * required string title = 22; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + title_ = s; + } + return s; + } + } + /** + *
+   *科目名称,默认为中文
+   * 
+ * + * required string title = 22; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLASSIFICATION_FIELD_NUMBER = 23; + private int classification_; + /** + *
+   *科目类别
+   * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + public boolean hasClassification() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+   *科目类别
+   * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + public org.jigsaw.payment.AccountClassification getClassification() { + org.jigsaw.payment.AccountClassification result = org.jigsaw.payment.AccountClassification.valueOf(classification_); + return result == null ? org.jigsaw.payment.AccountClassification.ASSETS : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 24; + private volatile java.lang.Object description_; + /** + *
+   *描述, 默认为中文
+   * 
+ * + * required string description = 24; + */ + public boolean hasDescription() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+   *描述, 默认为中文
+   * 
+ * + * required string description = 24; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + description_ = s; + } + return s; + } + } + /** + *
+   *描述, 默认为中文
+   * 
+ * + * required string description = 24; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_DETAIL_FIELD_NUMBER = 25; + private boolean isDetail_; + /** + *
+   * 是否明细科目
+   * 
+ * + * required bool is_detail = 25; + */ + public boolean hasIsDetail() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+   * 是否明细科目
+   * 
+ * + * required bool is_detail = 25; + */ + public boolean getIsDetail() { + return isDetail_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLevel()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTitle()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasClassification()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasDescription()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasIsDetail()) { + memoizedIsInitialized = 0; + return false; + } + if (!getVersion().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(9, getVersion()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(21, level_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, title_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeEnum(23, classification_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 24, description_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBool(25, isDetail_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getVersion()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(21, level_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, title_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(23, classification_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(24, description_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(25, isDetail_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.AccountSubject)) { + return super.equals(obj); + } + org.jigsaw.payment.AccountSubject other = (org.jigsaw.payment.AccountSubject) obj; + + boolean result = true; + result = result && (hasId() == other.hasId()); + if (hasId()) { + result = result && (getId() + == other.getId()); + } + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && getVersion() + .equals(other.getVersion()); + } + result = result && (hasLevel() == other.hasLevel()); + if (hasLevel()) { + result = result && (getLevel() + == other.getLevel()); + } + result = result && (hasTitle() == other.hasTitle()); + if (hasTitle()) { + result = result && getTitle() + .equals(other.getTitle()); + } + result = result && (hasClassification() == other.hasClassification()); + if (hasClassification()) { + result = result && classification_ == other.classification_; + } + result = result && (hasDescription() == other.hasDescription()); + if (hasDescription()) { + result = result && getDescription() + .equals(other.getDescription()); + } + result = result && (hasIsDetail() == other.hasIsDetail()); + if (hasIsDetail()) { + result = result && (getIsDetail() + == other.getIsDetail()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + } + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + if (hasLevel()) { + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getLevel(); + } + if (hasTitle()) { + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + } + if (hasClassification()) { + hash = (37 * hash) + CLASSIFICATION_FIELD_NUMBER; + hash = (53 * hash) + classification_; + } + if (hasDescription()) { + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + } + if (hasIsDetail()) { + hash = (37 * hash) + IS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsDetail()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.AccountSubject parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.AccountSubject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.AccountSubject parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.AccountSubject parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.AccountSubject parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.AccountSubject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.AccountSubject prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   **
+   * 会计科目
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.AccountSubject} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.AccountSubject) + org.jigsaw.payment.AccountSubjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_AccountSubject_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_AccountSubject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.AccountSubject.class, org.jigsaw.payment.AccountSubject.Builder.class); + } + + // Construct using org.jigsaw.payment.AccountSubject.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + id_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + if (versionBuilder_ == null) { + version_ = null; + } else { + versionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + level_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + title_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + classification_ = 1; + bitField0_ = (bitField0_ & ~0x00000010); + description_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + isDetail_ = false; + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_AccountSubject_descriptor; + } + + public org.jigsaw.payment.AccountSubject getDefaultInstanceForType() { + return org.jigsaw.payment.AccountSubject.getDefaultInstance(); + } + + public org.jigsaw.payment.AccountSubject build() { + org.jigsaw.payment.AccountSubject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.AccountSubject buildPartial() { + org.jigsaw.payment.AccountSubject result = new org.jigsaw.payment.AccountSubject(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.level_ = level_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.title_ = title_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.classification_ = classification_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.description_ = description_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.isDetail_ = isDetail_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.AccountSubject) { + return mergeFrom((org.jigsaw.payment.AccountSubject)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.AccountSubject other) { + if (other == org.jigsaw.payment.AccountSubject.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + if (other.hasLevel()) { + setLevel(other.getLevel()); + } + if (other.hasTitle()) { + bitField0_ |= 0x00000008; + title_ = other.title_; + onChanged(); + } + if (other.hasClassification()) { + setClassification(other.getClassification()); + } + if (other.hasDescription()) { + bitField0_ |= 0x00000020; + description_ = other.description_; + onChanged(); + } + if (other.hasIsDetail()) { + setIsDetail(other.getIsDetail()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + if (!hasVersion()) { + return false; + } + if (!hasLevel()) { + return false; + } + if (!hasTitle()) { + return false; + } + if (!hasClassification()) { + return false; + } + if (!hasDescription()) { + return false; + } + if (!hasIsDetail()) { + return false; + } + if (!getVersion().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.AccountSubject parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.AccountSubject) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public Builder setId(long value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private org.jigsaw.payment.Version version_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder> versionBuilder_; + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder setVersion(org.jigsaw.payment.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder setVersion( + org.jigsaw.payment.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder mergeVersion(org.jigsaw.payment.Version value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + version_ != null && + version_ != org.jigsaw.payment.Version.getDefaultInstance()) { + version_ = + org.jigsaw.payment.Version.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + versionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version.Builder getVersionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + } + /** + *
+     *版本信息
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + + private int level_ ; + /** + *
+     *层级
+     * 
+ * + * required int32 level = 21; + */ + public boolean hasLevel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     *层级
+     * 
+ * + * required int32 level = 21; + */ + public int getLevel() { + return level_; + } + /** + *
+     *层级
+     * 
+ * + * required int32 level = 21; + */ + public Builder setLevel(int value) { + bitField0_ |= 0x00000004; + level_ = value; + onChanged(); + return this; + } + /** + *
+     *层级
+     * 
+ * + * required int32 level = 21; + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + level_ = 0; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + *
+     *科目名称,默认为中文
+     * 
+ * + * required string title = 22; + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     *科目名称,默认为中文
+     * 
+ * + * required string title = 22; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + title_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     *科目名称,默认为中文
+     * 
+ * + * required string title = 22; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     *科目名称,默认为中文
+     * 
+ * + * required string title = 22; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + title_ = value; + onChanged(); + return this; + } + /** + *
+     *科目名称,默认为中文
+     * 
+ * + * required string title = 22; + */ + public Builder clearTitle() { + bitField0_ = (bitField0_ & ~0x00000008); + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + *
+     *科目名称,默认为中文
+     * 
+ * + * required string title = 22; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + title_ = value; + onChanged(); + return this; + } + + private int classification_ = 1; + /** + *
+     *科目类别
+     * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + public boolean hasClassification() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     *科目类别
+     * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + public org.jigsaw.payment.AccountClassification getClassification() { + org.jigsaw.payment.AccountClassification result = org.jigsaw.payment.AccountClassification.valueOf(classification_); + return result == null ? org.jigsaw.payment.AccountClassification.ASSETS : result; + } + /** + *
+     *科目类别
+     * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + public Builder setClassification(org.jigsaw.payment.AccountClassification value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + classification_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     *科目类别
+     * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + public Builder clearClassification() { + bitField0_ = (bitField0_ & ~0x00000010); + classification_ = 1; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     *描述, 默认为中文
+     * 
+ * + * required string description = 24; + */ + public boolean hasDescription() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     *描述, 默认为中文
+     * 
+ * + * required string description = 24; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + description_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     *描述, 默认为中文
+     * 
+ * + * required string description = 24; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     *描述, 默认为中文
+     * 
+ * + * required string description = 24; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + description_ = value; + onChanged(); + return this; + } + /** + *
+     *描述, 默认为中文
+     * 
+ * + * required string description = 24; + */ + public Builder clearDescription() { + bitField0_ = (bitField0_ & ~0x00000020); + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     *描述, 默认为中文
+     * 
+ * + * required string description = 24; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + description_ = value; + onChanged(); + return this; + } + + private boolean isDetail_ ; + /** + *
+     * 是否明细科目
+     * 
+ * + * required bool is_detail = 25; + */ + public boolean hasIsDetail() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+     * 是否明细科目
+     * 
+ * + * required bool is_detail = 25; + */ + public boolean getIsDetail() { + return isDetail_; + } + /** + *
+     * 是否明细科目
+     * 
+ * + * required bool is_detail = 25; + */ + public Builder setIsDetail(boolean value) { + bitField0_ |= 0x00000040; + isDetail_ = value; + onChanged(); + return this; + } + /** + *
+     * 是否明细科目
+     * 
+ * + * required bool is_detail = 25; + */ + public Builder clearIsDetail() { + bitField0_ = (bitField0_ & ~0x00000040); + isDetail_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.AccountSubject) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.AccountSubject) + private static final org.jigsaw.payment.AccountSubject DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.AccountSubject(); + } + + public static org.jigsaw.payment.AccountSubject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AccountSubject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccountSubject(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.AccountSubject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubjectOrBuilder.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubjectOrBuilder.java new file mode 100644 index 0000000..92cc301 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/AccountSubjectOrBuilder.java @@ -0,0 +1,154 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +public interface AccountSubjectOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.AccountSubject) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + boolean hasId(); + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + long getId(); + + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + boolean hasVersion(); + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + org.jigsaw.payment.Version getVersion(); + /** + *
+   *版本信息
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder(); + + /** + *
+   *层级
+   * 
+ * + * required int32 level = 21; + */ + boolean hasLevel(); + /** + *
+   *层级
+   * 
+ * + * required int32 level = 21; + */ + int getLevel(); + + /** + *
+   *科目名称,默认为中文
+   * 
+ * + * required string title = 22; + */ + boolean hasTitle(); + /** + *
+   *科目名称,默认为中文
+   * 
+ * + * required string title = 22; + */ + java.lang.String getTitle(); + /** + *
+   *科目名称,默认为中文
+   * 
+ * + * required string title = 22; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + *
+   *科目类别
+   * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + boolean hasClassification(); + /** + *
+   *科目类别
+   * 
+ * + * required .org.jigsaw.payment.AccountClassification classification = 23; + */ + org.jigsaw.payment.AccountClassification getClassification(); + + /** + *
+   *描述, 默认为中文
+   * 
+ * + * required string description = 24; + */ + boolean hasDescription(); + /** + *
+   *描述, 默认为中文
+   * 
+ * + * required string description = 24; + */ + java.lang.String getDescription(); + /** + *
+   *描述, 默认为中文
+   * 
+ * + * required string description = 24; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * 是否明细科目
+   * 
+ * + * required bool is_detail = 25; + */ + boolean hasIsDetail(); + /** + *
+   * 是否明细科目
+   * 
+ * + * required bool is_detail = 25; + */ + boolean getIsDetail(); +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Currency.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Currency.java new file mode 100644 index 0000000..6eac31c --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Currency.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dict.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 货币类型,参见ISO-4217
+ * 
+ * + * Protobuf enum {@code org.jigsaw.payment.Currency} + */ +public enum Currency + implements com.google.protobuf.ProtocolMessageEnum { + /** + * RMB = 1; + */ + RMB(1), + /** + * USD = 2; + */ + USD(2), + ; + + /** + * RMB = 1; + */ + public static final int RMB_VALUE = 1; + /** + * USD = 2; + */ + public static final int USD_VALUE = 2; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Currency valueOf(int value) { + return forNumber(value); + } + + public static Currency forNumber(int value) { + switch (value) { + case 1: return RMB; + case 2: return USD; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Currency> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Currency findValueByNumber(int number) { + return Currency.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jigsaw.payment.Dict.getDescriptor().getEnumTypes().get(0); + } + + private static final Currency[] VALUES = values(); + + public static Currency valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Currency(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jigsaw.payment.Currency) +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Dict.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Dict.java new file mode 100644 index 0000000..679b81f --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Dict.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dict.proto + +package org.jigsaw.payment; + +public final class Dict { + private Dict() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\ndict.proto\022\022org.jigsaw.payment*\034\n\010Curr" + + "ency\022\007\n\003RMB\020\001\022\007\n\003USD\020\002*g\n\025AccountClassif" + + "ication\022\n\n\006ASSETS\020\001\022\017\n\013LIABILITIES\020\002\022\n\n\006" + + "COMMON\020\003\022\n\n\006EQUITY\020\004\022\010\n\004COST\020\005\022\017\n\013PROFIT" + + "_LOSS\020\006B\002P\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Entity.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Entity.java new file mode 100644 index 0000000..3abf8c8 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Entity.java @@ -0,0 +1,169 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +public final class Entity { + private Entity() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_PaymentEntity_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_PaymentEntity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_AccountSubject_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_AccountSubject_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_Account_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_Account_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_Account_Balance_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_Account_Balance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_Account_Permission_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_Account_Permission_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_Payment_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_Payment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_Voucher_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_Voucher_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014entity.proto\022\022org.jigsaw.payment\032\ndict" + + ".proto\032\016property.proto\"X\n\rPaymentEntity\022" + + "\n\n\002id\030\001 \002(\003\022\r\n\005title\030\002 \001(\t\022,\n\007version\030\t " + + "\002(\0132\033.org.jigsaw.payment.Version\"\323\001\n\016Acc" + + "ountSubject\022\n\n\002id\030\001 \002(\003\022,\n\007version\030\t \002(\013" + + "2\033.org.jigsaw.payment.Version\022\r\n\005level\030\025" + + " \002(\005\022\r\n\005title\030\026 \002(\t\022A\n\016classification\030\027 " + + "\002(\0162).org.jigsaw.payment.AccountClassifi" + + "cation\022\023\n\013description\030\030 \002(\t\022\021\n\tis_detail" + + "\030\031 \002(\010\"\307\005\n\007Account\022\n\n\002id\030\001 \002(\003\022,\n\007versio", + "n\030\t \002(\0132\033.org.jigsaw.payment.Version\0222\n\006" + + "status\030\025 \002(\0162\".org.jigsaw.payment.Accoun" + + "t.Status\0223\n\007subject\030\026 \002(\0132\".org.jigsaw.p" + + "ayment.AccountSubject\0224\n\007balance\030\027 \002(\0132#" + + ".org.jigsaw.payment.Account.Balance\022:\n\np" + + "ermission\030\030 \002(\0132&.org.jigsaw.payment.Acc" + + "ount.Permission\032~\n\007Balance\022.\n\010currency\030\001" + + " \002(\0162\034.org.jigsaw.payment.Currency\022\024\n\014re" + + "st_balance\030\002 \002(\003\022\025\n\rtotal_balance\030\003 \002(\003\022" + + "\026\n\016frozen_balance\030\004 \002(\003\032\345\001\n\nPermission\022\027", + "\n\017enable_recharge\030\001 \002(\010\022\027\n\017enable_withdr" + + "aw\030\002 \002(\010\022\027\n\017enable_overdraw\030\003 \002(\010\022\026\n\016ena" + + "ble_payment\030\004 \002(\010\022\032\n\022enable_transfer_in\030" + + "\005 \002(\010\022\033\n\023enable_transfer_out\030\006 \002(\010\022\024\n\014is" + + "_protected\030\007 \002(\010\022\022\n\nis_actived\030\010 \002(\010\022\021\n\t" + + "is_frozen\030\t \002(\010\"?\n\006Status\022\017\n\013INITIALIZED" + + "\020\001\022\014\n\010ACTIVIED\020\002\022\n\n\006FROZEN\020\003\022\n\n\006CLOSED\020\004" + + "\"\362\003\n\007Payment\022\n\n\002id\030\001 \002(\003\022\020\n\010order_id\030\025 \002" + + "(\003\0222\n\006status\030\026 \002(\0162\".org.jigsaw.payment." + + "Payment.Status\022\023\n\013create_time\030\027 \002(\003\022\020\n\010p", + "ayer_id\030\037 \002(\003\022\022\n\npayer_name\030 \002(\t\022\030\n\020pay" + + "er_account_id\030! \002(\003\022\025\n\rpay_method_id\030\" \002" + + "(\003\022\026\n\016pay_channel_id\030# \002(\003\022\024\n\014pay_route_" + + "id\030$ \001(\003\022\020\n\010pay_time\030% \001(\003\022.\n\010currency\030(" + + " \002(\0162\034.org.jigsaw.payment.Currency\022\027\n\017or" + + "iginal_amount\030) \002(\003\022\022\n\npay_amount\030* \002(\003\022" + + "\022\n\nfee_amount\030+ \001(\003\022\020\n\010payee_id\0302 \002(\003\022\022\n" + + "\npayee_name\0303 \002(\t\022\030\n\020payee_account_id\0304 " + + "\002(\003\"8\n\006Status\022\n\n\006UNPAID\020\001\022\010\n\004PAID\020\002\022\014\n\010C" + + "ANCELED\020\003\022\n\n\006CLOSED\020\004\"\330\001\n\007Voucher\022\n\n\002id\030", + "\001 \002(\003\022\026\n\016recording_time\030\025 \002(\003\022\022\n\nsubject" + + "_id\030\026 \002(\003\022.\n\010currency\030\027 \002(\0162\034.org.jigsaw" + + ".payment.Currency\022\024\n\014debit_amount\030\030 \002(\003\022" + + "\025\n\rcredit_amount\030\031 \002(\003\022\023\n\013original_id\030\032 " + + "\002(\003\"#\n\006Status\022\014\n\010RECORDED\020\001\022\013\n\007CHECKED\020\002" + + "B\002P\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.jigsaw.payment.Dict.getDescriptor(), + org.jigsaw.payment.Property.getDescriptor(), + }, assigner); + internal_static_org_jigsaw_payment_PaymentEntity_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_jigsaw_payment_PaymentEntity_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_PaymentEntity_descriptor, + new java.lang.String[] { "Id", "Title", "Version", }); + internal_static_org_jigsaw_payment_AccountSubject_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_jigsaw_payment_AccountSubject_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_AccountSubject_descriptor, + new java.lang.String[] { "Id", "Version", "Level", "Title", "Classification", "Description", "IsDetail", }); + internal_static_org_jigsaw_payment_Account_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_jigsaw_payment_Account_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_Account_descriptor, + new java.lang.String[] { "Id", "Version", "Status", "Subject", "Balance", "Permission", }); + internal_static_org_jigsaw_payment_Account_Balance_descriptor = + internal_static_org_jigsaw_payment_Account_descriptor.getNestedTypes().get(0); + internal_static_org_jigsaw_payment_Account_Balance_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_Account_Balance_descriptor, + new java.lang.String[] { "Currency", "RestBalance", "TotalBalance", "FrozenBalance", }); + internal_static_org_jigsaw_payment_Account_Permission_descriptor = + internal_static_org_jigsaw_payment_Account_descriptor.getNestedTypes().get(1); + internal_static_org_jigsaw_payment_Account_Permission_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_Account_Permission_descriptor, + new java.lang.String[] { "EnableRecharge", "EnableWithdraw", "EnableOverdraw", "EnablePayment", "EnableTransferIn", "EnableTransferOut", "IsProtected", "IsActived", "IsFrozen", }); + internal_static_org_jigsaw_payment_Payment_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_org_jigsaw_payment_Payment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_Payment_descriptor, + new java.lang.String[] { "Id", "OrderId", "Status", "CreateTime", "PayerId", "PayerName", "PayerAccountId", "PayMethodId", "PayChannelId", "PayRouteId", "PayTime", "Currency", "OriginalAmount", "PayAmount", "FeeAmount", "PayeeId", "PayeeName", "PayeeAccountId", }); + internal_static_org_jigsaw_payment_Voucher_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_org_jigsaw_payment_Voucher_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_Voucher_descriptor, + new java.lang.String[] { "Id", "RecordingTime", "SubjectId", "Currency", "DebitAmount", "CreditAmount", "OriginalId", }); + org.jigsaw.payment.Dict.getDescriptor(); + org.jigsaw.payment.Property.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Payment.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Payment.java new file mode 100644 index 0000000..22cc953 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Payment.java @@ -0,0 +1,2681 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +/** + * Protobuf type {@code org.jigsaw.payment.Payment} + */ +public final class Payment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.Payment) + PaymentOrBuilder { + // Use Payment.newBuilder() to construct. + private Payment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Payment() { + id_ = 0L; + orderId_ = 0L; + status_ = 1; + createTime_ = 0L; + payerId_ = 0L; + payerName_ = ""; + payerAccountId_ = 0L; + payMethodId_ = 0L; + payChannelId_ = 0L; + payRouteId_ = 0L; + payTime_ = 0L; + currency_ = 1; + originalAmount_ = 0L; + payAmount_ = 0L; + feeAmount_ = 0L; + payeeId_ = 0L; + payeeName_ = ""; + payeeAccountId_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Payment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt64(); + break; + } + case 168: { + bitField0_ |= 0x00000002; + orderId_ = input.readInt64(); + break; + } + case 176: { + int rawValue = input.readEnum(); + org.jigsaw.payment.Payment.Status value = org.jigsaw.payment.Payment.Status.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(22, rawValue); + } else { + bitField0_ |= 0x00000004; + status_ = rawValue; + } + break; + } + case 184: { + bitField0_ |= 0x00000008; + createTime_ = input.readInt64(); + break; + } + case 248: { + bitField0_ |= 0x00000010; + payerId_ = input.readInt64(); + break; + } + case 258: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + payerName_ = bs; + break; + } + case 264: { + bitField0_ |= 0x00000040; + payerAccountId_ = input.readInt64(); + break; + } + case 272: { + bitField0_ |= 0x00000080; + payMethodId_ = input.readInt64(); + break; + } + case 280: { + bitField0_ |= 0x00000100; + payChannelId_ = input.readInt64(); + break; + } + case 288: { + bitField0_ |= 0x00000200; + payRouteId_ = input.readInt64(); + break; + } + case 296: { + bitField0_ |= 0x00000400; + payTime_ = input.readInt64(); + break; + } + case 320: { + int rawValue = input.readEnum(); + org.jigsaw.payment.Currency value = org.jigsaw.payment.Currency.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(40, rawValue); + } else { + bitField0_ |= 0x00000800; + currency_ = rawValue; + } + break; + } + case 328: { + bitField0_ |= 0x00001000; + originalAmount_ = input.readInt64(); + break; + } + case 336: { + bitField0_ |= 0x00002000; + payAmount_ = input.readInt64(); + break; + } + case 344: { + bitField0_ |= 0x00004000; + feeAmount_ = input.readInt64(); + break; + } + case 400: { + bitField0_ |= 0x00008000; + payeeId_ = input.readInt64(); + break; + } + case 410: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00010000; + payeeName_ = bs; + break; + } + case 416: { + bitField0_ |= 0x00020000; + payeeAccountId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Payment_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Payment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Payment.class, org.jigsaw.payment.Payment.Builder.class); + } + + /** + *
+   **
+   * 支付订单状态
+   * 
+ * + * Protobuf enum {@code org.jigsaw.payment.Payment.Status} + */ + public enum Status + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     *未支付
+     * 
+ * + * UNPAID = 1; + */ + UNPAID(1), + /** + *
+     *已支付
+     * 
+ * + * PAID = 2; + */ + PAID(2), + /** + *
+     *已取消, 指用户主动取消订单。
+     * 
+ * + * CANCELED = 3; + */ + CANCELED(3), + /** + *
+     *已关闭,指由于系统原因关闭订单,比如超时。 
+     * 
+ * + * CLOSED = 4; + */ + CLOSED(4), + ; + + /** + *
+     *未支付
+     * 
+ * + * UNPAID = 1; + */ + public static final int UNPAID_VALUE = 1; + /** + *
+     *已支付
+     * 
+ * + * PAID = 2; + */ + public static final int PAID_VALUE = 2; + /** + *
+     *已取消, 指用户主动取消订单。
+     * 
+ * + * CANCELED = 3; + */ + public static final int CANCELED_VALUE = 3; + /** + *
+     *已关闭,指由于系统原因关闭订单,比如超时。 
+     * 
+ * + * CLOSED = 4; + */ + public static final int CLOSED_VALUE = 4; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Status valueOf(int value) { + return forNumber(value); + } + + public static Status forNumber(int value) { + switch (value) { + case 1: return UNPAID; + case 2: return PAID; + case 3: return CANCELED; + case 4: return CLOSED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Status findValueByNumber(int number) { + return Status.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jigsaw.payment.Payment.getDescriptor().getEnumTypes().get(0); + } + + private static final Status[] VALUES = values(); + + public static Status valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jigsaw.payment.Payment.Status) + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + *
+   * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+   * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+   * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+   * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int ORDER_ID_FIELD_NUMBER = 21; + private long orderId_; + /** + *
+   * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+   * 
+ * + * required int64 order_id = 21; + */ + public boolean hasOrderId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+   * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+   * 
+ * + * required int64 order_id = 21; + */ + public long getOrderId() { + return orderId_; + } + + public static final int STATUS_FIELD_NUMBER = 22; + private int status_; + /** + *
+   * 支付状态
+   * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+   * 支付状态
+   * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + public org.jigsaw.payment.Payment.Status getStatus() { + org.jigsaw.payment.Payment.Status result = org.jigsaw.payment.Payment.Status.valueOf(status_); + return result == null ? org.jigsaw.payment.Payment.Status.UNPAID : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 23; + private long createTime_; + /** + *
+   *创建时间;	
+   * 
+ * + * required int64 create_time = 23; + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+   *创建时间;	
+   * 
+ * + * required int64 create_time = 23; + */ + public long getCreateTime() { + return createTime_; + } + + public static final int PAYER_ID_FIELD_NUMBER = 31; + private long payerId_; + /** + *
+   * 30~39 付款信息;
+   * 
+ * + * required int64 payer_id = 31; + */ + public boolean hasPayerId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+   * 30~39 付款信息;
+   * 
+ * + * required int64 payer_id = 31; + */ + public long getPayerId() { + return payerId_; + } + + public static final int PAYER_NAME_FIELD_NUMBER = 32; + private volatile java.lang.Object payerName_; + /** + *
+   *付款人名称
+   * 
+ * + * required string payer_name = 32; + */ + public boolean hasPayerName() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+   *付款人名称
+   * 
+ * + * required string payer_name = 32; + */ + public java.lang.String getPayerName() { + java.lang.Object ref = payerName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + payerName_ = s; + } + return s; + } + } + /** + *
+   *付款人名称
+   * 
+ * + * required string payer_name = 32; + */ + public com.google.protobuf.ByteString + getPayerNameBytes() { + java.lang.Object ref = payerName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payerName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYER_ACCOUNT_ID_FIELD_NUMBER = 33; + private long payerAccountId_; + /** + *
+   * 付款账户ID
+   * 
+ * + * required int64 payer_account_id = 33; + */ + public boolean hasPayerAccountId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+   * 付款账户ID
+   * 
+ * + * required int64 payer_account_id = 33; + */ + public long getPayerAccountId() { + return payerAccountId_; + } + + public static final int PAY_METHOD_ID_FIELD_NUMBER = 34; + private long payMethodId_; + /** + *
+   *支付方式
+   * 
+ * + * required int64 pay_method_id = 34; + */ + public boolean hasPayMethodId() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+   *支付方式
+   * 
+ * + * required int64 pay_method_id = 34; + */ + public long getPayMethodId() { + return payMethodId_; + } + + public static final int PAY_CHANNEL_ID_FIELD_NUMBER = 35; + private long payChannelId_; + /** + *
+   *支付渠道
+   * 
+ * + * required int64 pay_channel_id = 35; + */ + public boolean hasPayChannelId() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + *
+   *支付渠道
+   * 
+ * + * required int64 pay_channel_id = 35; + */ + public long getPayChannelId() { + return payChannelId_; + } + + public static final int PAY_ROUTE_ID_FIELD_NUMBER = 36; + private long payRouteId_; + /** + *
+   *支付路由
+   * 
+ * + * optional int64 pay_route_id = 36; + */ + public boolean hasPayRouteId() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + *
+   *支付路由
+   * 
+ * + * optional int64 pay_route_id = 36; + */ + public long getPayRouteId() { + return payRouteId_; + } + + public static final int PAY_TIME_FIELD_NUMBER = 37; + private long payTime_; + /** + *
+   *实际完成支付的时间
+   * 
+ * + * optional int64 pay_time = 37; + */ + public boolean hasPayTime() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + *
+   *实际完成支付的时间
+   * 
+ * + * optional int64 pay_time = 37; + */ + public long getPayTime() { + return payTime_; + } + + public static final int CURRENCY_FIELD_NUMBER = 40; + private int currency_; + /** + *
+   * 40~49 费用信息
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + public boolean hasCurrency() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + *
+   * 40~49 费用信息
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + public org.jigsaw.payment.Currency getCurrency() { + org.jigsaw.payment.Currency result = org.jigsaw.payment.Currency.valueOf(currency_); + return result == null ? org.jigsaw.payment.Currency.RMB : result; + } + + public static final int ORIGINAL_AMOUNT_FIELD_NUMBER = 41; + private long originalAmount_; + /** + *
+   *原金额
+   * 
+ * + * required int64 original_amount = 41; + */ + public boolean hasOriginalAmount() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + *
+   *原金额
+   * 
+ * + * required int64 original_amount = 41; + */ + public long getOriginalAmount() { + return originalAmount_; + } + + public static final int PAY_AMOUNT_FIELD_NUMBER = 42; + private long payAmount_; + /** + *
+   *实际支付费用
+   * 
+ * + * required int64 pay_amount = 42; + */ + public boolean hasPayAmount() { + return ((bitField0_ & 0x00002000) == 0x00002000); + } + /** + *
+   *实际支付费用
+   * 
+ * + * required int64 pay_amount = 42; + */ + public long getPayAmount() { + return payAmount_; + } + + public static final int FEE_AMOUNT_FIELD_NUMBER = 43; + private long feeAmount_; + /** + *
+   *手续费		
+   * 
+ * + * optional int64 fee_amount = 43; + */ + public boolean hasFeeAmount() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + /** + *
+   *手续费		
+   * 
+ * + * optional int64 fee_amount = 43; + */ + public long getFeeAmount() { + return feeAmount_; + } + + public static final int PAYEE_ID_FIELD_NUMBER = 50; + private long payeeId_; + /** + *
+   * 50~59 收款人信息
+   * 
+ * + * required int64 payee_id = 50; + */ + public boolean hasPayeeId() { + return ((bitField0_ & 0x00008000) == 0x00008000); + } + /** + *
+   * 50~59 收款人信息
+   * 
+ * + * required int64 payee_id = 50; + */ + public long getPayeeId() { + return payeeId_; + } + + public static final int PAYEE_NAME_FIELD_NUMBER = 51; + private volatile java.lang.Object payeeName_; + /** + *
+   *收款人名称
+   * 
+ * + * required string payee_name = 51; + */ + public boolean hasPayeeName() { + return ((bitField0_ & 0x00010000) == 0x00010000); + } + /** + *
+   *收款人名称
+   * 
+ * + * required string payee_name = 51; + */ + public java.lang.String getPayeeName() { + java.lang.Object ref = payeeName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + payeeName_ = s; + } + return s; + } + } + /** + *
+   *收款人名称
+   * 
+ * + * required string payee_name = 51; + */ + public com.google.protobuf.ByteString + getPayeeNameBytes() { + java.lang.Object ref = payeeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payeeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYEE_ACCOUNT_ID_FIELD_NUMBER = 52; + private long payeeAccountId_; + /** + *
+   *收款账号ID  
+   * 
+ * + * required int64 payee_account_id = 52; + */ + public boolean hasPayeeAccountId() { + return ((bitField0_ & 0x00020000) == 0x00020000); + } + /** + *
+   *收款账号ID  
+   * 
+ * + * required int64 payee_account_id = 52; + */ + public long getPayeeAccountId() { + return payeeAccountId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOrderId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasStatus()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCreateTime()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayerId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayerName()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayerAccountId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayMethodId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayChannelId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCurrency()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOriginalAmount()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayAmount()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayeeId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayeeName()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPayeeAccountId()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(21, orderId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(22, status_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(23, createTime_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt64(31, payerId_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 32, payerName_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt64(33, payerAccountId_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt64(34, payMethodId_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeInt64(35, payChannelId_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt64(36, payRouteId_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeInt64(37, payTime_); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeEnum(40, currency_); + } + if (((bitField0_ & 0x00001000) == 0x00001000)) { + output.writeInt64(41, originalAmount_); + } + if (((bitField0_ & 0x00002000) == 0x00002000)) { + output.writeInt64(42, payAmount_); + } + if (((bitField0_ & 0x00004000) == 0x00004000)) { + output.writeInt64(43, feeAmount_); + } + if (((bitField0_ & 0x00008000) == 0x00008000)) { + output.writeInt64(50, payeeId_); + } + if (((bitField0_ & 0x00010000) == 0x00010000)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 51, payeeName_); + } + if (((bitField0_ & 0x00020000) == 0x00020000)) { + output.writeInt64(52, payeeAccountId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(21, orderId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(22, status_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(23, createTime_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(31, payerId_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(32, payerName_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(33, payerAccountId_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(34, payMethodId_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(35, payChannelId_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(36, payRouteId_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(37, payTime_); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(40, currency_); + } + if (((bitField0_ & 0x00001000) == 0x00001000)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(41, originalAmount_); + } + if (((bitField0_ & 0x00002000) == 0x00002000)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(42, payAmount_); + } + if (((bitField0_ & 0x00004000) == 0x00004000)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(43, feeAmount_); + } + if (((bitField0_ & 0x00008000) == 0x00008000)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(50, payeeId_); + } + if (((bitField0_ & 0x00010000) == 0x00010000)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(51, payeeName_); + } + if (((bitField0_ & 0x00020000) == 0x00020000)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(52, payeeAccountId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Payment)) { + return super.equals(obj); + } + org.jigsaw.payment.Payment other = (org.jigsaw.payment.Payment) obj; + + boolean result = true; + result = result && (hasId() == other.hasId()); + if (hasId()) { + result = result && (getId() + == other.getId()); + } + result = result && (hasOrderId() == other.hasOrderId()); + if (hasOrderId()) { + result = result && (getOrderId() + == other.getOrderId()); + } + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && status_ == other.status_; + } + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && (getCreateTime() + == other.getCreateTime()); + } + result = result && (hasPayerId() == other.hasPayerId()); + if (hasPayerId()) { + result = result && (getPayerId() + == other.getPayerId()); + } + result = result && (hasPayerName() == other.hasPayerName()); + if (hasPayerName()) { + result = result && getPayerName() + .equals(other.getPayerName()); + } + result = result && (hasPayerAccountId() == other.hasPayerAccountId()); + if (hasPayerAccountId()) { + result = result && (getPayerAccountId() + == other.getPayerAccountId()); + } + result = result && (hasPayMethodId() == other.hasPayMethodId()); + if (hasPayMethodId()) { + result = result && (getPayMethodId() + == other.getPayMethodId()); + } + result = result && (hasPayChannelId() == other.hasPayChannelId()); + if (hasPayChannelId()) { + result = result && (getPayChannelId() + == other.getPayChannelId()); + } + result = result && (hasPayRouteId() == other.hasPayRouteId()); + if (hasPayRouteId()) { + result = result && (getPayRouteId() + == other.getPayRouteId()); + } + result = result && (hasPayTime() == other.hasPayTime()); + if (hasPayTime()) { + result = result && (getPayTime() + == other.getPayTime()); + } + result = result && (hasCurrency() == other.hasCurrency()); + if (hasCurrency()) { + result = result && currency_ == other.currency_; + } + result = result && (hasOriginalAmount() == other.hasOriginalAmount()); + if (hasOriginalAmount()) { + result = result && (getOriginalAmount() + == other.getOriginalAmount()); + } + result = result && (hasPayAmount() == other.hasPayAmount()); + if (hasPayAmount()) { + result = result && (getPayAmount() + == other.getPayAmount()); + } + result = result && (hasFeeAmount() == other.hasFeeAmount()); + if (hasFeeAmount()) { + result = result && (getFeeAmount() + == other.getFeeAmount()); + } + result = result && (hasPayeeId() == other.hasPayeeId()); + if (hasPayeeId()) { + result = result && (getPayeeId() + == other.getPayeeId()); + } + result = result && (hasPayeeName() == other.hasPayeeName()); + if (hasPayeeName()) { + result = result && getPayeeName() + .equals(other.getPayeeName()); + } + result = result && (hasPayeeAccountId() == other.hasPayeeAccountId()); + if (hasPayeeAccountId()) { + result = result && (getPayeeAccountId() + == other.getPayeeAccountId()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + } + if (hasOrderId()) { + hash = (37 * hash) + ORDER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOrderId()); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreateTime()); + } + if (hasPayerId()) { + hash = (37 * hash) + PAYER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayerId()); + } + if (hasPayerName()) { + hash = (37 * hash) + PAYER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPayerName().hashCode(); + } + if (hasPayerAccountId()) { + hash = (37 * hash) + PAYER_ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayerAccountId()); + } + if (hasPayMethodId()) { + hash = (37 * hash) + PAY_METHOD_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayMethodId()); + } + if (hasPayChannelId()) { + hash = (37 * hash) + PAY_CHANNEL_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayChannelId()); + } + if (hasPayRouteId()) { + hash = (37 * hash) + PAY_ROUTE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayRouteId()); + } + if (hasPayTime()) { + hash = (37 * hash) + PAY_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayTime()); + } + if (hasCurrency()) { + hash = (37 * hash) + CURRENCY_FIELD_NUMBER; + hash = (53 * hash) + currency_; + } + if (hasOriginalAmount()) { + hash = (37 * hash) + ORIGINAL_AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOriginalAmount()); + } + if (hasPayAmount()) { + hash = (37 * hash) + PAY_AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayAmount()); + } + if (hasFeeAmount()) { + hash = (37 * hash) + FEE_AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFeeAmount()); + } + if (hasPayeeId()) { + hash = (37 * hash) + PAYEE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayeeId()); + } + if (hasPayeeName()) { + hash = (37 * hash) + PAYEE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPayeeName().hashCode(); + } + if (hasPayeeAccountId()) { + hash = (37 * hash) + PAYEE_ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayeeAccountId()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Payment parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Payment parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Payment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Payment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Payment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Payment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Payment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Payment parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Payment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Payment parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Payment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Payment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Payment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jigsaw.payment.Payment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.Payment) + org.jigsaw.payment.PaymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Payment_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Payment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Payment.class, org.jigsaw.payment.Payment.Builder.class); + } + + // Construct using org.jigsaw.payment.Payment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + id_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + orderId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + status_ = 1; + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + payerId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + payerName_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + payerAccountId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000040); + payMethodId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000080); + payChannelId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000100); + payRouteId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000200); + payTime_ = 0L; + bitField0_ = (bitField0_ & ~0x00000400); + currency_ = 1; + bitField0_ = (bitField0_ & ~0x00000800); + originalAmount_ = 0L; + bitField0_ = (bitField0_ & ~0x00001000); + payAmount_ = 0L; + bitField0_ = (bitField0_ & ~0x00002000); + feeAmount_ = 0L; + bitField0_ = (bitField0_ & ~0x00004000); + payeeId_ = 0L; + bitField0_ = (bitField0_ & ~0x00008000); + payeeName_ = ""; + bitField0_ = (bitField0_ & ~0x00010000); + payeeAccountId_ = 0L; + bitField0_ = (bitField0_ & ~0x00020000); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Payment_descriptor; + } + + public org.jigsaw.payment.Payment getDefaultInstanceForType() { + return org.jigsaw.payment.Payment.getDefaultInstance(); + } + + public org.jigsaw.payment.Payment build() { + org.jigsaw.payment.Payment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Payment buildPartial() { + org.jigsaw.payment.Payment result = new org.jigsaw.payment.Payment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.orderId_ = orderId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.createTime_ = createTime_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.payerId_ = payerId_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.payerName_ = payerName_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.payerAccountId_ = payerAccountId_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.payMethodId_ = payMethodId_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.payChannelId_ = payChannelId_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + result.payRouteId_ = payRouteId_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + result.payTime_ = payTime_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000800; + } + result.currency_ = currency_; + if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + to_bitField0_ |= 0x00001000; + } + result.originalAmount_ = originalAmount_; + if (((from_bitField0_ & 0x00002000) == 0x00002000)) { + to_bitField0_ |= 0x00002000; + } + result.payAmount_ = payAmount_; + if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + to_bitField0_ |= 0x00004000; + } + result.feeAmount_ = feeAmount_; + if (((from_bitField0_ & 0x00008000) == 0x00008000)) { + to_bitField0_ |= 0x00008000; + } + result.payeeId_ = payeeId_; + if (((from_bitField0_ & 0x00010000) == 0x00010000)) { + to_bitField0_ |= 0x00010000; + } + result.payeeName_ = payeeName_; + if (((from_bitField0_ & 0x00020000) == 0x00020000)) { + to_bitField0_ |= 0x00020000; + } + result.payeeAccountId_ = payeeAccountId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Payment) { + return mergeFrom((org.jigsaw.payment.Payment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Payment other) { + if (other == org.jigsaw.payment.Payment.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasOrderId()) { + setOrderId(other.getOrderId()); + } + if (other.hasStatus()) { + setStatus(other.getStatus()); + } + if (other.hasCreateTime()) { + setCreateTime(other.getCreateTime()); + } + if (other.hasPayerId()) { + setPayerId(other.getPayerId()); + } + if (other.hasPayerName()) { + bitField0_ |= 0x00000020; + payerName_ = other.payerName_; + onChanged(); + } + if (other.hasPayerAccountId()) { + setPayerAccountId(other.getPayerAccountId()); + } + if (other.hasPayMethodId()) { + setPayMethodId(other.getPayMethodId()); + } + if (other.hasPayChannelId()) { + setPayChannelId(other.getPayChannelId()); + } + if (other.hasPayRouteId()) { + setPayRouteId(other.getPayRouteId()); + } + if (other.hasPayTime()) { + setPayTime(other.getPayTime()); + } + if (other.hasCurrency()) { + setCurrency(other.getCurrency()); + } + if (other.hasOriginalAmount()) { + setOriginalAmount(other.getOriginalAmount()); + } + if (other.hasPayAmount()) { + setPayAmount(other.getPayAmount()); + } + if (other.hasFeeAmount()) { + setFeeAmount(other.getFeeAmount()); + } + if (other.hasPayeeId()) { + setPayeeId(other.getPayeeId()); + } + if (other.hasPayeeName()) { + bitField0_ |= 0x00010000; + payeeName_ = other.payeeName_; + onChanged(); + } + if (other.hasPayeeAccountId()) { + setPayeeAccountId(other.getPayeeAccountId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + if (!hasOrderId()) { + return false; + } + if (!hasStatus()) { + return false; + } + if (!hasCreateTime()) { + return false; + } + if (!hasPayerId()) { + return false; + } + if (!hasPayerName()) { + return false; + } + if (!hasPayerAccountId()) { + return false; + } + if (!hasPayMethodId()) { + return false; + } + if (!hasPayChannelId()) { + return false; + } + if (!hasCurrency()) { + return false; + } + if (!hasOriginalAmount()) { + return false; + } + if (!hasPayAmount()) { + return false; + } + if (!hasPayeeId()) { + return false; + } + if (!hasPayeeName()) { + return false; + } + if (!hasPayeeAccountId()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Payment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Payment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
+     * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+     * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+     * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + /** + *
+     * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+     * 
+ * + * required int64 id = 1; + */ + public Builder setId(long value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + *
+     * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+     * 
+ * + * required int64 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private long orderId_ ; + /** + *
+     * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+     * 
+ * + * required int64 order_id = 21; + */ + public boolean hasOrderId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+     * 
+ * + * required int64 order_id = 21; + */ + public long getOrderId() { + return orderId_; + } + /** + *
+     * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+     * 
+ * + * required int64 order_id = 21; + */ + public Builder setOrderId(long value) { + bitField0_ |= 0x00000002; + orderId_ = value; + onChanged(); + return this; + } + /** + *
+     * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+     * 
+ * + * required int64 order_id = 21; + */ + public Builder clearOrderId() { + bitField0_ = (bitField0_ & ~0x00000002); + orderId_ = 0L; + onChanged(); + return this; + } + + private int status_ = 1; + /** + *
+     * 支付状态
+     * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * 支付状态
+     * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + public org.jigsaw.payment.Payment.Status getStatus() { + org.jigsaw.payment.Payment.Status result = org.jigsaw.payment.Payment.Status.valueOf(status_); + return result == null ? org.jigsaw.payment.Payment.Status.UNPAID : result; + } + /** + *
+     * 支付状态
+     * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + public Builder setStatus(org.jigsaw.payment.Payment.Status value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * 支付状态
+     * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 1; + onChanged(); + return this; + } + + private long createTime_ ; + /** + *
+     *创建时间;	
+     * 
+ * + * required int64 create_time = 23; + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     *创建时间;	
+     * 
+ * + * required int64 create_time = 23; + */ + public long getCreateTime() { + return createTime_; + } + /** + *
+     *创建时间;	
+     * 
+ * + * required int64 create_time = 23; + */ + public Builder setCreateTime(long value) { + bitField0_ |= 0x00000008; + createTime_ = value; + onChanged(); + return this; + } + /** + *
+     *创建时间;	
+     * 
+ * + * required int64 create_time = 23; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = 0L; + onChanged(); + return this; + } + + private long payerId_ ; + /** + *
+     * 30~39 付款信息;
+     * 
+ * + * required int64 payer_id = 31; + */ + public boolean hasPayerId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * 30~39 付款信息;
+     * 
+ * + * required int64 payer_id = 31; + */ + public long getPayerId() { + return payerId_; + } + /** + *
+     * 30~39 付款信息;
+     * 
+ * + * required int64 payer_id = 31; + */ + public Builder setPayerId(long value) { + bitField0_ |= 0x00000010; + payerId_ = value; + onChanged(); + return this; + } + /** + *
+     * 30~39 付款信息;
+     * 
+ * + * required int64 payer_id = 31; + */ + public Builder clearPayerId() { + bitField0_ = (bitField0_ & ~0x00000010); + payerId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object payerName_ = ""; + /** + *
+     *付款人名称
+     * 
+ * + * required string payer_name = 32; + */ + public boolean hasPayerName() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     *付款人名称
+     * 
+ * + * required string payer_name = 32; + */ + public java.lang.String getPayerName() { + java.lang.Object ref = payerName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + payerName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     *付款人名称
+     * 
+ * + * required string payer_name = 32; + */ + public com.google.protobuf.ByteString + getPayerNameBytes() { + java.lang.Object ref = payerName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payerName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     *付款人名称
+     * 
+ * + * required string payer_name = 32; + */ + public Builder setPayerName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + payerName_ = value; + onChanged(); + return this; + } + /** + *
+     *付款人名称
+     * 
+ * + * required string payer_name = 32; + */ + public Builder clearPayerName() { + bitField0_ = (bitField0_ & ~0x00000020); + payerName_ = getDefaultInstance().getPayerName(); + onChanged(); + return this; + } + /** + *
+     *付款人名称
+     * 
+ * + * required string payer_name = 32; + */ + public Builder setPayerNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + payerName_ = value; + onChanged(); + return this; + } + + private long payerAccountId_ ; + /** + *
+     * 付款账户ID
+     * 
+ * + * required int64 payer_account_id = 33; + */ + public boolean hasPayerAccountId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+     * 付款账户ID
+     * 
+ * + * required int64 payer_account_id = 33; + */ + public long getPayerAccountId() { + return payerAccountId_; + } + /** + *
+     * 付款账户ID
+     * 
+ * + * required int64 payer_account_id = 33; + */ + public Builder setPayerAccountId(long value) { + bitField0_ |= 0x00000040; + payerAccountId_ = value; + onChanged(); + return this; + } + /** + *
+     * 付款账户ID
+     * 
+ * + * required int64 payer_account_id = 33; + */ + public Builder clearPayerAccountId() { + bitField0_ = (bitField0_ & ~0x00000040); + payerAccountId_ = 0L; + onChanged(); + return this; + } + + private long payMethodId_ ; + /** + *
+     *支付方式
+     * 
+ * + * required int64 pay_method_id = 34; + */ + public boolean hasPayMethodId() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+     *支付方式
+     * 
+ * + * required int64 pay_method_id = 34; + */ + public long getPayMethodId() { + return payMethodId_; + } + /** + *
+     *支付方式
+     * 
+ * + * required int64 pay_method_id = 34; + */ + public Builder setPayMethodId(long value) { + bitField0_ |= 0x00000080; + payMethodId_ = value; + onChanged(); + return this; + } + /** + *
+     *支付方式
+     * 
+ * + * required int64 pay_method_id = 34; + */ + public Builder clearPayMethodId() { + bitField0_ = (bitField0_ & ~0x00000080); + payMethodId_ = 0L; + onChanged(); + return this; + } + + private long payChannelId_ ; + /** + *
+     *支付渠道
+     * 
+ * + * required int64 pay_channel_id = 35; + */ + public boolean hasPayChannelId() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + *
+     *支付渠道
+     * 
+ * + * required int64 pay_channel_id = 35; + */ + public long getPayChannelId() { + return payChannelId_; + } + /** + *
+     *支付渠道
+     * 
+ * + * required int64 pay_channel_id = 35; + */ + public Builder setPayChannelId(long value) { + bitField0_ |= 0x00000100; + payChannelId_ = value; + onChanged(); + return this; + } + /** + *
+     *支付渠道
+     * 
+ * + * required int64 pay_channel_id = 35; + */ + public Builder clearPayChannelId() { + bitField0_ = (bitField0_ & ~0x00000100); + payChannelId_ = 0L; + onChanged(); + return this; + } + + private long payRouteId_ ; + /** + *
+     *支付路由
+     * 
+ * + * optional int64 pay_route_id = 36; + */ + public boolean hasPayRouteId() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + *
+     *支付路由
+     * 
+ * + * optional int64 pay_route_id = 36; + */ + public long getPayRouteId() { + return payRouteId_; + } + /** + *
+     *支付路由
+     * 
+ * + * optional int64 pay_route_id = 36; + */ + public Builder setPayRouteId(long value) { + bitField0_ |= 0x00000200; + payRouteId_ = value; + onChanged(); + return this; + } + /** + *
+     *支付路由
+     * 
+ * + * optional int64 pay_route_id = 36; + */ + public Builder clearPayRouteId() { + bitField0_ = (bitField0_ & ~0x00000200); + payRouteId_ = 0L; + onChanged(); + return this; + } + + private long payTime_ ; + /** + *
+     *实际完成支付的时间
+     * 
+ * + * optional int64 pay_time = 37; + */ + public boolean hasPayTime() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + *
+     *实际完成支付的时间
+     * 
+ * + * optional int64 pay_time = 37; + */ + public long getPayTime() { + return payTime_; + } + /** + *
+     *实际完成支付的时间
+     * 
+ * + * optional int64 pay_time = 37; + */ + public Builder setPayTime(long value) { + bitField0_ |= 0x00000400; + payTime_ = value; + onChanged(); + return this; + } + /** + *
+     *实际完成支付的时间
+     * 
+ * + * optional int64 pay_time = 37; + */ + public Builder clearPayTime() { + bitField0_ = (bitField0_ & ~0x00000400); + payTime_ = 0L; + onChanged(); + return this; + } + + private int currency_ = 1; + /** + *
+     * 40~49 费用信息
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + public boolean hasCurrency() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + *
+     * 40~49 费用信息
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + public org.jigsaw.payment.Currency getCurrency() { + org.jigsaw.payment.Currency result = org.jigsaw.payment.Currency.valueOf(currency_); + return result == null ? org.jigsaw.payment.Currency.RMB : result; + } + /** + *
+     * 40~49 费用信息
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + public Builder setCurrency(org.jigsaw.payment.Currency value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + currency_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * 40~49 费用信息
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + public Builder clearCurrency() { + bitField0_ = (bitField0_ & ~0x00000800); + currency_ = 1; + onChanged(); + return this; + } + + private long originalAmount_ ; + /** + *
+     *原金额
+     * 
+ * + * required int64 original_amount = 41; + */ + public boolean hasOriginalAmount() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + *
+     *原金额
+     * 
+ * + * required int64 original_amount = 41; + */ + public long getOriginalAmount() { + return originalAmount_; + } + /** + *
+     *原金额
+     * 
+ * + * required int64 original_amount = 41; + */ + public Builder setOriginalAmount(long value) { + bitField0_ |= 0x00001000; + originalAmount_ = value; + onChanged(); + return this; + } + /** + *
+     *原金额
+     * 
+ * + * required int64 original_amount = 41; + */ + public Builder clearOriginalAmount() { + bitField0_ = (bitField0_ & ~0x00001000); + originalAmount_ = 0L; + onChanged(); + return this; + } + + private long payAmount_ ; + /** + *
+     *实际支付费用
+     * 
+ * + * required int64 pay_amount = 42; + */ + public boolean hasPayAmount() { + return ((bitField0_ & 0x00002000) == 0x00002000); + } + /** + *
+     *实际支付费用
+     * 
+ * + * required int64 pay_amount = 42; + */ + public long getPayAmount() { + return payAmount_; + } + /** + *
+     *实际支付费用
+     * 
+ * + * required int64 pay_amount = 42; + */ + public Builder setPayAmount(long value) { + bitField0_ |= 0x00002000; + payAmount_ = value; + onChanged(); + return this; + } + /** + *
+     *实际支付费用
+     * 
+ * + * required int64 pay_amount = 42; + */ + public Builder clearPayAmount() { + bitField0_ = (bitField0_ & ~0x00002000); + payAmount_ = 0L; + onChanged(); + return this; + } + + private long feeAmount_ ; + /** + *
+     *手续费		
+     * 
+ * + * optional int64 fee_amount = 43; + */ + public boolean hasFeeAmount() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + /** + *
+     *手续费		
+     * 
+ * + * optional int64 fee_amount = 43; + */ + public long getFeeAmount() { + return feeAmount_; + } + /** + *
+     *手续费		
+     * 
+ * + * optional int64 fee_amount = 43; + */ + public Builder setFeeAmount(long value) { + bitField0_ |= 0x00004000; + feeAmount_ = value; + onChanged(); + return this; + } + /** + *
+     *手续费		
+     * 
+ * + * optional int64 fee_amount = 43; + */ + public Builder clearFeeAmount() { + bitField0_ = (bitField0_ & ~0x00004000); + feeAmount_ = 0L; + onChanged(); + return this; + } + + private long payeeId_ ; + /** + *
+     * 50~59 收款人信息
+     * 
+ * + * required int64 payee_id = 50; + */ + public boolean hasPayeeId() { + return ((bitField0_ & 0x00008000) == 0x00008000); + } + /** + *
+     * 50~59 收款人信息
+     * 
+ * + * required int64 payee_id = 50; + */ + public long getPayeeId() { + return payeeId_; + } + /** + *
+     * 50~59 收款人信息
+     * 
+ * + * required int64 payee_id = 50; + */ + public Builder setPayeeId(long value) { + bitField0_ |= 0x00008000; + payeeId_ = value; + onChanged(); + return this; + } + /** + *
+     * 50~59 收款人信息
+     * 
+ * + * required int64 payee_id = 50; + */ + public Builder clearPayeeId() { + bitField0_ = (bitField0_ & ~0x00008000); + payeeId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object payeeName_ = ""; + /** + *
+     *收款人名称
+     * 
+ * + * required string payee_name = 51; + */ + public boolean hasPayeeName() { + return ((bitField0_ & 0x00010000) == 0x00010000); + } + /** + *
+     *收款人名称
+     * 
+ * + * required string payee_name = 51; + */ + public java.lang.String getPayeeName() { + java.lang.Object ref = payeeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + payeeName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     *收款人名称
+     * 
+ * + * required string payee_name = 51; + */ + public com.google.protobuf.ByteString + getPayeeNameBytes() { + java.lang.Object ref = payeeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payeeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     *收款人名称
+     * 
+ * + * required string payee_name = 51; + */ + public Builder setPayeeName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + payeeName_ = value; + onChanged(); + return this; + } + /** + *
+     *收款人名称
+     * 
+ * + * required string payee_name = 51; + */ + public Builder clearPayeeName() { + bitField0_ = (bitField0_ & ~0x00010000); + payeeName_ = getDefaultInstance().getPayeeName(); + onChanged(); + return this; + } + /** + *
+     *收款人名称
+     * 
+ * + * required string payee_name = 51; + */ + public Builder setPayeeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + payeeName_ = value; + onChanged(); + return this; + } + + private long payeeAccountId_ ; + /** + *
+     *收款账号ID  
+     * 
+ * + * required int64 payee_account_id = 52; + */ + public boolean hasPayeeAccountId() { + return ((bitField0_ & 0x00020000) == 0x00020000); + } + /** + *
+     *收款账号ID  
+     * 
+ * + * required int64 payee_account_id = 52; + */ + public long getPayeeAccountId() { + return payeeAccountId_; + } + /** + *
+     *收款账号ID  
+     * 
+ * + * required int64 payee_account_id = 52; + */ + public Builder setPayeeAccountId(long value) { + bitField0_ |= 0x00020000; + payeeAccountId_ = value; + onChanged(); + return this; + } + /** + *
+     *收款账号ID  
+     * 
+ * + * required int64 payee_account_id = 52; + */ + public Builder clearPayeeAccountId() { + bitField0_ = (bitField0_ & ~0x00020000); + payeeAccountId_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.Payment) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.Payment) + private static final org.jigsaw.payment.Payment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Payment(); + } + + public static org.jigsaw.payment.Payment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Payment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Payment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Payment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntity.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntity.java new file mode 100644 index 0000000..63cae51 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntity.java @@ -0,0 +1,948 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 预留字段定义
+ * 所有实体在定义时, 优先考虑使用预留字段中的属性。 实体其他属性编号从21开始。 
+ * 
+ * + * Protobuf type {@code org.jigsaw.payment.PaymentEntity} + */ +public final class PaymentEntity extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.PaymentEntity) + PaymentEntityOrBuilder { + // Use PaymentEntity.newBuilder() to construct. + private PaymentEntity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PaymentEntity() { + id_ = 0L; + title_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentEntity( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt64(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + title_ = bs; + break; + } + case 74: { + org.jigsaw.payment.Version.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = version_.toBuilder(); + } + version_ = input.readMessage(org.jigsaw.payment.Version.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_PaymentEntity_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_PaymentEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.PaymentEntity.class, org.jigsaw.payment.PaymentEntity.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int TITLE_FIELD_NUMBER = 2; + private volatile java.lang.Object title_; + /** + *
+   *名称
+   * 
+ * + * optional string title = 2; + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+   *名称
+   * 
+ * + * optional string title = 2; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + title_ = s; + } + return s; + } + } + /** + *
+   *名称
+   * 
+ * + * optional string title = 2; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 9; + private org.jigsaw.payment.Version version_; + /** + *
+   *版本信息  
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+   *版本信息  
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version getVersion() { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + /** + *
+   *版本信息  
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder() { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; + } + if (!getVersion().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(9, getVersion()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getVersion()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.PaymentEntity)) { + return super.equals(obj); + } + org.jigsaw.payment.PaymentEntity other = (org.jigsaw.payment.PaymentEntity) obj; + + boolean result = true; + result = result && (hasId() == other.hasId()); + if (hasId()) { + result = result && (getId() + == other.getId()); + } + result = result && (hasTitle() == other.hasTitle()); + if (hasTitle()) { + result = result && getTitle() + .equals(other.getTitle()); + } + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && getVersion() + .equals(other.getVersion()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + } + if (hasTitle()) { + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + } + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.PaymentEntity parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.PaymentEntity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.PaymentEntity parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.PaymentEntity parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.PaymentEntity parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.PaymentEntity parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.PaymentEntity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   **
+   * 预留字段定义
+   * 所有实体在定义时, 优先考虑使用预留字段中的属性。 实体其他属性编号从21开始。 
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.PaymentEntity} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.PaymentEntity) + org.jigsaw.payment.PaymentEntityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_PaymentEntity_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_PaymentEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.PaymentEntity.class, org.jigsaw.payment.PaymentEntity.Builder.class); + } + + // Construct using org.jigsaw.payment.PaymentEntity.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + id_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + title_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + if (versionBuilder_ == null) { + version_ = null; + } else { + versionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_PaymentEntity_descriptor; + } + + public org.jigsaw.payment.PaymentEntity getDefaultInstanceForType() { + return org.jigsaw.payment.PaymentEntity.getDefaultInstance(); + } + + public org.jigsaw.payment.PaymentEntity build() { + org.jigsaw.payment.PaymentEntity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.PaymentEntity buildPartial() { + org.jigsaw.payment.PaymentEntity result = new org.jigsaw.payment.PaymentEntity(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.title_ = title_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.PaymentEntity) { + return mergeFrom((org.jigsaw.payment.PaymentEntity)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.PaymentEntity other) { + if (other == org.jigsaw.payment.PaymentEntity.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasTitle()) { + bitField0_ |= 0x00000002; + title_ = other.title_; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + if (!hasVersion()) { + return false; + } + if (!getVersion().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.PaymentEntity parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.PaymentEntity) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public Builder setId(long value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + *
+     *科目代码,唯一识别码
+     * 
+ * + * required int64 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + *
+     *名称
+     * 
+ * + * optional string title = 2; + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     *名称
+     * 
+ * + * optional string title = 2; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + title_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     *名称
+     * 
+ * + * optional string title = 2; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     *名称
+     * 
+ * + * optional string title = 2; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + title_ = value; + onChanged(); + return this; + } + /** + *
+     *名称
+     * 
+ * + * optional string title = 2; + */ + public Builder clearTitle() { + bitField0_ = (bitField0_ & ~0x00000002); + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + *
+     *名称
+     * 
+ * + * optional string title = 2; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + title_ = value; + onChanged(); + return this; + } + + private org.jigsaw.payment.Version version_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder> versionBuilder_; + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? org.jigsaw.payment.Version.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder setVersion(org.jigsaw.payment.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder setVersion( + org.jigsaw.payment.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder mergeVersion(org.jigsaw.payment.Version value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + version_ != null && + version_ != org.jigsaw.payment.Version.getDefaultInstance()) { + version_ = + org.jigsaw.payment.Version.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + versionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.Version.Builder getVersionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + public org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + org.jigsaw.payment.Version.getDefaultInstance() : version_; + } + } + /** + *
+     *版本信息  
+     * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Version, org.jigsaw.payment.Version.Builder, org.jigsaw.payment.VersionOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.PaymentEntity) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.PaymentEntity) + private static final org.jigsaw.payment.PaymentEntity DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.PaymentEntity(); + } + + public static org.jigsaw.payment.PaymentEntity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PaymentEntity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentEntity(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.PaymentEntity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntityOrBuilder.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntityOrBuilder.java new file mode 100644 index 0000000..eb5d601 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentEntityOrBuilder.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +public interface PaymentEntityOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.PaymentEntity) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + boolean hasId(); + /** + *
+   *科目代码,唯一识别码
+   * 
+ * + * required int64 id = 1; + */ + long getId(); + + /** + *
+   *名称
+   * 
+ * + * optional string title = 2; + */ + boolean hasTitle(); + /** + *
+   *名称
+   * 
+ * + * optional string title = 2; + */ + java.lang.String getTitle(); + /** + *
+   *名称
+   * 
+ * + * optional string title = 2; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + *
+   *版本信息  
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + boolean hasVersion(); + /** + *
+   *版本信息  
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + org.jigsaw.payment.Version getVersion(); + /** + *
+   *版本信息  
+   * 
+ * + * required .org.jigsaw.payment.Version version = 9; + */ + org.jigsaw.payment.VersionOrBuilder getVersionOrBuilder(); +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentOrBuilder.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentOrBuilder.java new file mode 100644 index 0000000..e7edb4c --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/PaymentOrBuilder.java @@ -0,0 +1,333 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +public interface PaymentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.Payment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+   * 
+ * + * required int64 id = 1; + */ + boolean hasId(); + /** + *
+   * 支付订单。必须以一定的规则来生成。注意,订单号必须唯一,不重复。 
+   * 
+ * + * required int64 id = 1; + */ + long getId(); + + /** + *
+   * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+   * 
+ * + * required int64 order_id = 21; + */ + boolean hasOrderId(); + /** + *
+   * 交易订单号,或者是商城订单号。这是由电商系统或者业务生成后,发送给支付系统。对一个业务订单,可以发起多次支付。
+   * 
+ * + * required int64 order_id = 21; + */ + long getOrderId(); + + /** + *
+   * 支付状态
+   * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + boolean hasStatus(); + /** + *
+   * 支付状态
+   * 
+ * + * required .org.jigsaw.payment.Payment.Status status = 22; + */ + org.jigsaw.payment.Payment.Status getStatus(); + + /** + *
+   *创建时间;	
+   * 
+ * + * required int64 create_time = 23; + */ + boolean hasCreateTime(); + /** + *
+   *创建时间;	
+   * 
+ * + * required int64 create_time = 23; + */ + long getCreateTime(); + + /** + *
+   * 30~39 付款信息;
+   * 
+ * + * required int64 payer_id = 31; + */ + boolean hasPayerId(); + /** + *
+   * 30~39 付款信息;
+   * 
+ * + * required int64 payer_id = 31; + */ + long getPayerId(); + + /** + *
+   *付款人名称
+   * 
+ * + * required string payer_name = 32; + */ + boolean hasPayerName(); + /** + *
+   *付款人名称
+   * 
+ * + * required string payer_name = 32; + */ + java.lang.String getPayerName(); + /** + *
+   *付款人名称
+   * 
+ * + * required string payer_name = 32; + */ + com.google.protobuf.ByteString + getPayerNameBytes(); + + /** + *
+   * 付款账户ID
+   * 
+ * + * required int64 payer_account_id = 33; + */ + boolean hasPayerAccountId(); + /** + *
+   * 付款账户ID
+   * 
+ * + * required int64 payer_account_id = 33; + */ + long getPayerAccountId(); + + /** + *
+   *支付方式
+   * 
+ * + * required int64 pay_method_id = 34; + */ + boolean hasPayMethodId(); + /** + *
+   *支付方式
+   * 
+ * + * required int64 pay_method_id = 34; + */ + long getPayMethodId(); + + /** + *
+   *支付渠道
+   * 
+ * + * required int64 pay_channel_id = 35; + */ + boolean hasPayChannelId(); + /** + *
+   *支付渠道
+   * 
+ * + * required int64 pay_channel_id = 35; + */ + long getPayChannelId(); + + /** + *
+   *支付路由
+   * 
+ * + * optional int64 pay_route_id = 36; + */ + boolean hasPayRouteId(); + /** + *
+   *支付路由
+   * 
+ * + * optional int64 pay_route_id = 36; + */ + long getPayRouteId(); + + /** + *
+   *实际完成支付的时间
+   * 
+ * + * optional int64 pay_time = 37; + */ + boolean hasPayTime(); + /** + *
+   *实际完成支付的时间
+   * 
+ * + * optional int64 pay_time = 37; + */ + long getPayTime(); + + /** + *
+   * 40~49 费用信息
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + boolean hasCurrency(); + /** + *
+   * 40~49 费用信息
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 40; + */ + org.jigsaw.payment.Currency getCurrency(); + + /** + *
+   *原金额
+   * 
+ * + * required int64 original_amount = 41; + */ + boolean hasOriginalAmount(); + /** + *
+   *原金额
+   * 
+ * + * required int64 original_amount = 41; + */ + long getOriginalAmount(); + + /** + *
+   *实际支付费用
+   * 
+ * + * required int64 pay_amount = 42; + */ + boolean hasPayAmount(); + /** + *
+   *实际支付费用
+   * 
+ * + * required int64 pay_amount = 42; + */ + long getPayAmount(); + + /** + *
+   *手续费		
+   * 
+ * + * optional int64 fee_amount = 43; + */ + boolean hasFeeAmount(); + /** + *
+   *手续费		
+   * 
+ * + * optional int64 fee_amount = 43; + */ + long getFeeAmount(); + + /** + *
+   * 50~59 收款人信息
+   * 
+ * + * required int64 payee_id = 50; + */ + boolean hasPayeeId(); + /** + *
+   * 50~59 收款人信息
+   * 
+ * + * required int64 payee_id = 50; + */ + long getPayeeId(); + + /** + *
+   *收款人名称
+   * 
+ * + * required string payee_name = 51; + */ + boolean hasPayeeName(); + /** + *
+   *收款人名称
+   * 
+ * + * required string payee_name = 51; + */ + java.lang.String getPayeeName(); + /** + *
+   *收款人名称
+   * 
+ * + * required string payee_name = 51; + */ + com.google.protobuf.ByteString + getPayeeNameBytes(); + + /** + *
+   *收款账号ID  
+   * 
+ * + * required int64 payee_account_id = 52; + */ + boolean hasPayeeAccountId(); + /** + *
+   *收款账号ID  
+   * 
+ * + * required int64 payee_account_id = 52; + */ + long getPayeeAccountId(); +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Property.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Property.java new file mode 100644 index 0000000..54d0a7d --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Property.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: property.proto + +package org.jigsaw.payment; + +public final class Property { + private Property() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_Version_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_Version_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016property.proto\022\022org.jigsaw.payment\032\ndi" + + "ct.proto\"\236\001\n\007Version\022\017\n\007version\030\001 \002(\t\022\024\n" + + "\014created_time\030\002 \002(\003\022\017\n\007creator\030\003 \002(\t\022\024\n\014" + + "creator_name\030\004 \002(\t\022\024\n\014last_updated\030\005 \002(\003" + + "\022\024\n\014last_updator\030\006 \002(\t\022\031\n\021last_updator_n" + + "ame\030\007 \002(\tB\002P\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.jigsaw.payment.Dict.getDescriptor(), + }, assigner); + internal_static_org_jigsaw_payment_Version_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_jigsaw_payment_Version_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_Version_descriptor, + new java.lang.String[] { "Version", "CreatedTime", "Creator", "CreatorName", "LastUpdated", "LastUpdator", "LastUpdatorName", }); + org.jigsaw.payment.Dict.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Version.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Version.java new file mode 100644 index 0000000..47bdc25 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Version.java @@ -0,0 +1,1591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: property.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 版本控制信息
+ * 
+ * + * Protobuf type {@code org.jigsaw.payment.Version} + */ +public final class Version extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.Version) + VersionOrBuilder { + // Use Version.newBuilder() to construct. + private Version(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Version() { + version_ = ""; + createdTime_ = 0L; + creator_ = ""; + creatorName_ = ""; + lastUpdated_ = 0L; + lastUpdator_ = ""; + lastUpdatorName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Version( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + version_ = bs; + break; + } + case 16: { + bitField0_ |= 0x00000002; + createdTime_ = input.readInt64(); + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + creator_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + creatorName_ = bs; + break; + } + case 40: { + bitField0_ |= 0x00000010; + lastUpdated_ = input.readInt64(); + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + lastUpdator_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + lastUpdatorName_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Property.internal_static_org_jigsaw_payment_Version_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Property.internal_static_org_jigsaw_payment_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Version.class, org.jigsaw.payment.Version.Builder.class); + } + + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + *
+   *版本号
+   * 
+ * + * required string version = 1; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+   *版本号
+   * 
+ * + * required string version = 1; + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + version_ = s; + } + return s; + } + } + /** + *
+   *版本号
+   * 
+ * + * required string version = 1; + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATED_TIME_FIELD_NUMBER = 2; + private long createdTime_; + /** + *
+   * 创建时间;
+   * 
+ * + * required int64 created_time = 2; + */ + public boolean hasCreatedTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+   * 创建时间;
+   * 
+ * + * required int64 created_time = 2; + */ + public long getCreatedTime() { + return createdTime_; + } + + public static final int CREATOR_FIELD_NUMBER = 3; + private volatile java.lang.Object creator_; + /** + *
+   * 创建者id或者username。 
+   * 
+ * + * required string creator = 3; + */ + public boolean hasCreator() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+   * 创建者id或者username。 
+   * 
+ * + * required string creator = 3; + */ + public java.lang.String getCreator() { + java.lang.Object ref = creator_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + creator_ = s; + } + return s; + } + } + /** + *
+   * 创建者id或者username。 
+   * 
+ * + * required string creator = 3; + */ + public com.google.protobuf.ByteString + getCreatorBytes() { + java.lang.Object ref = creator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + creator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATOR_NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object creatorName_; + /** + *
+   * 创建者姓名; 
+   * 
+ * + * required string creator_name = 4; + */ + public boolean hasCreatorName() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+   * 创建者姓名; 
+   * 
+ * + * required string creator_name = 4; + */ + public java.lang.String getCreatorName() { + java.lang.Object ref = creatorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + creatorName_ = s; + } + return s; + } + } + /** + *
+   * 创建者姓名; 
+   * 
+ * + * required string creator_name = 4; + */ + public com.google.protobuf.ByteString + getCreatorNameBytes() { + java.lang.Object ref = creatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + creatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LAST_UPDATED_FIELD_NUMBER = 5; + private long lastUpdated_; + /** + *
+   * 最后修改时间;
+   * 
+ * + * required int64 last_updated = 5; + */ + public boolean hasLastUpdated() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+   * 最后修改时间;
+   * 
+ * + * required int64 last_updated = 5; + */ + public long getLastUpdated() { + return lastUpdated_; + } + + public static final int LAST_UPDATOR_FIELD_NUMBER = 6; + private volatile java.lang.Object lastUpdator_; + /** + *
+   * 最后修改人的标识,可以是Id,也可以是用户名等。 
+   * 
+ * + * required string last_updator = 6; + */ + public boolean hasLastUpdator() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+   * 最后修改人的标识,可以是Id,也可以是用户名等。 
+   * 
+ * + * required string last_updator = 6; + */ + public java.lang.String getLastUpdator() { + java.lang.Object ref = lastUpdator_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + lastUpdator_ = s; + } + return s; + } + } + /** + *
+   * 最后修改人的标识,可以是Id,也可以是用户名等。 
+   * 
+ * + * required string last_updator = 6; + */ + public com.google.protobuf.ByteString + getLastUpdatorBytes() { + java.lang.Object ref = lastUpdator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastUpdator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LAST_UPDATOR_NAME_FIELD_NUMBER = 7; + private volatile java.lang.Object lastUpdatorName_; + /** + *
+   * 最后修改人姓名; 
+   * 
+ * + * required string last_updator_name = 7; + */ + public boolean hasLastUpdatorName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+   * 最后修改人姓名; 
+   * 
+ * + * required string last_updator_name = 7; + */ + public java.lang.String getLastUpdatorName() { + java.lang.Object ref = lastUpdatorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + lastUpdatorName_ = s; + } + return s; + } + } + /** + *
+   * 最后修改人姓名; 
+   * 
+ * + * required string last_updator_name = 7; + */ + public com.google.protobuf.ByteString + getLastUpdatorNameBytes() { + java.lang.Object ref = lastUpdatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastUpdatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCreatedTime()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCreator()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCreatorName()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLastUpdated()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLastUpdator()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLastUpdatorName()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, createdTime_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, creator_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, creatorName_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt64(5, lastUpdated_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, lastUpdator_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, lastUpdatorName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, createdTime_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, creator_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, creatorName_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, lastUpdated_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, lastUpdator_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, lastUpdatorName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Version)) { + return super.equals(obj); + } + org.jigsaw.payment.Version other = (org.jigsaw.payment.Version) obj; + + boolean result = true; + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && getVersion() + .equals(other.getVersion()); + } + result = result && (hasCreatedTime() == other.hasCreatedTime()); + if (hasCreatedTime()) { + result = result && (getCreatedTime() + == other.getCreatedTime()); + } + result = result && (hasCreator() == other.hasCreator()); + if (hasCreator()) { + result = result && getCreator() + .equals(other.getCreator()); + } + result = result && (hasCreatorName() == other.hasCreatorName()); + if (hasCreatorName()) { + result = result && getCreatorName() + .equals(other.getCreatorName()); + } + result = result && (hasLastUpdated() == other.hasLastUpdated()); + if (hasLastUpdated()) { + result = result && (getLastUpdated() + == other.getLastUpdated()); + } + result = result && (hasLastUpdator() == other.hasLastUpdator()); + if (hasLastUpdator()) { + result = result && getLastUpdator() + .equals(other.getLastUpdator()); + } + result = result && (hasLastUpdatorName() == other.hasLastUpdatorName()); + if (hasLastUpdatorName()) { + result = result && getLastUpdatorName() + .equals(other.getLastUpdatorName()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + if (hasCreatedTime()) { + hash = (37 * hash) + CREATED_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreatedTime()); + } + if (hasCreator()) { + hash = (37 * hash) + CREATOR_FIELD_NUMBER; + hash = (53 * hash) + getCreator().hashCode(); + } + if (hasCreatorName()) { + hash = (37 * hash) + CREATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCreatorName().hashCode(); + } + if (hasLastUpdated()) { + hash = (37 * hash) + LAST_UPDATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLastUpdated()); + } + if (hasLastUpdator()) { + hash = (37 * hash) + LAST_UPDATOR_FIELD_NUMBER; + hash = (53 * hash) + getLastUpdator().hashCode(); + } + if (hasLastUpdatorName()) { + hash = (37 * hash) + LAST_UPDATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLastUpdatorName().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Version parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Version parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Version parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Version parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Version parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Version parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Version parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Version parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Version parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Version parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Version parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Version parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Version prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   **
+   * 版本控制信息
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.Version} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.Version) + org.jigsaw.payment.VersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Property.internal_static_org_jigsaw_payment_Version_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Property.internal_static_org_jigsaw_payment_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Version.class, org.jigsaw.payment.Version.Builder.class); + } + + // Construct using org.jigsaw.payment.Version.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + version_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + createdTime_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + creator_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + creatorName_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + lastUpdated_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + lastUpdator_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + lastUpdatorName_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Property.internal_static_org_jigsaw_payment_Version_descriptor; + } + + public org.jigsaw.payment.Version getDefaultInstanceForType() { + return org.jigsaw.payment.Version.getDefaultInstance(); + } + + public org.jigsaw.payment.Version build() { + org.jigsaw.payment.Version result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Version buildPartial() { + org.jigsaw.payment.Version result = new org.jigsaw.payment.Version(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.createdTime_ = createdTime_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.creator_ = creator_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.creatorName_ = creatorName_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.lastUpdated_ = lastUpdated_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.lastUpdator_ = lastUpdator_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.lastUpdatorName_ = lastUpdatorName_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Version) { + return mergeFrom((org.jigsaw.payment.Version)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Version other) { + if (other == org.jigsaw.payment.Version.getDefaultInstance()) return this; + if (other.hasVersion()) { + bitField0_ |= 0x00000001; + version_ = other.version_; + onChanged(); + } + if (other.hasCreatedTime()) { + setCreatedTime(other.getCreatedTime()); + } + if (other.hasCreator()) { + bitField0_ |= 0x00000004; + creator_ = other.creator_; + onChanged(); + } + if (other.hasCreatorName()) { + bitField0_ |= 0x00000008; + creatorName_ = other.creatorName_; + onChanged(); + } + if (other.hasLastUpdated()) { + setLastUpdated(other.getLastUpdated()); + } + if (other.hasLastUpdator()) { + bitField0_ |= 0x00000020; + lastUpdator_ = other.lastUpdator_; + onChanged(); + } + if (other.hasLastUpdatorName()) { + bitField0_ |= 0x00000040; + lastUpdatorName_ = other.lastUpdatorName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasVersion()) { + return false; + } + if (!hasCreatedTime()) { + return false; + } + if (!hasCreator()) { + return false; + } + if (!hasCreatorName()) { + return false; + } + if (!hasLastUpdated()) { + return false; + } + if (!hasLastUpdator()) { + return false; + } + if (!hasLastUpdatorName()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Version parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Version) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object version_ = ""; + /** + *
+     *版本号
+     * 
+ * + * required string version = 1; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *版本号
+     * 
+ * + * required string version = 1; + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + version_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     *版本号
+     * 
+ * + * required string version = 1; + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     *版本号
+     * 
+ * + * required string version = 1; + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + version_ = value; + onChanged(); + return this; + } + /** + *
+     *版本号
+     * 
+ * + * required string version = 1; + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + *
+     *版本号
+     * 
+ * + * required string version = 1; + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + version_ = value; + onChanged(); + return this; + } + + private long createdTime_ ; + /** + *
+     * 创建时间;
+     * 
+ * + * required int64 created_time = 2; + */ + public boolean hasCreatedTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * 创建时间;
+     * 
+ * + * required int64 created_time = 2; + */ + public long getCreatedTime() { + return createdTime_; + } + /** + *
+     * 创建时间;
+     * 
+ * + * required int64 created_time = 2; + */ + public Builder setCreatedTime(long value) { + bitField0_ |= 0x00000002; + createdTime_ = value; + onChanged(); + return this; + } + /** + *
+     * 创建时间;
+     * 
+ * + * required int64 created_time = 2; + */ + public Builder clearCreatedTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createdTime_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object creator_ = ""; + /** + *
+     * 创建者id或者username。 
+     * 
+ * + * required string creator = 3; + */ + public boolean hasCreator() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * 创建者id或者username。 
+     * 
+ * + * required string creator = 3; + */ + public java.lang.String getCreator() { + java.lang.Object ref = creator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + creator_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 创建者id或者username。 
+     * 
+ * + * required string creator = 3; + */ + public com.google.protobuf.ByteString + getCreatorBytes() { + java.lang.Object ref = creator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + creator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 创建者id或者username。 
+     * 
+ * + * required string creator = 3; + */ + public Builder setCreator( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + creator_ = value; + onChanged(); + return this; + } + /** + *
+     * 创建者id或者username。 
+     * 
+ * + * required string creator = 3; + */ + public Builder clearCreator() { + bitField0_ = (bitField0_ & ~0x00000004); + creator_ = getDefaultInstance().getCreator(); + onChanged(); + return this; + } + /** + *
+     * 创建者id或者username。 
+     * 
+ * + * required string creator = 3; + */ + public Builder setCreatorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + creator_ = value; + onChanged(); + return this; + } + + private java.lang.Object creatorName_ = ""; + /** + *
+     * 创建者姓名; 
+     * 
+ * + * required string creator_name = 4; + */ + public boolean hasCreatorName() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * 创建者姓名; 
+     * 
+ * + * required string creator_name = 4; + */ + public java.lang.String getCreatorName() { + java.lang.Object ref = creatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + creatorName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 创建者姓名; 
+     * 
+ * + * required string creator_name = 4; + */ + public com.google.protobuf.ByteString + getCreatorNameBytes() { + java.lang.Object ref = creatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + creatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 创建者姓名; 
+     * 
+ * + * required string creator_name = 4; + */ + public Builder setCreatorName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + creatorName_ = value; + onChanged(); + return this; + } + /** + *
+     * 创建者姓名; 
+     * 
+ * + * required string creator_name = 4; + */ + public Builder clearCreatorName() { + bitField0_ = (bitField0_ & ~0x00000008); + creatorName_ = getDefaultInstance().getCreatorName(); + onChanged(); + return this; + } + /** + *
+     * 创建者姓名; 
+     * 
+ * + * required string creator_name = 4; + */ + public Builder setCreatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + creatorName_ = value; + onChanged(); + return this; + } + + private long lastUpdated_ ; + /** + *
+     * 最后修改时间;
+     * 
+ * + * required int64 last_updated = 5; + */ + public boolean hasLastUpdated() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * 最后修改时间;
+     * 
+ * + * required int64 last_updated = 5; + */ + public long getLastUpdated() { + return lastUpdated_; + } + /** + *
+     * 最后修改时间;
+     * 
+ * + * required int64 last_updated = 5; + */ + public Builder setLastUpdated(long value) { + bitField0_ |= 0x00000010; + lastUpdated_ = value; + onChanged(); + return this; + } + /** + *
+     * 最后修改时间;
+     * 
+ * + * required int64 last_updated = 5; + */ + public Builder clearLastUpdated() { + bitField0_ = (bitField0_ & ~0x00000010); + lastUpdated_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object lastUpdator_ = ""; + /** + *
+     * 最后修改人的标识,可以是Id,也可以是用户名等。 
+     * 
+ * + * required string last_updator = 6; + */ + public boolean hasLastUpdator() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     * 最后修改人的标识,可以是Id,也可以是用户名等。 
+     * 
+ * + * required string last_updator = 6; + */ + public java.lang.String getLastUpdator() { + java.lang.Object ref = lastUpdator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + lastUpdator_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 最后修改人的标识,可以是Id,也可以是用户名等。 
+     * 
+ * + * required string last_updator = 6; + */ + public com.google.protobuf.ByteString + getLastUpdatorBytes() { + java.lang.Object ref = lastUpdator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastUpdator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 最后修改人的标识,可以是Id,也可以是用户名等。 
+     * 
+ * + * required string last_updator = 6; + */ + public Builder setLastUpdator( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + lastUpdator_ = value; + onChanged(); + return this; + } + /** + *
+     * 最后修改人的标识,可以是Id,也可以是用户名等。 
+     * 
+ * + * required string last_updator = 6; + */ + public Builder clearLastUpdator() { + bitField0_ = (bitField0_ & ~0x00000020); + lastUpdator_ = getDefaultInstance().getLastUpdator(); + onChanged(); + return this; + } + /** + *
+     * 最后修改人的标识,可以是Id,也可以是用户名等。 
+     * 
+ * + * required string last_updator = 6; + */ + public Builder setLastUpdatorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + lastUpdator_ = value; + onChanged(); + return this; + } + + private java.lang.Object lastUpdatorName_ = ""; + /** + *
+     * 最后修改人姓名; 
+     * 
+ * + * required string last_updator_name = 7; + */ + public boolean hasLastUpdatorName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+     * 最后修改人姓名; 
+     * 
+ * + * required string last_updator_name = 7; + */ + public java.lang.String getLastUpdatorName() { + java.lang.Object ref = lastUpdatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + lastUpdatorName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 最后修改人姓名; 
+     * 
+ * + * required string last_updator_name = 7; + */ + public com.google.protobuf.ByteString + getLastUpdatorNameBytes() { + java.lang.Object ref = lastUpdatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastUpdatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 最后修改人姓名; 
+     * 
+ * + * required string last_updator_name = 7; + */ + public Builder setLastUpdatorName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + lastUpdatorName_ = value; + onChanged(); + return this; + } + /** + *
+     * 最后修改人姓名; 
+     * 
+ * + * required string last_updator_name = 7; + */ + public Builder clearLastUpdatorName() { + bitField0_ = (bitField0_ & ~0x00000040); + lastUpdatorName_ = getDefaultInstance().getLastUpdatorName(); + onChanged(); + return this; + } + /** + *
+     * 最后修改人姓名; 
+     * 
+ * + * required string last_updator_name = 7; + */ + public Builder setLastUpdatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + lastUpdatorName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.Version) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.Version) + private static final org.jigsaw.payment.Version DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Version(); + } + + public static org.jigsaw.payment.Version getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Version parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Version(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Version getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VersionOrBuilder.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VersionOrBuilder.java new file mode 100644 index 0000000..9b1e333 --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VersionOrBuilder.java @@ -0,0 +1,173 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: property.proto + +package org.jigsaw.payment; + +public interface VersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.Version) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   *版本号
+   * 
+ * + * required string version = 1; + */ + boolean hasVersion(); + /** + *
+   *版本号
+   * 
+ * + * required string version = 1; + */ + java.lang.String getVersion(); + /** + *
+   *版本号
+   * 
+ * + * required string version = 1; + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+   * 创建时间;
+   * 
+ * + * required int64 created_time = 2; + */ + boolean hasCreatedTime(); + /** + *
+   * 创建时间;
+   * 
+ * + * required int64 created_time = 2; + */ + long getCreatedTime(); + + /** + *
+   * 创建者id或者username。 
+   * 
+ * + * required string creator = 3; + */ + boolean hasCreator(); + /** + *
+   * 创建者id或者username。 
+   * 
+ * + * required string creator = 3; + */ + java.lang.String getCreator(); + /** + *
+   * 创建者id或者username。 
+   * 
+ * + * required string creator = 3; + */ + com.google.protobuf.ByteString + getCreatorBytes(); + + /** + *
+   * 创建者姓名; 
+   * 
+ * + * required string creator_name = 4; + */ + boolean hasCreatorName(); + /** + *
+   * 创建者姓名; 
+   * 
+ * + * required string creator_name = 4; + */ + java.lang.String getCreatorName(); + /** + *
+   * 创建者姓名; 
+   * 
+ * + * required string creator_name = 4; + */ + com.google.protobuf.ByteString + getCreatorNameBytes(); + + /** + *
+   * 最后修改时间;
+   * 
+ * + * required int64 last_updated = 5; + */ + boolean hasLastUpdated(); + /** + *
+   * 最后修改时间;
+   * 
+ * + * required int64 last_updated = 5; + */ + long getLastUpdated(); + + /** + *
+   * 最后修改人的标识,可以是Id,也可以是用户名等。 
+   * 
+ * + * required string last_updator = 6; + */ + boolean hasLastUpdator(); + /** + *
+   * 最后修改人的标识,可以是Id,也可以是用户名等。 
+   * 
+ * + * required string last_updator = 6; + */ + java.lang.String getLastUpdator(); + /** + *
+   * 最后修改人的标识,可以是Id,也可以是用户名等。 
+   * 
+ * + * required string last_updator = 6; + */ + com.google.protobuf.ByteString + getLastUpdatorBytes(); + + /** + *
+   * 最后修改人姓名; 
+   * 
+ * + * required string last_updator_name = 7; + */ + boolean hasLastUpdatorName(); + /** + *
+   * 最后修改人姓名; 
+   * 
+ * + * required string last_updator_name = 7; + */ + java.lang.String getLastUpdatorName(); + /** + *
+   * 最后修改人姓名; 
+   * 
+ * + * required string last_updator_name = 7; + */ + com.google.protobuf.ByteString + getLastUpdatorNameBytes(); +} diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Voucher.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Voucher.java new file mode 100644 index 0000000..2d8cbbc --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/Voucher.java @@ -0,0 +1,1291 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +/** + *
+ **
+ * 记账凭证
+ * 
+ * + * Protobuf type {@code org.jigsaw.payment.Voucher} + */ +public final class Voucher extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.Voucher) + VoucherOrBuilder { + // Use Voucher.newBuilder() to construct. + private Voucher(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Voucher() { + id_ = 0L; + recordingTime_ = 0L; + subjectId_ = 0L; + currency_ = 1; + debitAmount_ = 0L; + creditAmount_ = 0L; + originalId_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Voucher( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt64(); + break; + } + case 168: { + bitField0_ |= 0x00000002; + recordingTime_ = input.readInt64(); + break; + } + case 176: { + bitField0_ |= 0x00000004; + subjectId_ = input.readInt64(); + break; + } + case 184: { + int rawValue = input.readEnum(); + org.jigsaw.payment.Currency value = org.jigsaw.payment.Currency.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(23, rawValue); + } else { + bitField0_ |= 0x00000008; + currency_ = rawValue; + } + break; + } + case 192: { + bitField0_ |= 0x00000010; + debitAmount_ = input.readInt64(); + break; + } + case 200: { + bitField0_ |= 0x00000020; + creditAmount_ = input.readInt64(); + break; + } + case 208: { + bitField0_ |= 0x00000040; + originalId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Voucher_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Voucher_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Voucher.class, org.jigsaw.payment.Voucher.Builder.class); + } + + /** + *
+   **
+   * 凭证状态
+   * 
+ * + * Protobuf enum {@code org.jigsaw.payment.Voucher.Status} + */ + public enum Status + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     *已登记
+     * 
+ * + * RECORDED = 1; + */ + RECORDED(1), + /** + *
+     *已对账
+     * 
+ * + * CHECKED = 2; + */ + CHECKED(2), + ; + + /** + *
+     *已登记
+     * 
+ * + * RECORDED = 1; + */ + public static final int RECORDED_VALUE = 1; + /** + *
+     *已对账
+     * 
+ * + * CHECKED = 2; + */ + public static final int CHECKED_VALUE = 2; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Status valueOf(int value) { + return forNumber(value); + } + + public static Status forNumber(int value) { + switch (value) { + case 1: return RECORDED; + case 2: return CHECKED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Status findValueByNumber(int number) { + return Status.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jigsaw.payment.Voucher.getDescriptor().getEnumTypes().get(0); + } + + private static final Status[] VALUES = values(); + + public static Status valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jigsaw.payment.Voucher.Status) + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + *
+   *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+   * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+   *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+   * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int RECORDING_TIME_FIELD_NUMBER = 21; + private long recordingTime_; + /** + *
+   *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+   * 
+ * + * required int64 recording_time = 21; + */ + public boolean hasRecordingTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+   *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+   * 
+ * + * required int64 recording_time = 21; + */ + public long getRecordingTime() { + return recordingTime_; + } + + public static final int SUBJECT_ID_FIELD_NUMBER = 22; + private long subjectId_; + /** + *
+   *科目ID,这里必须是明细科目
+   * 
+ * + * required int64 subject_id = 22; + */ + public boolean hasSubjectId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+   *科目ID,这里必须是明细科目
+   * 
+ * + * required int64 subject_id = 22; + */ + public long getSubjectId() { + return subjectId_; + } + + public static final int CURRENCY_FIELD_NUMBER = 23; + private int currency_; + /** + *
+   *货币单位 
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + public boolean hasCurrency() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+   *货币单位 
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + public org.jigsaw.payment.Currency getCurrency() { + org.jigsaw.payment.Currency result = org.jigsaw.payment.Currency.valueOf(currency_); + return result == null ? org.jigsaw.payment.Currency.RMB : result; + } + + public static final int DEBIT_AMOUNT_FIELD_NUMBER = 24; + private long debitAmount_; + /** + *
+   * 贷方金额
+   * 
+ * + * required int64 debit_amount = 24; + */ + public boolean hasDebitAmount() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+   * 贷方金额
+   * 
+ * + * required int64 debit_amount = 24; + */ + public long getDebitAmount() { + return debitAmount_; + } + + public static final int CREDIT_AMOUNT_FIELD_NUMBER = 25; + private long creditAmount_; + /** + *
+   * 借方金额
+   * 
+ * + * required int64 credit_amount = 25; + */ + public boolean hasCreditAmount() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+   * 借方金额
+   * 
+ * + * required int64 credit_amount = 25; + */ + public long getCreditAmount() { + return creditAmount_; + } + + public static final int ORIGINAL_ID_FIELD_NUMBER = 26; + private long originalId_; + /** + *
+   * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+   * 
+ * + * required int64 original_id = 26; + */ + public boolean hasOriginalId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+   * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+   * 
+ * + * required int64 original_id = 26; + */ + public long getOriginalId() { + return originalId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRecordingTime()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasSubjectId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCurrency()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasDebitAmount()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCreditAmount()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOriginalId()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(21, recordingTime_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(22, subjectId_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeEnum(23, currency_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt64(24, debitAmount_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt64(25, creditAmount_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt64(26, originalId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(21, recordingTime_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(22, subjectId_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(23, currency_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(24, debitAmount_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(25, creditAmount_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(26, originalId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Voucher)) { + return super.equals(obj); + } + org.jigsaw.payment.Voucher other = (org.jigsaw.payment.Voucher) obj; + + boolean result = true; + result = result && (hasId() == other.hasId()); + if (hasId()) { + result = result && (getId() + == other.getId()); + } + result = result && (hasRecordingTime() == other.hasRecordingTime()); + if (hasRecordingTime()) { + result = result && (getRecordingTime() + == other.getRecordingTime()); + } + result = result && (hasSubjectId() == other.hasSubjectId()); + if (hasSubjectId()) { + result = result && (getSubjectId() + == other.getSubjectId()); + } + result = result && (hasCurrency() == other.hasCurrency()); + if (hasCurrency()) { + result = result && currency_ == other.currency_; + } + result = result && (hasDebitAmount() == other.hasDebitAmount()); + if (hasDebitAmount()) { + result = result && (getDebitAmount() + == other.getDebitAmount()); + } + result = result && (hasCreditAmount() == other.hasCreditAmount()); + if (hasCreditAmount()) { + result = result && (getCreditAmount() + == other.getCreditAmount()); + } + result = result && (hasOriginalId() == other.hasOriginalId()); + if (hasOriginalId()) { + result = result && (getOriginalId() + == other.getOriginalId()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + } + if (hasRecordingTime()) { + hash = (37 * hash) + RECORDING_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRecordingTime()); + } + if (hasSubjectId()) { + hash = (37 * hash) + SUBJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSubjectId()); + } + if (hasCurrency()) { + hash = (37 * hash) + CURRENCY_FIELD_NUMBER; + hash = (53 * hash) + currency_; + } + if (hasDebitAmount()) { + hash = (37 * hash) + DEBIT_AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDebitAmount()); + } + if (hasCreditAmount()) { + hash = (37 * hash) + CREDIT_AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreditAmount()); + } + if (hasOriginalId()) { + hash = (37 * hash) + ORIGINAL_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOriginalId()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Voucher parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Voucher parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Voucher parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Voucher parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Voucher parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Voucher parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Voucher parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Voucher parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Voucher parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Voucher parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Voucher parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Voucher parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Voucher prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   **
+   * 记账凭证
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.Voucher} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.Voucher) + org.jigsaw.payment.VoucherOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Voucher_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Voucher_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Voucher.class, org.jigsaw.payment.Voucher.Builder.class); + } + + // Construct using org.jigsaw.payment.Voucher.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + id_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + recordingTime_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + subjectId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + currency_ = 1; + bitField0_ = (bitField0_ & ~0x00000008); + debitAmount_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + creditAmount_ = 0L; + bitField0_ = (bitField0_ & ~0x00000020); + originalId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Entity.internal_static_org_jigsaw_payment_Voucher_descriptor; + } + + public org.jigsaw.payment.Voucher getDefaultInstanceForType() { + return org.jigsaw.payment.Voucher.getDefaultInstance(); + } + + public org.jigsaw.payment.Voucher build() { + org.jigsaw.payment.Voucher result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Voucher buildPartial() { + org.jigsaw.payment.Voucher result = new org.jigsaw.payment.Voucher(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.recordingTime_ = recordingTime_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.subjectId_ = subjectId_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.currency_ = currency_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.debitAmount_ = debitAmount_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.creditAmount_ = creditAmount_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.originalId_ = originalId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Voucher) { + return mergeFrom((org.jigsaw.payment.Voucher)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Voucher other) { + if (other == org.jigsaw.payment.Voucher.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasRecordingTime()) { + setRecordingTime(other.getRecordingTime()); + } + if (other.hasSubjectId()) { + setSubjectId(other.getSubjectId()); + } + if (other.hasCurrency()) { + setCurrency(other.getCurrency()); + } + if (other.hasDebitAmount()) { + setDebitAmount(other.getDebitAmount()); + } + if (other.hasCreditAmount()) { + setCreditAmount(other.getCreditAmount()); + } + if (other.hasOriginalId()) { + setOriginalId(other.getOriginalId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + if (!hasRecordingTime()) { + return false; + } + if (!hasSubjectId()) { + return false; + } + if (!hasCurrency()) { + return false; + } + if (!hasDebitAmount()) { + return false; + } + if (!hasCreditAmount()) { + return false; + } + if (!hasOriginalId()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Voucher parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Voucher) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
+     *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+     * 
+ * + * required int64 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+     * 
+ * + * required int64 id = 1; + */ + public long getId() { + return id_; + } + /** + *
+     *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+     * 
+ * + * required int64 id = 1; + */ + public Builder setId(long value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + *
+     *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+     * 
+ * + * required int64 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private long recordingTime_ ; + /** + *
+     *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+     * 
+ * + * required int64 recording_time = 21; + */ + public boolean hasRecordingTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+     * 
+ * + * required int64 recording_time = 21; + */ + public long getRecordingTime() { + return recordingTime_; + } + /** + *
+     *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+     * 
+ * + * required int64 recording_time = 21; + */ + public Builder setRecordingTime(long value) { + bitField0_ |= 0x00000002; + recordingTime_ = value; + onChanged(); + return this; + } + /** + *
+     *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+     * 
+ * + * required int64 recording_time = 21; + */ + public Builder clearRecordingTime() { + bitField0_ = (bitField0_ & ~0x00000002); + recordingTime_ = 0L; + onChanged(); + return this; + } + + private long subjectId_ ; + /** + *
+     *科目ID,这里必须是明细科目
+     * 
+ * + * required int64 subject_id = 22; + */ + public boolean hasSubjectId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     *科目ID,这里必须是明细科目
+     * 
+ * + * required int64 subject_id = 22; + */ + public long getSubjectId() { + return subjectId_; + } + /** + *
+     *科目ID,这里必须是明细科目
+     * 
+ * + * required int64 subject_id = 22; + */ + public Builder setSubjectId(long value) { + bitField0_ |= 0x00000004; + subjectId_ = value; + onChanged(); + return this; + } + /** + *
+     *科目ID,这里必须是明细科目
+     * 
+ * + * required int64 subject_id = 22; + */ + public Builder clearSubjectId() { + bitField0_ = (bitField0_ & ~0x00000004); + subjectId_ = 0L; + onChanged(); + return this; + } + + private int currency_ = 1; + /** + *
+     *货币单位 
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + public boolean hasCurrency() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     *货币单位 
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + public org.jigsaw.payment.Currency getCurrency() { + org.jigsaw.payment.Currency result = org.jigsaw.payment.Currency.valueOf(currency_); + return result == null ? org.jigsaw.payment.Currency.RMB : result; + } + /** + *
+     *货币单位 
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + public Builder setCurrency(org.jigsaw.payment.Currency value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + currency_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     *货币单位 
+     * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + public Builder clearCurrency() { + bitField0_ = (bitField0_ & ~0x00000008); + currency_ = 1; + onChanged(); + return this; + } + + private long debitAmount_ ; + /** + *
+     * 贷方金额
+     * 
+ * + * required int64 debit_amount = 24; + */ + public boolean hasDebitAmount() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * 贷方金额
+     * 
+ * + * required int64 debit_amount = 24; + */ + public long getDebitAmount() { + return debitAmount_; + } + /** + *
+     * 贷方金额
+     * 
+ * + * required int64 debit_amount = 24; + */ + public Builder setDebitAmount(long value) { + bitField0_ |= 0x00000010; + debitAmount_ = value; + onChanged(); + return this; + } + /** + *
+     * 贷方金额
+     * 
+ * + * required int64 debit_amount = 24; + */ + public Builder clearDebitAmount() { + bitField0_ = (bitField0_ & ~0x00000010); + debitAmount_ = 0L; + onChanged(); + return this; + } + + private long creditAmount_ ; + /** + *
+     * 借方金额
+     * 
+ * + * required int64 credit_amount = 25; + */ + public boolean hasCreditAmount() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     * 借方金额
+     * 
+ * + * required int64 credit_amount = 25; + */ + public long getCreditAmount() { + return creditAmount_; + } + /** + *
+     * 借方金额
+     * 
+ * + * required int64 credit_amount = 25; + */ + public Builder setCreditAmount(long value) { + bitField0_ |= 0x00000020; + creditAmount_ = value; + onChanged(); + return this; + } + /** + *
+     * 借方金额
+     * 
+ * + * required int64 credit_amount = 25; + */ + public Builder clearCreditAmount() { + bitField0_ = (bitField0_ & ~0x00000020); + creditAmount_ = 0L; + onChanged(); + return this; + } + + private long originalId_ ; + /** + *
+     * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+     * 
+ * + * required int64 original_id = 26; + */ + public boolean hasOriginalId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+     * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+     * 
+ * + * required int64 original_id = 26; + */ + public long getOriginalId() { + return originalId_; + } + /** + *
+     * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+     * 
+ * + * required int64 original_id = 26; + */ + public Builder setOriginalId(long value) { + bitField0_ |= 0x00000040; + originalId_ = value; + onChanged(); + return this; + } + /** + *
+     * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+     * 
+ * + * required int64 original_id = 26; + */ + public Builder clearOriginalId() { + bitField0_ = (bitField0_ & ~0x00000040); + originalId_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.Voucher) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.Voucher) + private static final org.jigsaw.payment.Voucher DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Voucher(); + } + + public static org.jigsaw.payment.Voucher getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Voucher parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Voucher(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Voucher getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VoucherOrBuilder.java b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VoucherOrBuilder.java new file mode 100644 index 0000000..d45d54c --- /dev/null +++ b/jigsaw-payment-schema/src/main/gen/org/jigsaw/payment/VoucherOrBuilder.java @@ -0,0 +1,128 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: entity.proto + +package org.jigsaw.payment; + +public interface VoucherOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.Voucher) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+   * 
+ * + * required int64 id = 1; + */ + boolean hasId(); + /** + *
+   *凭证号, 这是记账凭证的标识, 反映经济活动发生的顺序,编号必须连续,不能有重号、漏号。
+   * 
+ * + * required int64 id = 1; + */ + long getId(); + + /** + *
+   *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+   * 
+ * + * required int64 recording_time = 21; + */ + boolean hasRecordingTime(); + /** + *
+   *凭证登记时间,凭证日期必须随着凭证号增加而增加;
+   * 
+ * + * required int64 recording_time = 21; + */ + long getRecordingTime(); + + /** + *
+   *科目ID,这里必须是明细科目
+   * 
+ * + * required int64 subject_id = 22; + */ + boolean hasSubjectId(); + /** + *
+   *科目ID,这里必须是明细科目
+   * 
+ * + * required int64 subject_id = 22; + */ + long getSubjectId(); + + /** + *
+   *货币单位 
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + boolean hasCurrency(); + /** + *
+   *货币单位 
+   * 
+ * + * required .org.jigsaw.payment.Currency currency = 23; + */ + org.jigsaw.payment.Currency getCurrency(); + + /** + *
+   * 贷方金额
+   * 
+ * + * required int64 debit_amount = 24; + */ + boolean hasDebitAmount(); + /** + *
+   * 贷方金额
+   * 
+ * + * required int64 debit_amount = 24; + */ + long getDebitAmount(); + + /** + *
+   * 借方金额
+   * 
+ * + * required int64 credit_amount = 25; + */ + boolean hasCreditAmount(); + /** + *
+   * 借方金额
+   * 
+ * + * required int64 credit_amount = 25; + */ + long getCreditAmount(); + + /** + *
+   * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+   * 
+ * + * required int64 original_id = 26; + */ + boolean hasOriginalId(); + /** + *
+   * 原始凭证号,线上流水使用交易流水号作为原始凭证号;
+   * 
+ * + * required int64 original_id = 26; + */ + long getOriginalId(); +} diff --git a/jigsaw-rpc-example-client/src/main/gen/org/jigsaw/payment/Hello.java b/jigsaw-rpc-example-client/src/main/gen/org/jigsaw/payment/Hello.java new file mode 100644 index 0000000..090bcfc --- /dev/null +++ b/jigsaw-rpc-example-client/src/main/gen/org/jigsaw/payment/Hello.java @@ -0,0 +1,3500 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: hello.proto + +package org.jigsaw.payment; + +public final class Hello { + private Hello() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface UserOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.User) + com.google.protobuf.MessageOrBuilder { + + /** + * required string name = 1; + */ + boolean hasName(); + /** + * required string name = 1; + */ + java.lang.String getName(); + /** + * required string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * required string password = 2; + */ + boolean hasPassword(); + /** + * required string password = 2; + */ + java.lang.String getPassword(); + /** + * required string password = 2; + */ + com.google.protobuf.ByteString + getPasswordBytes(); + } + /** + * Protobuf type {@code org.jigsaw.payment.User} + */ + public static final class User extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.User) + UserOrBuilder { + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private User() { + name_ = ""; + password_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private User( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + password_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.User.class, org.jigsaw.payment.Hello.User.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private volatile java.lang.Object password_; + /** + * required string password = 2; + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string password = 2; + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + password_ = s; + } + return s; + } + } + /** + * required string password = 2; + */ + public com.google.protobuf.ByteString + getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPassword()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.User)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.User other = (org.jigsaw.payment.Hello.User) obj; + + boolean result = true; + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName() + .equals(other.getName()); + } + result = result && (hasPassword() == other.hasPassword()); + if (hasPassword()) { + result = result && getPassword() + .equals(other.getPassword()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasPassword()) { + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.User parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.User parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.User parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.User parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.User parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jigsaw.payment.User} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.User) + org.jigsaw.payment.Hello.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.User.class, org.jigsaw.payment.Hello.User.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.User.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + password_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_descriptor; + } + + public org.jigsaw.payment.Hello.User getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.User.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.User build() { + org.jigsaw.payment.Hello.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.User buildPartial() { + org.jigsaw.payment.Hello.User result = new org.jigsaw.payment.Hello.User(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.password_ = password_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.User) { + return mergeFrom((org.jigsaw.payment.Hello.User)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.User other) { + if (other == org.jigsaw.payment.Hello.User.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasPassword()) { + bitField0_ |= 0x00000002; + password_ = other.password_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + return false; + } + if (!hasPassword()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.User parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.User) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * required string password = 2; + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string password = 2; + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + password_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string password = 2; + */ + public com.google.protobuf.ByteString + getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string password = 2; + */ + public Builder setPassword( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + password_ = value; + onChanged(); + return this; + } + /** + * required string password = 2; + */ + public Builder clearPassword() { + bitField0_ = (bitField0_ & ~0x00000002); + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * required string password = 2; + */ + public Builder setPasswordBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + password_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.User) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.User) + private static final org.jigsaw.payment.Hello.User DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.User(); + } + + public static org.jigsaw.payment.Hello.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new User(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HelloResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.HelloResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required string message = 1; + */ + boolean hasMessage(); + /** + * required string message = 1; + */ + java.lang.String getMessage(); + /** + * required string message = 1; + */ + com.google.protobuf.ByteString + getMessageBytes(); + } + /** + *
+   * Proto for return type of methods defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloResponse} + */ + public static final class HelloResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.HelloResponse) + HelloResponseOrBuilder { + // Use HelloResponse.newBuilder() to construct. + private HelloResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HelloResponse() { + message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HelloResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + message_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloResponse.class, org.jigsaw.payment.Hello.HelloResponse.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMessage()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.HelloResponse)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.HelloResponse other = (org.jigsaw.payment.Hello.HelloResponse) obj; + + boolean result = true; + result = result && (hasMessage() == other.hasMessage()); + if (hasMessage()) { + result = result && getMessage() + .equals(other.getMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.HelloResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for return type of methods defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.HelloResponse) + org.jigsaw.payment.Hello.HelloResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloResponse.class, org.jigsaw.payment.Hello.HelloResponse.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.HelloResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + message_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_descriptor; + } + + public org.jigsaw.payment.Hello.HelloResponse getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.HelloResponse.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.HelloResponse build() { + org.jigsaw.payment.Hello.HelloResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.HelloResponse buildPartial() { + org.jigsaw.payment.Hello.HelloResponse result = new org.jigsaw.payment.Hello.HelloResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.message_ = message_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.HelloResponse) { + return mergeFrom((org.jigsaw.payment.Hello.HelloResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.HelloResponse other) { + if (other == org.jigsaw.payment.Hello.HelloResponse.getDefaultInstance()) return this; + if (other.hasMessage()) { + bitField0_ |= 0x00000001; + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMessage()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.HelloResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.HelloResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object message_ = ""; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string message = 1; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000001); + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.HelloResponse) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.HelloResponse) + private static final org.jigsaw.payment.Hello.HelloResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.HelloResponse(); + } + + public static org.jigsaw.payment.Hello.HelloResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public HelloResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HelloResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.HelloResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HelloRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.HelloRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * required string name = 1; + */ + boolean hasName(); + /** + * required string name = 1; + */ + java.lang.String getName(); + /** + * required string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * optional .org.jigsaw.payment.User user = 2; + */ + boolean hasUser(); + /** + * optional .org.jigsaw.payment.User user = 2; + */ + org.jigsaw.payment.Hello.User getUser(); + /** + * optional .org.jigsaw.payment.User user = 2; + */ + org.jigsaw.payment.Hello.UserOrBuilder getUserOrBuilder(); + } + /** + *
+   * Proto for setMetadata method defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloRequest} + */ + public static final class HelloRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.HelloRequest) + HelloRequestOrBuilder { + // Use HelloRequest.newBuilder() to construct. + private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HelloRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HelloRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 18: { + org.jigsaw.payment.Hello.User.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = user_.toBuilder(); + } + user_ = input.readMessage(org.jigsaw.payment.Hello.User.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(user_); + user_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloRequest.class, org.jigsaw.payment.Hello.HelloRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private org.jigsaw.payment.Hello.User user_; + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.User getUser() { + return user_ == null ? org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.UserOrBuilder getUserOrBuilder() { + return user_ == null ? org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasUser()) { + if (!getUser().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getUser()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.HelloRequest)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.HelloRequest other = (org.jigsaw.payment.Hello.HelloRequest) obj; + + boolean result = true; + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName() + .equals(other.getName()); + } + result = result && (hasUser() == other.hasUser()); + if (hasUser()) { + result = result && getUser() + .equals(other.getUser()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.HelloRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for setMetadata method defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.HelloRequest) + org.jigsaw.payment.Hello.HelloRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloRequest.class, org.jigsaw.payment.Hello.HelloRequest.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.HelloRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getUserFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (userBuilder_ == null) { + user_ = null; + } else { + userBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_descriptor; + } + + public org.jigsaw.payment.Hello.HelloRequest getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.HelloRequest.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.HelloRequest build() { + org.jigsaw.payment.Hello.HelloRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.HelloRequest buildPartial() { + org.jigsaw.payment.Hello.HelloRequest result = new org.jigsaw.payment.Hello.HelloRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (userBuilder_ == null) { + result.user_ = user_; + } else { + result.user_ = userBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.HelloRequest) { + return mergeFrom((org.jigsaw.payment.Hello.HelloRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.HelloRequest other) { + if (other == org.jigsaw.payment.Hello.HelloRequest.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + return false; + } + if (hasUser()) { + if (!getUser().isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.HelloRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.HelloRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private org.jigsaw.payment.Hello.User user_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Hello.User, org.jigsaw.payment.Hello.User.Builder, org.jigsaw.payment.Hello.UserOrBuilder> userBuilder_; + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder setUser(org.jigsaw.payment.Hello.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + onChanged(); + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder setUser( + org.jigsaw.payment.Hello.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + onChanged(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder mergeUser(org.jigsaw.payment.Hello.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + user_ != null && + user_ != org.jigsaw.payment.Hello.User.getDefaultInstance()) { + user_ = + org.jigsaw.payment.Hello.User.newBuilder(user_).mergeFrom(value).buildPartial(); + } else { + user_ = value; + } + onChanged(); + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder clearUser() { + if (userBuilder_ == null) { + user_ = null; + onChanged(); + } else { + userBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Hello.User, org.jigsaw.payment.Hello.User.Builder, org.jigsaw.payment.Hello.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Hello.User, org.jigsaw.payment.Hello.User.Builder, org.jigsaw.payment.Hello.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.HelloRequest) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.HelloRequest) + private static final org.jigsaw.payment.Hello.HelloRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.HelloRequest(); + } + + public static org.jigsaw.payment.Hello.HelloRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public HelloRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HelloRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.HelloRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FooResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.FooResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required string message = 1; + */ + boolean hasMessage(); + /** + * required string message = 1; + */ + java.lang.String getMessage(); + /** + * required string message = 1; + */ + com.google.protobuf.ByteString + getMessageBytes(); + } + /** + *
+   * Proto for return type of methods defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooResponse} + */ + public static final class FooResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.FooResponse) + FooResponseOrBuilder { + // Use FooResponse.newBuilder() to construct. + private FooResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FooResponse() { + message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FooResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + message_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooResponse.class, org.jigsaw.payment.Hello.FooResponse.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMessage()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.FooResponse)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.FooResponse other = (org.jigsaw.payment.Hello.FooResponse) obj; + + boolean result = true; + result = result && (hasMessage() == other.hasMessage()); + if (hasMessage()) { + result = result && getMessage() + .equals(other.getMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.FooResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for return type of methods defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.FooResponse) + org.jigsaw.payment.Hello.FooResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooResponse.class, org.jigsaw.payment.Hello.FooResponse.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.FooResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + message_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_descriptor; + } + + public org.jigsaw.payment.Hello.FooResponse getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.FooResponse.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.FooResponse build() { + org.jigsaw.payment.Hello.FooResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.FooResponse buildPartial() { + org.jigsaw.payment.Hello.FooResponse result = new org.jigsaw.payment.Hello.FooResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.message_ = message_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.FooResponse) { + return mergeFrom((org.jigsaw.payment.Hello.FooResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.FooResponse other) { + if (other == org.jigsaw.payment.Hello.FooResponse.getDefaultInstance()) return this; + if (other.hasMessage()) { + bitField0_ |= 0x00000001; + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMessage()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.FooResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.FooResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object message_ = ""; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string message = 1; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000001); + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.FooResponse) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.FooResponse) + private static final org.jigsaw.payment.Hello.FooResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.FooResponse(); + } + + public static org.jigsaw.payment.Hello.FooResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public FooResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FooResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.FooResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FooRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.FooRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * required string first = 1; + */ + boolean hasFirst(); + /** + * required string first = 1; + */ + java.lang.String getFirst(); + /** + * required string first = 1; + */ + com.google.protobuf.ByteString + getFirstBytes(); + + /** + * required string second = 2; + */ + boolean hasSecond(); + /** + * required string second = 2; + */ + java.lang.String getSecond(); + /** + * required string second = 2; + */ + com.google.protobuf.ByteString + getSecondBytes(); + } + /** + *
+   * Proto for setMetadata method defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooRequest} + */ + public static final class FooRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.FooRequest) + FooRequestOrBuilder { + // Use FooRequest.newBuilder() to construct. + private FooRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FooRequest() { + first_ = ""; + second_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FooRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + first_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + second_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooRequest.class, org.jigsaw.payment.Hello.FooRequest.Builder.class); + } + + private int bitField0_; + public static final int FIRST_FIELD_NUMBER = 1; + private volatile java.lang.Object first_; + /** + * required string first = 1; + */ + public boolean hasFirst() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string first = 1; + */ + public java.lang.String getFirst() { + java.lang.Object ref = first_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + first_ = s; + } + return s; + } + } + /** + * required string first = 1; + */ + public com.google.protobuf.ByteString + getFirstBytes() { + java.lang.Object ref = first_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + first_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECOND_FIELD_NUMBER = 2; + private volatile java.lang.Object second_; + /** + * required string second = 2; + */ + public boolean hasSecond() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string second = 2; + */ + public java.lang.String getSecond() { + java.lang.Object ref = second_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + second_ = s; + } + return s; + } + } + /** + * required string second = 2; + */ + public com.google.protobuf.ByteString + getSecondBytes() { + java.lang.Object ref = second_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + second_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasFirst()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasSecond()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, first_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, second_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, first_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, second_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.FooRequest)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.FooRequest other = (org.jigsaw.payment.Hello.FooRequest) obj; + + boolean result = true; + result = result && (hasFirst() == other.hasFirst()); + if (hasFirst()) { + result = result && getFirst() + .equals(other.getFirst()); + } + result = result && (hasSecond() == other.hasSecond()); + if (hasSecond()) { + result = result && getSecond() + .equals(other.getSecond()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFirst()) { + hash = (37 * hash) + FIRST_FIELD_NUMBER; + hash = (53 * hash) + getFirst().hashCode(); + } + if (hasSecond()) { + hash = (37 * hash) + SECOND_FIELD_NUMBER; + hash = (53 * hash) + getSecond().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.FooRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for setMetadata method defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.FooRequest) + org.jigsaw.payment.Hello.FooRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooRequest.class, org.jigsaw.payment.Hello.FooRequest.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.FooRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + first_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + second_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_descriptor; + } + + public org.jigsaw.payment.Hello.FooRequest getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.FooRequest.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.FooRequest build() { + org.jigsaw.payment.Hello.FooRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.FooRequest buildPartial() { + org.jigsaw.payment.Hello.FooRequest result = new org.jigsaw.payment.Hello.FooRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.first_ = first_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.second_ = second_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.FooRequest) { + return mergeFrom((org.jigsaw.payment.Hello.FooRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.FooRequest other) { + if (other == org.jigsaw.payment.Hello.FooRequest.getDefaultInstance()) return this; + if (other.hasFirst()) { + bitField0_ |= 0x00000001; + first_ = other.first_; + onChanged(); + } + if (other.hasSecond()) { + bitField0_ |= 0x00000002; + second_ = other.second_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasFirst()) { + return false; + } + if (!hasSecond()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.FooRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.FooRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object first_ = ""; + /** + * required string first = 1; + */ + public boolean hasFirst() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string first = 1; + */ + public java.lang.String getFirst() { + java.lang.Object ref = first_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + first_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string first = 1; + */ + public com.google.protobuf.ByteString + getFirstBytes() { + java.lang.Object ref = first_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + first_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string first = 1; + */ + public Builder setFirst( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + first_ = value; + onChanged(); + return this; + } + /** + * required string first = 1; + */ + public Builder clearFirst() { + bitField0_ = (bitField0_ & ~0x00000001); + first_ = getDefaultInstance().getFirst(); + onChanged(); + return this; + } + /** + * required string first = 1; + */ + public Builder setFirstBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + first_ = value; + onChanged(); + return this; + } + + private java.lang.Object second_ = ""; + /** + * required string second = 2; + */ + public boolean hasSecond() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string second = 2; + */ + public java.lang.String getSecond() { + java.lang.Object ref = second_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + second_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string second = 2; + */ + public com.google.protobuf.ByteString + getSecondBytes() { + java.lang.Object ref = second_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + second_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string second = 2; + */ + public Builder setSecond( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + second_ = value; + onChanged(); + return this; + } + /** + * required string second = 2; + */ + public Builder clearSecond() { + bitField0_ = (bitField0_ & ~0x00000002); + second_ = getDefaultInstance().getSecond(); + onChanged(); + return this; + } + /** + * required string second = 2; + */ + public Builder setSecondBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + second_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.FooRequest) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.FooRequest) + private static final org.jigsaw.payment.Hello.FooRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.FooRequest(); + } + + public static org.jigsaw.payment.Hello.FooRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public FooRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FooRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.FooRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_User_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_User_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_HelloResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_HelloRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_FooResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_FooRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\013hello.proto\022\022org.jigsaw.payment\"&\n\004Use" + + "r\022\014\n\004name\030\001 \002(\t\022\020\n\010password\030\002 \002(\t\" \n\rHel" + + "loResponse\022\017\n\007message\030\001 \002(\t\"D\n\014HelloRequ" + + "est\022\014\n\004name\030\001 \002(\t\022&\n\004user\030\002 \001(\0132\030.org.ji" + + "gsaw.payment.User\"\036\n\013FooResponse\022\017\n\007mess" + + "age\030\001 \002(\t\"+\n\nFooRequest\022\r\n\005first\030\001 \002(\t\022\016" + + "\n\006second\030\002 \002(\t" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_org_jigsaw_payment_User_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_jigsaw_payment_User_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_User_descriptor, + new java.lang.String[] { "Name", "Password", }); + internal_static_org_jigsaw_payment_HelloResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_HelloResponse_descriptor, + new java.lang.String[] { "Message", }); + internal_static_org_jigsaw_payment_HelloRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_HelloRequest_descriptor, + new java.lang.String[] { "Name", "User", }); + internal_static_org_jigsaw_payment_FooResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_FooResponse_descriptor, + new java.lang.String[] { "Message", }); + internal_static_org_jigsaw_payment_FooRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_FooRequest_descriptor, + new java.lang.String[] { "First", "Second", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClient.java b/jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClient.java new file mode 100644 index 0000000..4fe31b4 --- /dev/null +++ b/jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClient.java @@ -0,0 +1,54 @@ +package org.jigsaw.payment.rpc.hello; + +import static org.junit.Assert.assertEquals; + +import org.jigsaw.payment.Hello; +import org.jigsaw.payment.rpc.sharder.RpcServiceClient; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +/** + * + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月8日 + */ +public class HelloClient extends RpcServiceClient { + + public void callHello() throws Exception { + String name = "Hello "; + // System.out.println("start request. "); + Hello.HelloRequest.Builder request = Hello.HelloRequest.newBuilder(); + request.setName(name); + Hello.User.Builder user = Hello.User.newBuilder(); + user.setName("hello"); + user.setPassword("hello"); + request.setUser(user.build()); + Hello.HelloResponse response = this.execute("hello", request.build(), + Hello.HelloResponse.class); + String message = response.getMessage(); + assertEquals(message, "Hello " + user.getName()); + } + + public void callFoo() throws Exception { + // System.out.println("start request. "); + Hello.FooRequest.Builder request = Hello.FooRequest.newBuilder(); + request.setFirst("foo"); + request.setSecond("bar"); + Hello.FooResponse response = this.execute("foo", request.build(), + Hello.FooResponse.class); + String message = response.getMessage(); + assertEquals(message, "Foo foo-bar"); + } + + public void run() throws Exception { + callHello(); + callFoo(); + } + + public static void main(String[] args) throws Exception { + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( + HelloClientConfig.class); + context.close(); + } + +} diff --git a/jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClientConfig.java b/jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClientConfig.java new file mode 100644 index 0000000..d29171e --- /dev/null +++ b/jigsaw-rpc-example-client/src/main/java/org/jigsaw/payment/rpc/hello/HelloClientConfig.java @@ -0,0 +1,104 @@ +/** + * + */ +package org.jigsaw.payment.rpc.hello; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.curator.RetryPolicy; +import org.apache.curator.framework.AuthInfo; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.api.ACLProvider; +import org.apache.curator.retry.BoundedExponentialBackoffRetry; +import org.apache.zookeeper.ZooDefs; +import org.apache.zookeeper.data.ACL; +import org.jigsaw.payment.rpc.register.DigestAuthInfo; +import org.jigsaw.payment.rpc.sharder.BasicTransportPool; +import org.jigsaw.payment.rpc.sharder.TransportManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; + +/** + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月7日 + */ +@Configuration +@PropertySource("classpath:hello.client.properties") +public class HelloClientConfig { + @Autowired + private Environment env; + + @Bean(name="hello-client", initMethod="run") + public HelloClient client(){ + HelloClient client = new HelloClient(); + client.setTransportManager(this.transportManager()); + return client; + } + + @Bean(initMethod="start", destroyMethod = "close") + public TransportManager transportManager(){ + BasicTransportPool pool = new BasicTransportPool(); + pool.setPath(env.getProperty("rpc.client.service.path")); + pool.setClient(this.curatorFramework()); + return pool; + } + + @Bean(initMethod = "start", destroyMethod = "close") + public CuratorFramework curatorFramework() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory + .builder(); + int sessionTimeoutMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.session.timeout.ms", "5000")); + int connectionTimeoutMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.connection.timeout.ms", "5000")); + builder.connectString( + env.getProperty("rpc.client.zookeeper.connect.string")) + .sessionTimeoutMs(sessionTimeoutMs) + .connectionTimeoutMs(connectionTimeoutMs) + .retryPolicy(this.retryPolicy()) + .aclProvider(this.aclProvider()).authorization(this.authInfo()); + return builder.build(); + } + + @Bean + public List authInfo() { + String username = env.getProperty("rpc.client.zookeeper.username"); + String password = env.getProperty("rpc.client.zookeeper.password"); + List info = new ArrayList(); + info.add(new DigestAuthInfo(username, password)); + return info; + } + + @Bean + public RetryPolicy retryPolicy() { + int baseSleepTimeMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.base.sleep.time.ms", "1000")); + int maxSleepTimeMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.max.sleep.time.ms", "5000")); + int maxRetries = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.max.retries", "29")); + return new BoundedExponentialBackoffRetry(baseSleepTimeMs, + maxSleepTimeMs, maxRetries); + } + + @Bean + public ACLProvider aclProvider() { + return new ACLProvider() { + @Override + public List getDefaultAcl() { + return ZooDefs.Ids.CREATOR_ALL_ACL; + } + + @Override + public List getAclForPath(String path) { + return ZooDefs.Ids.CREATOR_ALL_ACL; + } + }; + } +} diff --git a/jigsaw-rpc-example-client/src/main/resources/hello.client.properties b/jigsaw-rpc-example-client/src/main/resources/hello.client.properties new file mode 100644 index 0000000..e06b676 --- /dev/null +++ b/jigsaw-rpc-example-client/src/main/resources/hello.client.properties @@ -0,0 +1,10 @@ +#rpc settings +#min worker thread count; +rpc.server.min.worker.threads=200 +#max worker threads count; +rpc.server.max.worker.threads=2000 +rpc.client.zookeeper.connect.string=127.0.0.1:2181 +rpc.client.zookeeper.username= payment +rpc.client.zookeeper.password= 123456 +rpc.client.service.path=/payment/rpc/HelloService + diff --git a/jigsaw-rpc-example-client/src/main/resources/hello.proto b/jigsaw-rpc-example-client/src/main/resources/hello.proto new file mode 100644 index 0000000..fe30d60 --- /dev/null +++ b/jigsaw-rpc-example-client/src/main/resources/hello.proto @@ -0,0 +1,29 @@ +syntax = "proto2"; + +package org.jigsaw.payment; + +message User { + required string name = 1; + required string password = 2; +} +// Proto for return type of methods defined in hello.thrift +message HelloResponse { + required string message = 1; +} + +// Proto for setMetadata method defined in hello.thrift +message HelloRequest { + required string name = 1; + optional User user = 2; + } + + // Proto for return type of methods defined in hello.thrift +message FooResponse { + required string message = 1; +} + +// Proto for setMetadata method defined in hello.thrift +message FooRequest { + required string first = 1; + required string second = 2; + } \ No newline at end of file diff --git a/jigsaw-rpc-example-client/src/main/resources/log4j.properties b/jigsaw-rpc-example-client/src/main/resources/log4j.properties new file mode 100644 index 0000000..4bf9cd9 --- /dev/null +++ b/jigsaw-rpc-example-client/src/main/resources/log4j.properties @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------------ +# +# The following properties set the logging levels and log appender. The +# log4j.rootCategory variable defines the default log level and one or more +# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. +# +# To override the default (rootCategory) log level, define a property of the +# form (see below for available values): +# +# log4j.logger. = +# +# Available logger names: +# TODO +# +# Possible Log Levels: +# FATAL, ERROR, WARN, INFO, DEBUG +# +#------------------------------------------------------------------------------ +# log4j.rootCategory = info, Console +#------------------------------------------------------------------------------ +# +# The following properties configure the Daily Rolling File appender for qipu exporter. +# +#------------------------------------------------------------------------------ +log4j.logger.org.jigsaw = debug, Console +log4j.logger.org.springframework = info, Console +log4j.logger.org.apache = error, Console + + +log4j.appender.Console = org.apache.log4j.ConsoleAppender +log4j.appender.Console.Threshold = DEBUG +log4j.appender.Console.Target = System.out +log4j.appender.Console.layout = org.apache.log4j.PatternLayout +log4j.appender.Console.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %c [%p] %m%n + + + diff --git a/jigsaw-thrift-protobuf/src/test/resources/logback-test.xml b/jigsaw-rpc-example-client/src/main/resources/logback-test.xml similarity index 64% rename from jigsaw-thrift-protobuf/src/test/resources/logback-test.xml rename to jigsaw-rpc-example-client/src/main/resources/logback-test.xml index dcbd7cb..d65419c 100644 --- a/jigsaw-thrift-protobuf/src/test/resources/logback-test.xml +++ b/jigsaw-rpc-example-client/src/main/resources/logback-test.xml @@ -3,10 +3,7 @@ - - - - + [%-5p] [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%C{1}:%M:%L] %m%n @@ -61,36 +58,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/jigsaw-rpc-example-server/src/main/gen/org/jigsaw/payment/Hello.java b/jigsaw-rpc-example-server/src/main/gen/org/jigsaw/payment/Hello.java new file mode 100644 index 0000000..090bcfc --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/gen/org/jigsaw/payment/Hello.java @@ -0,0 +1,3500 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: hello.proto + +package org.jigsaw.payment; + +public final class Hello { + private Hello() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface UserOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.User) + com.google.protobuf.MessageOrBuilder { + + /** + * required string name = 1; + */ + boolean hasName(); + /** + * required string name = 1; + */ + java.lang.String getName(); + /** + * required string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * required string password = 2; + */ + boolean hasPassword(); + /** + * required string password = 2; + */ + java.lang.String getPassword(); + /** + * required string password = 2; + */ + com.google.protobuf.ByteString + getPasswordBytes(); + } + /** + * Protobuf type {@code org.jigsaw.payment.User} + */ + public static final class User extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.User) + UserOrBuilder { + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private User() { + name_ = ""; + password_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private User( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + password_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.User.class, org.jigsaw.payment.Hello.User.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private volatile java.lang.Object password_; + /** + * required string password = 2; + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string password = 2; + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + password_ = s; + } + return s; + } + } + /** + * required string password = 2; + */ + public com.google.protobuf.ByteString + getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPassword()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.User)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.User other = (org.jigsaw.payment.Hello.User) obj; + + boolean result = true; + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName() + .equals(other.getName()); + } + result = result && (hasPassword() == other.hasPassword()); + if (hasPassword()) { + result = result && getPassword() + .equals(other.getPassword()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasPassword()) { + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.User parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.User parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.User parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.User parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.User parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jigsaw.payment.User} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.User) + org.jigsaw.payment.Hello.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.User.class, org.jigsaw.payment.Hello.User.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.User.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + password_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_User_descriptor; + } + + public org.jigsaw.payment.Hello.User getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.User.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.User build() { + org.jigsaw.payment.Hello.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.User buildPartial() { + org.jigsaw.payment.Hello.User result = new org.jigsaw.payment.Hello.User(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.password_ = password_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.User) { + return mergeFrom((org.jigsaw.payment.Hello.User)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.User other) { + if (other == org.jigsaw.payment.Hello.User.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasPassword()) { + bitField0_ |= 0x00000002; + password_ = other.password_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + return false; + } + if (!hasPassword()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.User parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.User) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * required string password = 2; + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string password = 2; + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + password_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string password = 2; + */ + public com.google.protobuf.ByteString + getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string password = 2; + */ + public Builder setPassword( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + password_ = value; + onChanged(); + return this; + } + /** + * required string password = 2; + */ + public Builder clearPassword() { + bitField0_ = (bitField0_ & ~0x00000002); + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * required string password = 2; + */ + public Builder setPasswordBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + password_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.User) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.User) + private static final org.jigsaw.payment.Hello.User DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.User(); + } + + public static org.jigsaw.payment.Hello.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new User(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HelloResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.HelloResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required string message = 1; + */ + boolean hasMessage(); + /** + * required string message = 1; + */ + java.lang.String getMessage(); + /** + * required string message = 1; + */ + com.google.protobuf.ByteString + getMessageBytes(); + } + /** + *
+   * Proto for return type of methods defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloResponse} + */ + public static final class HelloResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.HelloResponse) + HelloResponseOrBuilder { + // Use HelloResponse.newBuilder() to construct. + private HelloResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HelloResponse() { + message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HelloResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + message_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloResponse.class, org.jigsaw.payment.Hello.HelloResponse.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMessage()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.HelloResponse)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.HelloResponse other = (org.jigsaw.payment.Hello.HelloResponse) obj; + + boolean result = true; + result = result && (hasMessage() == other.hasMessage()); + if (hasMessage()) { + result = result && getMessage() + .equals(other.getMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.HelloResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for return type of methods defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.HelloResponse) + org.jigsaw.payment.Hello.HelloResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloResponse.class, org.jigsaw.payment.Hello.HelloResponse.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.HelloResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + message_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloResponse_descriptor; + } + + public org.jigsaw.payment.Hello.HelloResponse getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.HelloResponse.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.HelloResponse build() { + org.jigsaw.payment.Hello.HelloResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.HelloResponse buildPartial() { + org.jigsaw.payment.Hello.HelloResponse result = new org.jigsaw.payment.Hello.HelloResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.message_ = message_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.HelloResponse) { + return mergeFrom((org.jigsaw.payment.Hello.HelloResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.HelloResponse other) { + if (other == org.jigsaw.payment.Hello.HelloResponse.getDefaultInstance()) return this; + if (other.hasMessage()) { + bitField0_ |= 0x00000001; + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMessage()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.HelloResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.HelloResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object message_ = ""; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string message = 1; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000001); + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.HelloResponse) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.HelloResponse) + private static final org.jigsaw.payment.Hello.HelloResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.HelloResponse(); + } + + public static org.jigsaw.payment.Hello.HelloResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public HelloResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HelloResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.HelloResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HelloRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.HelloRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * required string name = 1; + */ + boolean hasName(); + /** + * required string name = 1; + */ + java.lang.String getName(); + /** + * required string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * optional .org.jigsaw.payment.User user = 2; + */ + boolean hasUser(); + /** + * optional .org.jigsaw.payment.User user = 2; + */ + org.jigsaw.payment.Hello.User getUser(); + /** + * optional .org.jigsaw.payment.User user = 2; + */ + org.jigsaw.payment.Hello.UserOrBuilder getUserOrBuilder(); + } + /** + *
+   * Proto for setMetadata method defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloRequest} + */ + public static final class HelloRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.HelloRequest) + HelloRequestOrBuilder { + // Use HelloRequest.newBuilder() to construct. + private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HelloRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HelloRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 18: { + org.jigsaw.payment.Hello.User.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = user_.toBuilder(); + } + user_ = input.readMessage(org.jigsaw.payment.Hello.User.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(user_); + user_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloRequest.class, org.jigsaw.payment.Hello.HelloRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private org.jigsaw.payment.Hello.User user_; + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.User getUser() { + return user_ == null ? org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.UserOrBuilder getUserOrBuilder() { + return user_ == null ? org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasUser()) { + if (!getUser().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getUser()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.HelloRequest)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.HelloRequest other = (org.jigsaw.payment.Hello.HelloRequest) obj; + + boolean result = true; + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName() + .equals(other.getName()); + } + result = result && (hasUser() == other.hasUser()); + if (hasUser()) { + result = result && getUser() + .equals(other.getUser()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.HelloRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.HelloRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for setMetadata method defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.HelloRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.HelloRequest) + org.jigsaw.payment.Hello.HelloRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.HelloRequest.class, org.jigsaw.payment.Hello.HelloRequest.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.HelloRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getUserFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (userBuilder_ == null) { + user_ = null; + } else { + userBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_HelloRequest_descriptor; + } + + public org.jigsaw.payment.Hello.HelloRequest getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.HelloRequest.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.HelloRequest build() { + org.jigsaw.payment.Hello.HelloRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.HelloRequest buildPartial() { + org.jigsaw.payment.Hello.HelloRequest result = new org.jigsaw.payment.Hello.HelloRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (userBuilder_ == null) { + result.user_ = user_; + } else { + result.user_ = userBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.HelloRequest) { + return mergeFrom((org.jigsaw.payment.Hello.HelloRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.HelloRequest other) { + if (other == org.jigsaw.payment.Hello.HelloRequest.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + return false; + } + if (hasUser()) { + if (!getUser().isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.HelloRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.HelloRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private org.jigsaw.payment.Hello.User user_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Hello.User, org.jigsaw.payment.Hello.User.Builder, org.jigsaw.payment.Hello.UserOrBuilder> userBuilder_; + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder setUser(org.jigsaw.payment.Hello.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + onChanged(); + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder setUser( + org.jigsaw.payment.Hello.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + onChanged(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder mergeUser(org.jigsaw.payment.Hello.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + user_ != null && + user_ != org.jigsaw.payment.Hello.User.getDefaultInstance()) { + user_ = + org.jigsaw.payment.Hello.User.newBuilder(user_).mergeFrom(value).buildPartial(); + } else { + user_ = value; + } + onChanged(); + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public Builder clearUser() { + if (userBuilder_ == null) { + user_ = null; + onChanged(); + } else { + userBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + public org.jigsaw.payment.Hello.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + org.jigsaw.payment.Hello.User.getDefaultInstance() : user_; + } + } + /** + * optional .org.jigsaw.payment.User user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Hello.User, org.jigsaw.payment.Hello.User.Builder, org.jigsaw.payment.Hello.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.jigsaw.payment.Hello.User, org.jigsaw.payment.Hello.User.Builder, org.jigsaw.payment.Hello.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.HelloRequest) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.HelloRequest) + private static final org.jigsaw.payment.Hello.HelloRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.HelloRequest(); + } + + public static org.jigsaw.payment.Hello.HelloRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public HelloRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HelloRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.HelloRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FooResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.FooResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required string message = 1; + */ + boolean hasMessage(); + /** + * required string message = 1; + */ + java.lang.String getMessage(); + /** + * required string message = 1; + */ + com.google.protobuf.ByteString + getMessageBytes(); + } + /** + *
+   * Proto for return type of methods defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooResponse} + */ + public static final class FooResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.FooResponse) + FooResponseOrBuilder { + // Use FooResponse.newBuilder() to construct. + private FooResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FooResponse() { + message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FooResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + message_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooResponse.class, org.jigsaw.payment.Hello.FooResponse.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMessage()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.FooResponse)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.FooResponse other = (org.jigsaw.payment.Hello.FooResponse) obj; + + boolean result = true; + result = result && (hasMessage() == other.hasMessage()); + if (hasMessage()) { + result = result && getMessage() + .equals(other.getMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.FooResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for return type of methods defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.FooResponse) + org.jigsaw.payment.Hello.FooResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooResponse.class, org.jigsaw.payment.Hello.FooResponse.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.FooResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + message_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooResponse_descriptor; + } + + public org.jigsaw.payment.Hello.FooResponse getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.FooResponse.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.FooResponse build() { + org.jigsaw.payment.Hello.FooResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.FooResponse buildPartial() { + org.jigsaw.payment.Hello.FooResponse result = new org.jigsaw.payment.Hello.FooResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.message_ = message_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.FooResponse) { + return mergeFrom((org.jigsaw.payment.Hello.FooResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.FooResponse other) { + if (other == org.jigsaw.payment.Hello.FooResponse.getDefaultInstance()) return this; + if (other.hasMessage()) { + bitField0_ |= 0x00000001; + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMessage()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.FooResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.FooResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object message_ = ""; + /** + * required string message = 1; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string message = 1; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string message = 1; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string message = 1; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000001); + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * required string message = 1; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.FooResponse) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.FooResponse) + private static final org.jigsaw.payment.Hello.FooResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.FooResponse(); + } + + public static org.jigsaw.payment.Hello.FooResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public FooResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FooResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.FooResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FooRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jigsaw.payment.FooRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * required string first = 1; + */ + boolean hasFirst(); + /** + * required string first = 1; + */ + java.lang.String getFirst(); + /** + * required string first = 1; + */ + com.google.protobuf.ByteString + getFirstBytes(); + + /** + * required string second = 2; + */ + boolean hasSecond(); + /** + * required string second = 2; + */ + java.lang.String getSecond(); + /** + * required string second = 2; + */ + com.google.protobuf.ByteString + getSecondBytes(); + } + /** + *
+   * Proto for setMetadata method defined in hello.thrift
+   * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooRequest} + */ + public static final class FooRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.jigsaw.payment.FooRequest) + FooRequestOrBuilder { + // Use FooRequest.newBuilder() to construct. + private FooRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FooRequest() { + first_ = ""; + second_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FooRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + first_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + second_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooRequest.class, org.jigsaw.payment.Hello.FooRequest.Builder.class); + } + + private int bitField0_; + public static final int FIRST_FIELD_NUMBER = 1; + private volatile java.lang.Object first_; + /** + * required string first = 1; + */ + public boolean hasFirst() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string first = 1; + */ + public java.lang.String getFirst() { + java.lang.Object ref = first_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + first_ = s; + } + return s; + } + } + /** + * required string first = 1; + */ + public com.google.protobuf.ByteString + getFirstBytes() { + java.lang.Object ref = first_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + first_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECOND_FIELD_NUMBER = 2; + private volatile java.lang.Object second_; + /** + * required string second = 2; + */ + public boolean hasSecond() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string second = 2; + */ + public java.lang.String getSecond() { + java.lang.Object ref = second_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + second_ = s; + } + return s; + } + } + /** + * required string second = 2; + */ + public com.google.protobuf.ByteString + getSecondBytes() { + java.lang.Object ref = second_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + second_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasFirst()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasSecond()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, first_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, second_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, first_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, second_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.jigsaw.payment.Hello.FooRequest)) { + return super.equals(obj); + } + org.jigsaw.payment.Hello.FooRequest other = (org.jigsaw.payment.Hello.FooRequest) obj; + + boolean result = true; + result = result && (hasFirst() == other.hasFirst()); + if (hasFirst()) { + result = result && getFirst() + .equals(other.getFirst()); + } + result = result && (hasSecond() == other.hasSecond()); + if (hasSecond()) { + result = result && getSecond() + .equals(other.getSecond()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFirst()) { + hash = (37 * hash) + FIRST_FIELD_NUMBER; + hash = (53 * hash) + getFirst().hashCode(); + } + if (hasSecond()) { + hash = (37 * hash) + SECOND_FIELD_NUMBER; + hash = (53 * hash) + getSecond().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.jigsaw.payment.Hello.FooRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.jigsaw.payment.Hello.FooRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for setMetadata method defined in hello.thrift
+     * 
+ * + * Protobuf type {@code org.jigsaw.payment.FooRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.jigsaw.payment.FooRequest) + org.jigsaw.payment.Hello.FooRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jigsaw.payment.Hello.FooRequest.class, org.jigsaw.payment.Hello.FooRequest.Builder.class); + } + + // Construct using org.jigsaw.payment.Hello.FooRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + first_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + second_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jigsaw.payment.Hello.internal_static_org_jigsaw_payment_FooRequest_descriptor; + } + + public org.jigsaw.payment.Hello.FooRequest getDefaultInstanceForType() { + return org.jigsaw.payment.Hello.FooRequest.getDefaultInstance(); + } + + public org.jigsaw.payment.Hello.FooRequest build() { + org.jigsaw.payment.Hello.FooRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jigsaw.payment.Hello.FooRequest buildPartial() { + org.jigsaw.payment.Hello.FooRequest result = new org.jigsaw.payment.Hello.FooRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.first_ = first_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.second_ = second_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jigsaw.payment.Hello.FooRequest) { + return mergeFrom((org.jigsaw.payment.Hello.FooRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jigsaw.payment.Hello.FooRequest other) { + if (other == org.jigsaw.payment.Hello.FooRequest.getDefaultInstance()) return this; + if (other.hasFirst()) { + bitField0_ |= 0x00000001; + first_ = other.first_; + onChanged(); + } + if (other.hasSecond()) { + bitField0_ |= 0x00000002; + second_ = other.second_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasFirst()) { + return false; + } + if (!hasSecond()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jigsaw.payment.Hello.FooRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jigsaw.payment.Hello.FooRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object first_ = ""; + /** + * required string first = 1; + */ + public boolean hasFirst() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string first = 1; + */ + public java.lang.String getFirst() { + java.lang.Object ref = first_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + first_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string first = 1; + */ + public com.google.protobuf.ByteString + getFirstBytes() { + java.lang.Object ref = first_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + first_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string first = 1; + */ + public Builder setFirst( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + first_ = value; + onChanged(); + return this; + } + /** + * required string first = 1; + */ + public Builder clearFirst() { + bitField0_ = (bitField0_ & ~0x00000001); + first_ = getDefaultInstance().getFirst(); + onChanged(); + return this; + } + /** + * required string first = 1; + */ + public Builder setFirstBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + first_ = value; + onChanged(); + return this; + } + + private java.lang.Object second_ = ""; + /** + * required string second = 2; + */ + public boolean hasSecond() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string second = 2; + */ + public java.lang.String getSecond() { + java.lang.Object ref = second_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + second_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string second = 2; + */ + public com.google.protobuf.ByteString + getSecondBytes() { + java.lang.Object ref = second_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + second_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string second = 2; + */ + public Builder setSecond( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + second_ = value; + onChanged(); + return this; + } + /** + * required string second = 2; + */ + public Builder clearSecond() { + bitField0_ = (bitField0_ & ~0x00000002); + second_ = getDefaultInstance().getSecond(); + onChanged(); + return this; + } + /** + * required string second = 2; + */ + public Builder setSecondBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + second_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.jigsaw.payment.FooRequest) + } + + // @@protoc_insertion_point(class_scope:org.jigsaw.payment.FooRequest) + private static final org.jigsaw.payment.Hello.FooRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.jigsaw.payment.Hello.FooRequest(); + } + + public static org.jigsaw.payment.Hello.FooRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public FooRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FooRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.jigsaw.payment.Hello.FooRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_User_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_User_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_HelloResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_HelloRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_FooResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_jigsaw_payment_FooRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\013hello.proto\022\022org.jigsaw.payment\"&\n\004Use" + + "r\022\014\n\004name\030\001 \002(\t\022\020\n\010password\030\002 \002(\t\" \n\rHel" + + "loResponse\022\017\n\007message\030\001 \002(\t\"D\n\014HelloRequ" + + "est\022\014\n\004name\030\001 \002(\t\022&\n\004user\030\002 \001(\0132\030.org.ji" + + "gsaw.payment.User\"\036\n\013FooResponse\022\017\n\007mess" + + "age\030\001 \002(\t\"+\n\nFooRequest\022\r\n\005first\030\001 \002(\t\022\016" + + "\n\006second\030\002 \002(\t" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_org_jigsaw_payment_User_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_jigsaw_payment_User_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_User_descriptor, + new java.lang.String[] { "Name", "Password", }); + internal_static_org_jigsaw_payment_HelloResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_jigsaw_payment_HelloResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_HelloResponse_descriptor, + new java.lang.String[] { "Message", }); + internal_static_org_jigsaw_payment_HelloRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_jigsaw_payment_HelloRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_HelloRequest_descriptor, + new java.lang.String[] { "Name", "User", }); + internal_static_org_jigsaw_payment_FooResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_org_jigsaw_payment_FooResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_FooResponse_descriptor, + new java.lang.String[] { "Message", }); + internal_static_org_jigsaw_payment_FooRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_org_jigsaw_payment_FooRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_jigsaw_payment_FooRequest_descriptor, + new java.lang.String[] { "First", "Second", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/config/HelloClientConfig.java b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/config/HelloClientConfig.java new file mode 100644 index 0000000..96dcf5e --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/config/HelloClientConfig.java @@ -0,0 +1,112 @@ +/** + * + */ +package org.jigsaw.payment.rpc.config; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.curator.RetryPolicy; +import org.apache.curator.framework.AuthInfo; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.api.ACLProvider; +import org.apache.curator.retry.BoundedExponentialBackoffRetry; +import org.apache.zookeeper.ZooDefs; +import org.apache.zookeeper.data.ACL; +import org.jigsaw.payment.rpc.register.DigestAuthInfo; +import org.jigsaw.payment.rpc.server.PidRecorder; +import org.jigsaw.payment.rpc.sharder.BasicTransportPool; +import org.jigsaw.payment.rpc.sharder.TransportManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; + +/** + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月7日 + */ +@Configuration +@PropertySource("classpath:hello.client.properties") +public class HelloClientConfig { + @Autowired + private Environment env; + + @Bean + public PidRecorder pidRecorder() { + return new PidRecorder(); + } + + @Bean(name="transport-pool",destroyMethod = "close") + public TransportManager transportManager(){ + BasicTransportPool pool = new BasicTransportPool(); + pool.setClient(this.curatorFramework()); + pool.setPath(env.getProperty("rpc.client.service.path")); + return pool; + } + + @Bean(initMethod = "start", destroyMethod = "close") + @Lazy(false) + public CuratorFramework curatorFramework() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory + .builder(); + int sessionTimeoutMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.session.timeout.ms", "5000")); + int connectionTimeoutMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.connection.timeout.ms", "5000")); + builder.connectString( + env.getProperty("rpc.client.zookeeper.connect.string")) + .sessionTimeoutMs(sessionTimeoutMs) + .connectionTimeoutMs(connectionTimeoutMs) + + .retryPolicy(this.retryPolicy()); + //.aclProvider(this.aclProvider()).authorization(this.authInfo()); + return builder.build(); + } + + public List authInfo() { + String username = env.getProperty("rpc.client.zookeeper.username"); + String password = env.getProperty("rpc.client.zookeeper.password"); + List info = new ArrayList(); + info.add(new DigestAuthInfo(username, password)); + return info; + } + + + + + public RetryPolicy retryPolicy() { + /** + * int baseSleepTimeMs, int maxSleepTimeMs, int maxRetries + **/ + int baseSleepTimeMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.base.sleep.time.ms", "1000")); + int maxSleepTimeMs = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.max.sleep.time.ms", "5000")); + int maxRetries = Integer.parseInt(env.getProperty( + "rpc.client.zookeeper.max.retries", "29")); + return new BoundedExponentialBackoffRetry(baseSleepTimeMs, + maxSleepTimeMs, maxRetries); + } + + + public ACLProvider aclProvider() { + return new ACLProvider() { + @Override + public List getDefaultAcl() { + return ZooDefs.Ids.CREATOR_ALL_ACL; + } + + @Override + public List getAclForPath(String path) { + return ZooDefs.Ids.CREATOR_ALL_ACL; + } + }; + } +} diff --git a/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/FooController.java b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/FooController.java new file mode 100644 index 0000000..89ea8d0 --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/FooController.java @@ -0,0 +1,28 @@ +/** + * + */ +package org.jigsaw.payment.rpc.hello.server; + +import org.apache.thrift.TException; +import org.jigsaw.payment.Hello; +import org.jigsaw.payment.rpc.server.Controller; +import org.springframework.stereotype.Component; + +/** + * @author root + * + */ +@Component("foo") +public class FooController implements + Controller { + + @Override + public Hello.FooResponse process(Hello.FooRequest request) + throws TException { + Hello.FooResponse.Builder response = Hello.FooResponse.newBuilder(); + response.setMessage("Foo " + request.getFirst() + "-" + + request.getSecond()); + return response.build(); + } + +} diff --git a/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloController.java b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloController.java new file mode 100644 index 0000000..5e764ca --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloController.java @@ -0,0 +1,27 @@ +package org.jigsaw.payment.rpc.hello.server; + +import org.apache.thrift.TException; +import org.jigsaw.payment.Hello; +import org.jigsaw.payment.Hello.HelloRequest; +import org.jigsaw.payment.Hello.HelloResponse; +import org.jigsaw.payment.rpc.server.Controller; +import org.springframework.stereotype.Component; +/** + * + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月8日 + */ +@Component("hello") +public class HelloController implements Controller{ + + + @Override + public HelloResponse process(HelloRequest request) throws TException { + HelloResponse.Builder builder = HelloResponse.newBuilder(); + builder.setMessage("Hello " + request.getUser().getName()); + return builder.build(); + } + + +} diff --git a/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServer.java b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServer.java new file mode 100644 index 0000000..9123a12 --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServer.java @@ -0,0 +1,20 @@ +/** + * + */ +package org.jigsaw.payment.rpc.hello.server; + +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +/** + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月8日 + */ +public class HelloServer { + + public static void main(String[] args){ + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(HelloServerConfig.class); + context.close(); + } + +} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/config/RpcServerAutoConfiguration.java b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServerConfig.java similarity index 74% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/config/RpcServerAutoConfiguration.java rename to jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServerConfig.java index aae6bab..bcc3920 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/config/RpcServerAutoConfiguration.java +++ b/jigsaw-rpc-example-server/src/main/java/org/jigsaw/payment/rpc/hello/server/HelloServerConfig.java @@ -1,16 +1,13 @@ -/******************************************************* - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of Knowlege Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - *******************************************************/ -package com.qiyi.knowledge.thrift.config; +/** + * + */ +package org.jigsaw.payment.rpc.hello.server; -import com.qiyi.knowledge.thrift.register.DigestAuthInfo; -import com.qiyi.knowledge.thrift.register.RpcPayload; -import com.qiyi.knowledge.thrift.server.ServerRunner; -import com.qiyi.knowledge.thrift.server.TProtobufProcessor; -import com.qiyi.knowledge.thrift.utils.IpPortUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import org.apache.curator.RetryPolicy; import org.apache.curator.framework.AuthInfo; @@ -24,7 +21,6 @@ import org.apache.curator.x.discovery.ServiceInstance; import org.apache.curator.x.discovery.ServiceInstanceBuilder; import org.apache.curator.x.discovery.UriSpec; import org.apache.curator.x.discovery.details.InstanceSerializer; -import org.apache.curator.x.discovery.details.JsonInstanceSerializer; import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.server.TServer; @@ -34,23 +30,28 @@ import org.apache.thrift.transport.TServerTransport; import org.apache.thrift.transport.TTransportFactory; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.data.ACL; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jigsaw.payment.rpc.register.DigestAuthInfo; +import org.jigsaw.payment.rpc.register.JsonSerializer; +import org.jigsaw.payment.rpc.register.RpcPayload; +import org.jigsaw.payment.rpc.server.IpPortResolver; +import org.jigsaw.payment.rpc.server.ServerRunner; +import org.jigsaw.payment.rpc.server.TProtobufProcessor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - - +/** + * @author root + * + */ @Configuration -public class RpcServerAutoConfiguration { - Logger LOG = LoggerFactory.getLogger(RpcServerAutoConfiguration.class); +@ComponentScan("org.jigsaw.payment.rpc.hello") +@PropertySource("classpath:hello.server.properties") +public class HelloServerConfig { + @Autowired private Environment env; @@ -59,12 +60,10 @@ public class RpcServerAutoConfiguration { return new TProtobufProcessor(); } - public InstanceSerializer serializer() { - return new JsonInstanceSerializer(RpcPayload.class); + return new JsonSerializer(); } - public RpcPayload payload() { RpcPayload payload = new RpcPayload(); payload.setMaxQps(env.getProperty("rpc.server.max.qps", Long.class, @@ -76,7 +75,6 @@ public class RpcServerAutoConfiguration { return payload; } - public ACLProvider aclProvider() { return new ACLProvider() { @Override @@ -91,7 +89,6 @@ public class RpcServerAutoConfiguration { }; } - public List authInfo() { String username = env.getProperty("rpc.server.zookeeper.username"); String password = env.getProperty("rpc.server.zookeeper.password"); @@ -100,14 +97,13 @@ public class RpcServerAutoConfiguration { return info; } - public RetryPolicy retryPolicy() { int baseSleepTimeMs = Integer.parseInt(env.getProperty( "rpc.server.zookeeper.base.sleep.time.ms", "1000")); int maxSleepTimeMs = Integer.parseInt(env.getProperty( "rpc.server.zookeeper.max.sleep.time.ms", "5000")); int maxRetries = Integer.parseInt(env.getProperty( - "rpc.server.zookeeper.max.retries", "50")); + "rpc.server.zookeeper.max.retries", "29")); return new BoundedExponentialBackoffRetry(baseSleepTimeMs, maxSleepTimeMs, maxRetries); } @@ -118,11 +114,15 @@ public class RpcServerAutoConfiguration { .builder() .connectString( env.getProperty("rpc.server.zookeeper.connect.string")) - .sessionTimeoutMs(50000) - .connectionTimeoutMs(50000) - .retryPolicy(this.retryPolicy()) - .aclProvider(this.aclProvider()) - .authorization(this.authInfo()) + .sessionTimeoutMs( + Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.session.timeout.ms", + "10000"))) + .connectionTimeoutMs( + Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.connection.timeout.ms", + "10000"))).retryPolicy(this.retryPolicy()) + .aclProvider(this.aclProvider()).authorization(this.authInfo()) .build(); } @@ -131,10 +131,8 @@ public class RpcServerAutoConfiguration { ServiceInstanceBuilder instance = ServiceInstance.builder(); instance.name(env.getProperty("rpc.server.service.name")) .uriSpec(new UriSpec(env.getProperty("rpc.server.uri.spec"))) - .payload(this.payload()) - .port(this.port()) - .id(this.instanceId()) - .address(this.ip()); + .payload(this.payload()).port(this.port()) + .id(this.instanceId()).address(this.ip()); return instance.build(); } @@ -142,9 +140,8 @@ public class RpcServerAutoConfiguration { return env.getProperty("rpc.server.port", Integer.class); } - public String ip() { - return (env.getProperty("rpc.server.ip") == null) ? IpPortUtil + return (env.getProperty("rpc.server.ip") == null) ? new IpPortResolver() .getIpV4Address() : env.getProperty("rpc.server.ip"); } @@ -172,24 +169,22 @@ public class RpcServerAutoConfiguration { } @Bean(name = "rpc-register") - public ServiceDiscovery serviceDiscovery(CuratorFramework curatorFramework) throws Exception { + public ServiceDiscovery serviceDiscovery() throws Exception { ServiceDiscoveryBuilder builder = ServiceDiscoveryBuilder .builder(RpcPayload.class); - return builder - .client(curatorFramework) + return builder.client(this.curatorFramework()) .basePath(env.getProperty("rpc.server.service.path")) .serializer(this.serializer()) .thisInstance(this.serviceInstance()).build(); } - - @Bean(name = "server-runner", destroyMethod="stop") - public ServerRunner serverRunner(CuratorFramework curatorFramework,ServiceDiscovery serviceDiscovery) throws Exception { + @Bean(name = "server-runner", initMethod="start", destroyMethod = "stop") + public ServerRunner serverRunner() throws Exception { return ServerRunner .newBuilder() .server(this.poolServer()) - .curatorFramework(curatorFramework) - .serviceDiscovery(serviceDiscovery) + .curatorFramework(this.curatorFramework()) + .serviceDiscovery(this.serviceDiscovery()) .zookeeperDeferRegisterPeriod( env.getProperty("rpc.server.zookeeper.register.delay", Integer.class, 2000)) diff --git a/jigsaw-rpc-example-server/src/main/resources/hello.proto b/jigsaw-rpc-example-server/src/main/resources/hello.proto new file mode 100644 index 0000000..fe30d60 --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/resources/hello.proto @@ -0,0 +1,29 @@ +syntax = "proto2"; + +package org.jigsaw.payment; + +message User { + required string name = 1; + required string password = 2; +} +// Proto for return type of methods defined in hello.thrift +message HelloResponse { + required string message = 1; +} + +// Proto for setMetadata method defined in hello.thrift +message HelloRequest { + required string name = 1; + optional User user = 2; + } + + // Proto for return type of methods defined in hello.thrift +message FooResponse { + required string message = 1; +} + +// Proto for setMetadata method defined in hello.thrift +message FooRequest { + required string first = 1; + required string second = 2; + } \ No newline at end of file diff --git a/jigsaw-rpc-example-server/src/main/resources/hello.server.properties b/jigsaw-rpc-example-server/src/main/resources/hello.server.properties new file mode 100644 index 0000000..ee70195 --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/resources/hello.server.properties @@ -0,0 +1,14 @@ +#rpc settings +#min worker thread count; +rpc.server.min.worker.threads=200 +#max worker threads count; +rpc.server.max.worker.threads=2000 + +rpc.server.zookeeper.connect.string=127.0.0.1:2181 +rpc.server.zookeeper.username= payment +rpc.server.zookeeper.password= 123456 +rpc.server.service.path=/payment/rpc + +rpc.server.uri.spec={scheme}://{address}:{port} +rpc.server.port = 9001 +rpc.server.service.name = HelloService \ No newline at end of file diff --git a/jigsaw-rpc-example-server/src/main/resources/log4j.properties b/jigsaw-rpc-example-server/src/main/resources/log4j.properties new file mode 100644 index 0000000..bde7a7b --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/resources/log4j.properties @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------------ +# +# The following properties set the logging levels and log appender. The +# log4j.rootCategory variable defines the default log level and one or more +# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. +# +# To override the default (rootCategory) log level, define a property of the +# form (see below for available values): +# +# log4j.logger. = +# +# Available logger names: +# TODO +# +# Possible Log Levels: +# FATAL, ERROR, WARN, INFO, DEBUG +# +#------------------------------------------------------------------------------ +# log4j.rootCategory = info, Console +#------------------------------------------------------------------------------ +# +# The following properties configure the Daily Rolling File appender for qipu exporter. +# +#------------------------------------------------------------------------------ +log4j.logger.org.jigsaw.payment = debug, Console +log4j.logger.org.springframework = info, Console +log4j.logger.org.apache = error, Console + + +log4j.appender.Console = org.apache.log4j.ConsoleAppender +log4j.appender.Console.Threshold = DEBUG +log4j.appender.Console.Target = System.out +log4j.appender.Console.layout = org.apache.log4j.PatternLayout +log4j.appender.Console.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %c [%p] %m%n + + + diff --git a/jigsaw-rpc-example-server/src/main/resources/logback-test.xml b/jigsaw-rpc-example-server/src/main/resources/logback-test.xml new file mode 100644 index 0000000..3b023c5 --- /dev/null +++ b/jigsaw-rpc-example-server/src/main/resources/logback-test.xml @@ -0,0 +1,68 @@ + + + + + + + + [%-5p] [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%C{1}:%M:%L] %m%n + + + + + ${log_path}/app.log + + ${log_path}/app.log.%d{yyyy-MM-dd_HH} + + + [%-5p] [%d{yyyy-MM-dd HH:mm:ss}] [%C{1}:%M:%L] %m%n + + + + + + [%-5p] [%d{yyyy-MM-dd HH:mm:ss}] [%C{1}:%M:%L] %m%n + + + ERROR + + ${log_path}/error.log + + ${log_path}/error.log.%d{yyyy-MM-dd_HH} + 30 + 80GB + + + + + + 0 + + 512 + + true + + + + + + + + + 0 + + 512 + + true + + + + + + + + + + + + diff --git a/jigsaw-thrift-protobuf/src/conf/deployment.yml b/jigsaw-thrift-protobuf/src/conf/deployment.yml deleted file mode 100644 index 5bad5a8..0000000 --- a/jigsaw-thrift-protobuf/src/conf/deployment.yml +++ /dev/null @@ -1,53 +0,0 @@ - -################################################## -# 部署环境信息 -# name :项目名称,必填,示例: name: pay-web-frontend -# hosts :部署服务器IP/hostname列表,选填,需要部署到服务器的必填, 示例: -# hosts: -# - 10.10.0.1 -# - 10.10.0.2 -# app_type:应用类型,必填,可选值: -# java: java 应用,无需容器,直接使用java -cp classpath xxx运行 -# web : 需要依赖web容器如tomcat运行,缺省项 -# jar : 组件,会部署到maven仓库中 -# pom : 组件,会部署到maven仓库中 -# 缺省值:web,示例: app_type: web -# context_path:部署运行contextpath,当app_type=web需要,必须以/开头,缺省为:/${name},示例: context_path: /pay-web-frontend -# -# main_class: 运行的main方法的类class名称,选填,app_type为java时填写,如果填写了该值,将在部署时添加自动启动相关脚本 bootstrap.sh/startup.sh/shutdown.sh,程序可以不用在再添加 -# 示例: main_class: com.iqiyi.pay.account.Server -# -################################################## - -################ -# 基础信息 -################ -name: pay-common-rpc -#context_path: /pay-web-operation -app_type: jar - - -################ -# 生产环境 -################ -#prod: -# hosts: -# -# - 10.110.23.24 -# - 10.110.23.25 -# - 10.110.23.26 -# - 10.110.23.34 -# -################# -## 测试环境 -################# -#test: -# hosts: -# - 10.16.83.223 -# -################# -## 开发环境 -################# -#dev: -# hosts: -# - 10.16.82.127 \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/BaseService.java b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/BaseService.java new file mode 100644 index 0000000..b8eca0a --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/BaseService.java @@ -0,0 +1,1344 @@ +/** + * Autogenerated by Thrift Compiler (0.10.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.jigsaw.payment.rpc; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-08") +public class BaseService { + + /** + * 这个类定义通用的Protobuf作为Protocol的服务 + * + */ + public interface Iface { + + /** + * * 通用的execute服务。 + * * + * + * @param request + */ + public java.nio.ByteBuffer execute(java.nio.ByteBuffer request) throws NotFoundException, SystemException, UserException, org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void execute(java.nio.ByteBuffer request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public java.nio.ByteBuffer execute(java.nio.ByteBuffer request) throws NotFoundException, SystemException, UserException, org.apache.thrift.TException + { + send_execute(request); + return recv_execute(); + } + + public void send_execute(java.nio.ByteBuffer request) throws org.apache.thrift.TException + { + execute_args args = new execute_args(); + args.setRequest(request); + sendBase("execute", args); + } + + public java.nio.ByteBuffer recv_execute() throws NotFoundException, SystemException, UserException, org.apache.thrift.TException + { + execute_result result = new execute_result(); + receiveBase(result, "execute"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.notFoundException != null) { + throw result.notFoundException; + } + if (result.systemException != null) { + throw result.systemException; + } + if (result.userException != null) { + throw result.userException; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void execute(java.nio.ByteBuffer request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + execute_call method_call = new execute_call(request, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class execute_call extends org.apache.thrift.async.TAsyncMethodCall { + private java.nio.ByteBuffer request; + public execute_call(java.nio.ByteBuffer request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.request = request; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("execute", org.apache.thrift.protocol.TMessageType.CALL, 0)); + execute_args args = new execute_args(); + args.setRequest(request); + args.write(prot); + prot.writeMessageEnd(); + } + + public java.nio.ByteBuffer getResult() throws NotFoundException, SystemException, UserException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_execute(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new java.util.HashMap>())); + } + + protected Processor(I iface, java.util.Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static java.util.Map> getProcessMap(java.util.Map> processMap) { + processMap.put("execute", new execute()); + return processMap; + } + + public static class execute extends org.apache.thrift.ProcessFunction { + public execute() { + super("execute"); + } + + public execute_args getEmptyArgsInstance() { + return new execute_args(); + } + + protected boolean isOneway() { + return false; + } + + public execute_result getResult(I iface, execute_args args) throws org.apache.thrift.TException { + execute_result result = new execute_result(); + try { + result.success = iface.execute(args.request); + } catch (NotFoundException notFoundException) { + result.notFoundException = notFoundException; + } catch (SystemException systemException) { + result.systemException = systemException; + } catch (UserException userException) { + result.userException = userException; + } + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new java.util.HashMap>())); + } + + protected AsyncProcessor(I iface, java.util.Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static java.util.Map> getProcessMap(java.util.Map> processMap) { + processMap.put("execute", new execute()); + return processMap; + } + + public static class execute extends org.apache.thrift.AsyncProcessFunction { + public execute() { + super("execute"); + } + + public execute_args getEmptyArgsInstance() { + return new execute_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(java.nio.ByteBuffer o) { + execute_result result = new execute_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + execute_result result = new execute_result(); + if (e instanceof NotFoundException) { + result.notFoundException = (NotFoundException) e; + result.setNotFoundExceptionIsSet(true); + msg = result; + } else if (e instanceof SystemException) { + result.systemException = (SystemException) e; + result.setSystemExceptionIsSet(true); + msg = result; + } else if (e instanceof UserException) { + result.userException = (UserException) e; + result.setUserExceptionIsSet(true); + msg = result; + } else if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, execute_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.execute(args.request,resultHandler); + } + } + + } + + public static class execute_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_args"); + + private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new execute_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new execute_argsTupleSchemeFactory(); + + public java.nio.ByteBuffer request; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + REQUEST((short)1, "request"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // REQUEST + return REQUEST; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_args.class, metaDataMap); + } + + public execute_args() { + } + + public execute_args( + java.nio.ByteBuffer request) + { + this(); + this.request = org.apache.thrift.TBaseHelper.copyBinary(request); + } + + /** + * Performs a deep copy on other. + */ + public execute_args(execute_args other) { + if (other.isSetRequest()) { + this.request = org.apache.thrift.TBaseHelper.copyBinary(other.request); + } + } + + public execute_args deepCopy() { + return new execute_args(this); + } + + @Override + public void clear() { + this.request = null; + } + + public byte[] getRequest() { + setRequest(org.apache.thrift.TBaseHelper.rightSize(request)); + return request == null ? null : request.array(); + } + + public java.nio.ByteBuffer bufferForRequest() { + return org.apache.thrift.TBaseHelper.copyBinary(request); + } + + public execute_args setRequest(byte[] request) { + this.request = request == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(request.clone()); + return this; + } + + public execute_args setRequest(java.nio.ByteBuffer request) { + this.request = org.apache.thrift.TBaseHelper.copyBinary(request); + return this; + } + + public void unsetRequest() { + this.request = null; + } + + /** Returns true if field request is set (has been assigned a value) and false otherwise */ + public boolean isSetRequest() { + return this.request != null; + } + + public void setRequestIsSet(boolean value) { + if (!value) { + this.request = null; + } + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case REQUEST: + if (value == null) { + unsetRequest(); + } else { + if (value instanceof byte[]) { + setRequest((byte[])value); + } else { + setRequest((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQUEST: + return getRequest(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQUEST: + return isSetRequest(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof execute_args) + return this.equals((execute_args)that); + return false; + } + + public boolean equals(execute_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_request = true && this.isSetRequest(); + boolean that_present_request = true && that.isSetRequest(); + if (this_present_request || that_present_request) { + if (!(this_present_request && that_present_request)) + return false; + if (!this.request.equals(that.request)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); + if (isSetRequest()) + hashCode = hashCode * 8191 + request.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(execute_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequest()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("execute_args("); + boolean first = true; + + sb.append("request:"); + if (this.request == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.request, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class execute_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public execute_argsStandardScheme getScheme() { + return new execute_argsStandardScheme(); + } + } + + private static class execute_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // REQUEST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.request = iprot.readBinary(); + struct.setRequestIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.request != null) { + oprot.writeFieldBegin(REQUEST_FIELD_DESC); + oprot.writeBinary(struct.request); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public execute_argsTupleScheme getScheme() { + return new execute_argsTupleScheme(); + } + } + + private static class execute_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetRequest()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetRequest()) { + oprot.writeBinary(struct.request); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.request = iprot.readBinary(); + struct.setRequestIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class execute_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField NOT_FOUND_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("notFoundException", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField SYSTEM_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("systemException", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField USER_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("userException", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new execute_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new execute_resultTupleSchemeFactory(); + + public java.nio.ByteBuffer success; // required + public NotFoundException notFoundException; // required + public SystemException systemException; // required + public UserException userException; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + NOT_FOUND_EXCEPTION((short)1, "notFoundException"), + SYSTEM_EXCEPTION((short)2, "systemException"), + USER_EXCEPTION((short)3, "userException"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // NOT_FOUND_EXCEPTION + return NOT_FOUND_EXCEPTION; + case 2: // SYSTEM_EXCEPTION + return SYSTEM_EXCEPTION; + case 3: // USER_EXCEPTION + return USER_EXCEPTION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.NOT_FOUND_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("notFoundException", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NotFoundException.class))); + tmpMap.put(_Fields.SYSTEM_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("systemException", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SystemException.class))); + tmpMap.put(_Fields.USER_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("userException", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserException.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_result.class, metaDataMap); + } + + public execute_result() { + } + + public execute_result( + java.nio.ByteBuffer success, + NotFoundException notFoundException, + SystemException systemException, + UserException userException) + { + this(); + this.success = org.apache.thrift.TBaseHelper.copyBinary(success); + this.notFoundException = notFoundException; + this.systemException = systemException; + this.userException = userException; + } + + /** + * Performs a deep copy on other. + */ + public execute_result(execute_result other) { + if (other.isSetSuccess()) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); + } + if (other.isSetNotFoundException()) { + this.notFoundException = new NotFoundException(other.notFoundException); + } + if (other.isSetSystemException()) { + this.systemException = new SystemException(other.systemException); + } + if (other.isSetUserException()) { + this.userException = new UserException(other.userException); + } + } + + public execute_result deepCopy() { + return new execute_result(this); + } + + @Override + public void clear() { + this.success = null; + this.notFoundException = null; + this.systemException = null; + this.userException = null; + } + + public byte[] getSuccess() { + setSuccess(org.apache.thrift.TBaseHelper.rightSize(success)); + return success == null ? null : success.array(); + } + + public java.nio.ByteBuffer bufferForSuccess() { + return org.apache.thrift.TBaseHelper.copyBinary(success); + } + + public execute_result setSuccess(byte[] success) { + this.success = success == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(success.clone()); + return this; + } + + public execute_result setSuccess(java.nio.ByteBuffer success) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(success); + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public NotFoundException getNotFoundException() { + return this.notFoundException; + } + + public execute_result setNotFoundException(NotFoundException notFoundException) { + this.notFoundException = notFoundException; + return this; + } + + public void unsetNotFoundException() { + this.notFoundException = null; + } + + /** Returns true if field notFoundException is set (has been assigned a value) and false otherwise */ + public boolean isSetNotFoundException() { + return this.notFoundException != null; + } + + public void setNotFoundExceptionIsSet(boolean value) { + if (!value) { + this.notFoundException = null; + } + } + + public SystemException getSystemException() { + return this.systemException; + } + + public execute_result setSystemException(SystemException systemException) { + this.systemException = systemException; + return this; + } + + public void unsetSystemException() { + this.systemException = null; + } + + /** Returns true if field systemException is set (has been assigned a value) and false otherwise */ + public boolean isSetSystemException() { + return this.systemException != null; + } + + public void setSystemExceptionIsSet(boolean value) { + if (!value) { + this.systemException = null; + } + } + + public UserException getUserException() { + return this.userException; + } + + public execute_result setUserException(UserException userException) { + this.userException = userException; + return this; + } + + public void unsetUserException() { + this.userException = null; + } + + /** Returns true if field userException is set (has been assigned a value) and false otherwise */ + public boolean isSetUserException() { + return this.userException != null; + } + + public void setUserExceptionIsSet(boolean value) { + if (!value) { + this.userException = null; + } + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + if (value instanceof byte[]) { + setSuccess((byte[])value); + } else { + setSuccess((java.nio.ByteBuffer)value); + } + } + break; + + case NOT_FOUND_EXCEPTION: + if (value == null) { + unsetNotFoundException(); + } else { + setNotFoundException((NotFoundException)value); + } + break; + + case SYSTEM_EXCEPTION: + if (value == null) { + unsetSystemException(); + } else { + setSystemException((SystemException)value); + } + break; + + case USER_EXCEPTION: + if (value == null) { + unsetUserException(); + } else { + setUserException((UserException)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case NOT_FOUND_EXCEPTION: + return getNotFoundException(); + + case SYSTEM_EXCEPTION: + return getSystemException(); + + case USER_EXCEPTION: + return getUserException(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case NOT_FOUND_EXCEPTION: + return isSetNotFoundException(); + case SYSTEM_EXCEPTION: + return isSetSystemException(); + case USER_EXCEPTION: + return isSetUserException(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof execute_result) + return this.equals((execute_result)that); + return false; + } + + public boolean equals(execute_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_notFoundException = true && this.isSetNotFoundException(); + boolean that_present_notFoundException = true && that.isSetNotFoundException(); + if (this_present_notFoundException || that_present_notFoundException) { + if (!(this_present_notFoundException && that_present_notFoundException)) + return false; + if (!this.notFoundException.equals(that.notFoundException)) + return false; + } + + boolean this_present_systemException = true && this.isSetSystemException(); + boolean that_present_systemException = true && that.isSetSystemException(); + if (this_present_systemException || that_present_systemException) { + if (!(this_present_systemException && that_present_systemException)) + return false; + if (!this.systemException.equals(that.systemException)) + return false; + } + + boolean this_present_userException = true && this.isSetUserException(); + boolean that_present_userException = true && that.isSetUserException(); + if (this_present_userException || that_present_userException) { + if (!(this_present_userException && that_present_userException)) + return false; + if (!this.userException.equals(that.userException)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNotFoundException()) ? 131071 : 524287); + if (isSetNotFoundException()) + hashCode = hashCode * 8191 + notFoundException.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSystemException()) ? 131071 : 524287); + if (isSetSystemException()) + hashCode = hashCode * 8191 + systemException.hashCode(); + + hashCode = hashCode * 8191 + ((isSetUserException()) ? 131071 : 524287); + if (isSetUserException()) + hashCode = hashCode * 8191 + userException.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(execute_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNotFoundException()).compareTo(other.isSetNotFoundException()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNotFoundException()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notFoundException, other.notFoundException); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSystemException()).compareTo(other.isSetSystemException()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSystemException()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.systemException, other.systemException); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetUserException()).compareTo(other.isSetUserException()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserException()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userException, other.userException); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("execute_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.success, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("notFoundException:"); + if (this.notFoundException == null) { + sb.append("null"); + } else { + sb.append(this.notFoundException); + } + first = false; + if (!first) sb.append(", "); + sb.append("systemException:"); + if (this.systemException == null) { + sb.append("null"); + } else { + sb.append(this.systemException); + } + first = false; + if (!first) sb.append(", "); + sb.append("userException:"); + if (this.userException == null) { + sb.append("null"); + } else { + sb.append(this.userException); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class execute_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public execute_resultStandardScheme getScheme() { + return new execute_resultStandardScheme(); + } + } + + private static class execute_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readBinary(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // NOT_FOUND_EXCEPTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.notFoundException = new NotFoundException(); + struct.notFoundException.read(iprot); + struct.setNotFoundExceptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SYSTEM_EXCEPTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.systemException = new SystemException(); + struct.systemException.read(iprot); + struct.setSystemExceptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // USER_EXCEPTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.userException = new UserException(); + struct.userException.read(iprot); + struct.setUserExceptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBinary(struct.success); + oprot.writeFieldEnd(); + } + if (struct.notFoundException != null) { + oprot.writeFieldBegin(NOT_FOUND_EXCEPTION_FIELD_DESC); + struct.notFoundException.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.systemException != null) { + oprot.writeFieldBegin(SYSTEM_EXCEPTION_FIELD_DESC); + struct.systemException.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.userException != null) { + oprot.writeFieldBegin(USER_EXCEPTION_FIELD_DESC); + struct.userException.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public execute_resultTupleScheme getScheme() { + return new execute_resultTupleScheme(); + } + } + + private static class execute_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetNotFoundException()) { + optionals.set(1); + } + if (struct.isSetSystemException()) { + optionals.set(2); + } + if (struct.isSetUserException()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + oprot.writeBinary(struct.success); + } + if (struct.isSetNotFoundException()) { + struct.notFoundException.write(oprot); + } + if (struct.isSetSystemException()) { + struct.systemException.write(oprot); + } + if (struct.isSetUserException()) { + struct.userException.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.success = iprot.readBinary(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.notFoundException = new NotFoundException(); + struct.notFoundException.read(iprot); + struct.setNotFoundExceptionIsSet(true); + } + if (incoming.get(2)) { + struct.systemException = new SystemException(); + struct.systemException.read(iprot); + struct.setSystemExceptionIsSet(true); + } + if (incoming.get(3)) { + struct.userException = new UserException(); + struct.userException.read(iprot); + struct.setUserExceptionIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + +} diff --git a/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/NotFoundException.java b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/NotFoundException.java new file mode 100644 index 0000000..5f25f06 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/NotFoundException.java @@ -0,0 +1,489 @@ +/** + * Autogenerated by Thrift Compiler (0.10.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.jigsaw.payment.rpc; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +/** + * This exception is thrown by EDAM procedures when a caller asks to perform + * an operation on an object that does not exist. This may be thrown based on an invalid + * primary identifier (e.g. a bad GUID), or when the caller refers to an object + * by another unique identifier (e.g. a User's email address). + * + * identifier: A description of the object that was not found on the server. + * For example, "Note.notebookGuid" when a caller attempts to create a note in a + * notebook that does not exist in the user's account. + * + * key: The value passed from the client in the identifier, which was not + * found. For example, the GUID that was not found. + */ +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-08") +public class NotFoundException extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NotFoundException"); + + private static final org.apache.thrift.protocol.TField IDENTIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("identifier", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new NotFoundExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new NotFoundExceptionTupleSchemeFactory(); + + public java.lang.String identifier; // optional + public java.lang.String key; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IDENTIFIER((short)1, "identifier"), + KEY((short)2, "key"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // IDENTIFIER + return IDENTIFIER; + case 2: // KEY + return KEY; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.IDENTIFIER,_Fields.KEY}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("identifier", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NotFoundException.class, metaDataMap); + } + + public NotFoundException() { + } + + /** + * Performs a deep copy on other. + */ + public NotFoundException(NotFoundException other) { + if (other.isSetIdentifier()) { + this.identifier = other.identifier; + } + if (other.isSetKey()) { + this.key = other.key; + } + } + + public NotFoundException deepCopy() { + return new NotFoundException(this); + } + + @Override + public void clear() { + this.identifier = null; + this.key = null; + } + + public java.lang.String getIdentifier() { + return this.identifier; + } + + public NotFoundException setIdentifier(java.lang.String identifier) { + this.identifier = identifier; + return this; + } + + public void unsetIdentifier() { + this.identifier = null; + } + + /** Returns true if field identifier is set (has been assigned a value) and false otherwise */ + public boolean isSetIdentifier() { + return this.identifier != null; + } + + public void setIdentifierIsSet(boolean value) { + if (!value) { + this.identifier = null; + } + } + + public java.lang.String getKey() { + return this.key; + } + + public NotFoundException setKey(java.lang.String key) { + this.key = key; + return this; + } + + public void unsetKey() { + this.key = null; + } + + /** Returns true if field key is set (has been assigned a value) and false otherwise */ + public boolean isSetKey() { + return this.key != null; + } + + public void setKeyIsSet(boolean value) { + if (!value) { + this.key = null; + } + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case IDENTIFIER: + if (value == null) { + unsetIdentifier(); + } else { + setIdentifier((java.lang.String)value); + } + break; + + case KEY: + if (value == null) { + unsetKey(); + } else { + setKey((java.lang.String)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case IDENTIFIER: + return getIdentifier(); + + case KEY: + return getKey(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case IDENTIFIER: + return isSetIdentifier(); + case KEY: + return isSetKey(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof NotFoundException) + return this.equals((NotFoundException)that); + return false; + } + + public boolean equals(NotFoundException that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_identifier = true && this.isSetIdentifier(); + boolean that_present_identifier = true && that.isSetIdentifier(); + if (this_present_identifier || that_present_identifier) { + if (!(this_present_identifier && that_present_identifier)) + return false; + if (!this.identifier.equals(that.identifier)) + return false; + } + + boolean this_present_key = true && this.isSetKey(); + boolean that_present_key = true && that.isSetKey(); + if (this_present_key || that_present_key) { + if (!(this_present_key && that_present_key)) + return false; + if (!this.key.equals(that.key)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetIdentifier()) ? 131071 : 524287); + if (isSetIdentifier()) + hashCode = hashCode * 8191 + identifier.hashCode(); + + hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287); + if (isSetKey()) + hashCode = hashCode * 8191 + key.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(NotFoundException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetIdentifier()).compareTo(other.isSetIdentifier()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIdentifier()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.identifier, other.identifier); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("NotFoundException("); + boolean first = true; + + if (isSetIdentifier()) { + sb.append("identifier:"); + if (this.identifier == null) { + sb.append("null"); + } else { + sb.append(this.identifier); + } + first = false; + } + if (isSetKey()) { + if (!first) sb.append(", "); + sb.append("key:"); + if (this.key == null) { + sb.append("null"); + } else { + sb.append(this.key); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class NotFoundExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public NotFoundExceptionStandardScheme getScheme() { + return new NotFoundExceptionStandardScheme(); + } + } + + private static class NotFoundExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, NotFoundException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IDENTIFIER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.identifier = iprot.readString(); + struct.setIdentifierIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readString(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, NotFoundException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.identifier != null) { + if (struct.isSetIdentifier()) { + oprot.writeFieldBegin(IDENTIFIER_FIELD_DESC); + oprot.writeString(struct.identifier); + oprot.writeFieldEnd(); + } + } + if (struct.key != null) { + if (struct.isSetKey()) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeString(struct.key); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class NotFoundExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public NotFoundExceptionTupleScheme getScheme() { + return new NotFoundExceptionTupleScheme(); + } + } + + private static class NotFoundExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, NotFoundException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetIdentifier()) { + optionals.set(0); + } + if (struct.isSetKey()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetIdentifier()) { + oprot.writeString(struct.identifier); + } + if (struct.isSetKey()) { + oprot.writeString(struct.key); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, NotFoundException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.identifier = iprot.readString(); + struct.setIdentifierIsSet(true); + } + if (incoming.get(1)) { + struct.key = iprot.readString(); + struct.setKeyIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/SystemException.java b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/SystemException.java new file mode 100644 index 0000000..8c8f202 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/SystemException.java @@ -0,0 +1,486 @@ +/** + * Autogenerated by Thrift Compiler (0.10.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.jigsaw.payment.rpc; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +/** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem in the service that could not be changed through caller action. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * message: This may contain additional information about the error + * + * rateLimitDuration: Indicates the minimum number of seconds that an application should + * expect subsequent API calls for this user to fail. The application should not retry + * API requests for the user until at least this many seconds have passed. Present only + * when errorCode is RATE_LIMIT_REACHED, + */ +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-08") +public class SystemException extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SystemException"); + + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SystemExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SystemExceptionTupleSchemeFactory(); + + public int errorCode; // required + public java.lang.String message; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ERROR_CODE((short)1, "errorCode"), + MESSAGE((short)2, "message"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ERROR_CODE + return ERROR_CODE; + case 2: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.MESSAGE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SystemException.class, metaDataMap); + } + + public SystemException() { + } + + public SystemException( + int errorCode) + { + this(); + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public SystemException(SystemException other) { + __isset_bitfield = other.__isset_bitfield; + this.errorCode = other.errorCode; + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public SystemException deepCopy() { + return new SystemException(this); + } + + @Override + public void clear() { + setErrorCodeIsSet(false); + this.errorCode = 0; + this.message = null; + } + + public int getErrorCode() { + return this.errorCode; + } + + public SystemException setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + return this; + } + + public void unsetErrorCode() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + public java.lang.String getMessage() { + return this.message; + } + + public SystemException setMessage(java.lang.String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((java.lang.Integer)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((java.lang.String)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ERROR_CODE: + return getErrorCode(); + + case MESSAGE: + return getMessage(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ERROR_CODE: + return isSetErrorCode(); + case MESSAGE: + return isSetMessage(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof SystemException) + return this.equals((SystemException)that); + return false; + } + + public boolean equals(SystemException that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_errorCode = true; + boolean that_present_errorCode = true; + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + errorCode; + + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(SystemException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SystemException("); + boolean first = true; + + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + if (isSetMessage()) { + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'errorCode' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class SystemExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public SystemExceptionStandardScheme getScheme() { + return new SystemExceptionStandardScheme(); + } + } + + private static class SystemExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SystemException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetErrorCode()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'errorCode' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, SystemException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + if (struct.message != null) { + if (struct.isSetMessage()) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SystemExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public SystemExceptionTupleScheme getScheme() { + return new SystemExceptionTupleScheme(); + } + } + + private static class SystemExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SystemException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.errorCode); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SystemException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/UserException.java b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/UserException.java new file mode 100644 index 0000000..30ad83a --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/gen/org/jigsaw/payment/rpc/UserException.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.10.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.jigsaw.payment.rpc; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +/** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem that a caller may be able to resolve. For example, if the user + * attempts to add a note to their account which would exceed their storage + * quota, this type of exception may be thrown to indicate the source of the + * error so that they can choose an alternate action. + * + * This exception would not be used for internal system errors that do not + * reflect user actions, but rather reflect a problem within the service that + * the user cannot resolve. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * message: This may contain additional information about the error. + */ +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-08") +public class UserException extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserException"); + + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UserExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UserExceptionTupleSchemeFactory(); + + public int errorCode; // required + public java.lang.String message; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ERROR_CODE((short)1, "errorCode"), + MESSAGE((short)2, "message"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ERROR_CODE + return ERROR_CODE; + case 2: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.MESSAGE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserException.class, metaDataMap); + } + + public UserException() { + } + + public UserException( + int errorCode) + { + this(); + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public UserException(UserException other) { + __isset_bitfield = other.__isset_bitfield; + this.errorCode = other.errorCode; + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public UserException deepCopy() { + return new UserException(this); + } + + @Override + public void clear() { + setErrorCodeIsSet(false); + this.errorCode = 0; + this.message = null; + } + + public int getErrorCode() { + return this.errorCode; + } + + public UserException setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + return this; + } + + public void unsetErrorCode() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + public java.lang.String getMessage() { + return this.message; + } + + public UserException setMessage(java.lang.String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((java.lang.Integer)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((java.lang.String)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ERROR_CODE: + return getErrorCode(); + + case MESSAGE: + return getMessage(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ERROR_CODE: + return isSetErrorCode(); + case MESSAGE: + return isSetMessage(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof UserException) + return this.equals((UserException)that); + return false; + } + + public boolean equals(UserException that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_errorCode = true; + boolean that_present_errorCode = true; + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + errorCode; + + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(UserException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("UserException("); + boolean first = true; + + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + if (isSetMessage()) { + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'errorCode' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class UserExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public UserExceptionStandardScheme getScheme() { + return new UserExceptionStandardScheme(); + } + } + + private static class UserExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, UserException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetErrorCode()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'errorCode' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, UserException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + if (struct.message != null) { + if (struct.isSetMessage()) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class UserExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public UserExceptionTupleScheme getScheme() { + return new UserExceptionTupleScheme(); + } + } + + private static class UserExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, UserException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.errorCode); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, UserException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/InvokeException.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/InvokeException.java deleted file mode 100644 index a305e90..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/InvokeException.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.qiyi.knowledge.thrift.exception; - -/** - * exception throws in invoke method - * @author HuXia - * - */ -public class InvokeException extends RuntimeException { - - private static final long serialVersionUID = 1184782180199131737L; - - public InvokeException(String msg) { - super(msg); - } - - public InvokeException(Throwable cause) { - super(cause); - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/MysqlDBException.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/MysqlDBException.java deleted file mode 100644 index 90b595b..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/exception/MysqlDBException.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.qiyi.knowledge.thrift.exception; - -/** - * mysql data base exception - * @author Hu Xia - * - */ -public class MysqlDBException extends Exception { - - private static final long serialVersionUID = -3849019615644280930L; - - public MysqlDBException(String msg) { - super(msg); - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/JsonSerializer.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/JsonSerializer.java deleted file mode 100644 index f0458e8..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/JsonSerializer.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of Knowlege Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - ***/ -package com.qiyi.knowledge.thrift.register; - -import com.qiyi.knowledge.thrift.utils.JsonBinder; -import org.apache.commons.beanutils.BeanUtils; -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.curator.x.discovery.ServiceInstance; -import org.apache.curator.x.discovery.ServiceInstanceBuilder; -import org.apache.curator.x.discovery.ServiceType; -import org.apache.curator.x.discovery.UriSpec; -import org.apache.curator.x.discovery.details.InstanceSerializer; -import org.springframework.util.StringUtils; - -import java.util.Map; -import java.util.Objects; - -/** - * 默认的zk是使用json格式的。 - * 1:序列化时只采用 json; - * 2:反序列化时使用json格式解析 - * - * @author Li Hengjun - * @version 1.0.0 5/16/16 - **/ -public class JsonSerializer implements InstanceSerializer { - private String defaltTransport; - - @Override - public byte[] serialize(ServiceInstance instance) - throws Exception { - - Map map = PropertyUtils.describe(instance); - map.put("uriSpec", this.serializeUriSpec(instance.getUriSpec())); - map.remove("class"); - String jsonStr = JsonBinder.buildNonNullBinder().toJson(map); - - return jsonStr.getBytes(); - } - - @Override - public ServiceInstance deserialize(byte[] bytes) - throws Exception { - ServiceInstanceBuilder builder = ServiceInstance.builder(); - String source = new String(bytes); - - Map map = JsonBinder.buildNonNullBinder().fromJson(source, Map.class); - - builder.id(Objects.toString(map.get("id"), "")); - builder.address(Objects.toString(map.get("address"), null)); - builder.port((Integer)map.get("port")); - builder.name(Objects.toString(map.get("name"), "")); - if(map.get("sslPort")!=null) { - builder.sslPort((Integer) map.get("sslPort")); - } - builder.registrationTimeUTC((long)map - .get("registrationTimeUTC")); - if(map.get("serviceType")!=null) { - builder.serviceType(ServiceType.valueOf(Objects.toString(map.get("serviceType")))); - } - - if (map.containsKey("uriSpec")) { - builder.uriSpec(this.deserializeUriSpec((String) map.get("uriSpec"))); - } - - if (map.containsKey("payload")) { - RpcPayload payload = new RpcPayload(); - BeanUtils.populate(payload, (Map) map.get("payload")); - builder.payload(payload); - } else if (!StringUtils.isEmpty(defaltTransport)) { - RpcPayload payload = new RpcPayload(); - payload.setTransport(defaltTransport); - builder.payload(payload); - } - - return builder.build(); - } - - - private String serializeUriSpec(UriSpec uriSpec) { - StringBuilder sb = new StringBuilder(); - for (UriSpec.Part part : uriSpec.getParts()) { - if (part.isVariable()) { - sb.append("{"); - sb.append(part.getValue()); - sb.append("}"); - } else { - sb.append(part.getValue()); - } - } - - return sb.toString(); - } - - private UriSpec deserializeUriSpec(String rawUriSpec) { - return new UriSpec(rawUriSpec); - } - - public void setDefaltTransport(String defaltTransport) { - this.defaltTransport = defaltTransport; - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseController.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseController.java deleted file mode 100644 index 8da52c0..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseController.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * Author: Hu Xia - ***************************************************** - */ -package com.qiyi.knowledge.thrift.server; - -import com.google.protobuf.Message; - -import com.iqiyi.pay.sdk.service.ErrorCode; -import com.iqiyi.pay.sdk.service.NotFoundException; -import com.iqiyi.pay.sdk.service.SystemException; -import com.iqiyi.pay.sdk.service.UserException; - -import org.apache.thrift.TException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.dao.EmptyResultDataAccessException; - -/** - * Base Controller, every service must extend this acl. - * - * @author HuXia - */ -public abstract class BaseController - implements Controller { - private static final Logger LOGGER = LoggerFactory.getLogger(BaseController.class); - - @Override - public Response process(Request request) throws TException { - long beginTime = System.currentTimeMillis(); - try { - Response response = doProcess(request); - LOGGER.debug("request {}, process cost time is {}", request.getClass(), - System.currentTimeMillis() - beginTime); - return response; - } catch(EmptyResultDataAccessException ex) { - LOGGER.info("result is null",ex); - throw new NotFoundException(); - } catch (IllegalArgumentException ex) { - LOGGER.error("illegal argument", ex); - throw new UserException(ErrorCode.BAD_DATA_FORMAT).setMessage(ex.getMessage()); - }catch (NotFoundException|UserException|SystemException e){ - LOGGER.warn("Thrift exception", e); - throw e; - }catch (TException e){ - LOGGER.error("Thrift exception", e); - throw e; - } catch (Exception ex) { - LOGGER.error("do process error", ex); - throw new SystemException(ErrorCode.INTERNAL_ERROR).setMessage(ex.getMessage()); - } - } - - /** - * every service must implement this method - * - * @param request - * @return response - * @throws Exception - */ - protected abstract Response doProcess(Request request) throws Exception; -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepository.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepository.java deleted file mode 100644 index 6820939..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepository.java +++ /dev/null @@ -1,694 +0,0 @@ -/* - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - */ -package com.qiyi.knowledge.thrift.server; - -import com.google.protobuf.DescriptorProtos.FieldOptions; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Descriptors.FieldDescriptor; -import com.google.protobuf.Message; - -import com.iqiyi.pay.sdk.ColumnFieldOption; -import com.iqiyi.pay.sdk.ColumnType; -import com.iqiyi.pay.sdk.Pageable; -import com.iqiyi.pay.sdk.TableMessageOption; -import com.iqiyi.pay.sdk.Taglib; -import com.qiyi.knowledge.thrift.utils.ProtoBinder; - -import org.apache.commons.beanutils.ConvertUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.dao.EmptyResultDataAccessException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.PreparedStatementCreator; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.jdbc.support.GeneratedKeyHolder; -import org.springframework.jdbc.support.KeyHolder; - -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -/** - * 基础数据访问层,将结果转换为protobuf - * - * @author Li Hengjun - * @time 2016/5/11 - */ -public class BaseProtobufRepository { - private final static String ORDER_BY_KEY = " order by "; - private final static String SELECT_COUNT = "select count(1) from "; - - protected Class messageClass; - protected Descriptors.Descriptor descriptor; - protected JdbcTemplate jdbcTemplate; - protected NamedParameterJdbcTemplate namedParameterJdbcTemplate; - protected TableMessageOption tableMessageOption; - protected String tableName; - - /** - * 构造函数中直接传入messageClass和tableName - * - * @param messageClass 类 - * @param tableName 表名 - * @throws IllegalAccessException - * @throws NoSuchMethodException - */ - @SuppressWarnings("unchecked") - public BaseProtobufRepository(Class messageClass, String tableName) { - this.messageClass = messageClass; - this.tableName = tableName; - this.descriptor = ProtoBinder.getDescriptor((Class) messageClass); - } - - @SuppressWarnings("unchecked") - public BaseProtobufRepository(Class messageClass) { - this.messageClass = messageClass; - this.descriptor = ProtoBinder.getDescriptor((Class) messageClass); - } - - @SuppressWarnings("unchecked") - public BaseProtobufRepository() { - Type genType = getClass().getGenericSuperclass(); - Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); - for (Type type : params) {// 查找 message类 - if (type instanceof Class && Message.class.isAssignableFrom((Class) type)) { - messageClass = (Class) type; - break; - } - } - descriptor = ProtoBinder.getDescriptor((Class) messageClass); - tableMessageOption = descriptor.getOptions().getExtension(Taglib.tableMessageOption); - // 默认从protobuf配置中查询表名 - if (tableMessageOption != null && StringUtils.isNotBlank(tableMessageOption.getTableName())) { - tableName = tableMessageOption.getTableName(); - } - } - - public String getTableName() { - return this.tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - /** - * 查询单个记录 - * - * @param sql - * @param args - * @return - */ - public M queryForObject(String sql, Object... args) { - try { - M m = jdbcTemplate.queryForObject(sql, new ProtobufMessageRowMapper(), args); - return m; - } catch (EmptyResultDataAccessException ex) { - return null; - } - } - - /** - * 查询多个记录 - * - * @param sql - * @param args - * @return - */ - public List queryForList(String sql, Object... args) { - return jdbcTemplate.query(sql, new ProtobufMessageRowMapper(), args); - } - - /** - * find page - * - * @param sql - * @param pageableBuilder - * @param args - * @return - */ - public List findPage(String sql, Pageable.Builder pageableBuilder, Object... args) { - sql = sql.toLowerCase(); - if (StringUtils.contains(sql, " limit ")) { - throw new IllegalArgumentException("sql key[limit] is forbidden:" + sql); - } - if (StringUtils.contains(sql, ORDER_BY_KEY)) { - throw new IllegalArgumentException("sql key[order by] is forbidden:" + sql); - } - - if (pageableBuilder.getAutoCount()) { - StringBuilder countSql = new StringBuilder(SELECT_COUNT); - String whereSql = StringUtils.substringAfter(sql, "from"); - countSql.append(whereSql); - int totalCount = jdbcTemplate.queryForObject(countSql.toString(), int.class, args); - pageableBuilder.setTotalCount(totalCount); - } - this.handlePageable(pageableBuilder); - - StringBuilder newSqlBuilder = new StringBuilder(sql); - - int startIndex = (pageableBuilder.getPageNumber() - 1) * pageableBuilder.getPageSize(); - newSqlBuilder.append(ORDER_BY_KEY).append(pageableBuilder.getPageSort()).append(" limit ").append(startIndex) - .append(",").append(pageableBuilder.getPageSize()); - - List list = this.queryForList(newSqlBuilder.toString(), args); - pageableBuilder.setCurrentPageCount(list == null ? 0 : list.size()); - - return list; - } - - private void handlePageable(Pageable.Builder pageableBuilder) { - int totalCount = pageableBuilder.getTotalCount(); - int pageSize = pageableBuilder.getPageSize(); - int pageNumber = pageableBuilder.getPageNumber(); - if (pageNumber < 1) { - pageNumber = 1; - } - pageableBuilder.setPageNumber(pageNumber); - pageableBuilder.setPageSize(pageSize); - - int totalPages = -1; - if (totalCount >= 0) { - totalPages = totalCount / pageSize; - if (totalCount % pageSize > 0) { - totalPages++; - } - } - pageableBuilder.setTotalPages(totalPages); - - if (pageNumber < totalPages) { - pageableBuilder.setHasNext(true); - } else { - pageableBuilder.setHasNext(false); - } - if (pageNumber > 1) { - pageableBuilder.setHasPrevious(true); - } else { - pageableBuilder.setHasPrevious(false); - } - - } - - /** - * update method - */ - public int update(String sql, Object... args) { - return jdbcTemplate.update(sql, args); - } - - /** - * update by preparedStatement - * - * @author HuXia - * @param sql - * @param args - * @return - */ - public int update(final String sql, final List args) { - return jdbcTemplate.update(new PreparedStatementCreator() { - - @Override - public PreparedStatement createPreparedStatement(Connection con) throws SQLException { - PreparedStatement ps = con.prepareStatement(sql); - ps = setPSParams(ps, args); - return ps; - } - - }); - } - - /** - * set preparedstatement params - * - * @param ps - * @param args - * @return - * @throws SQLException - */ - protected PreparedStatement setPSParams(PreparedStatement ps, List args) throws SQLException { - for (int i = 0; i < args.size(); i++) { - Object o = args.get(i); - if (o instanceof Descriptors.EnumValueDescriptor){ - ps.setInt(i+1, ((Descriptors.EnumValueDescriptor) o).getNumber()); - }else { - ps.setObject(i+1,o); - } - } - return ps; - } - - /** - * insert object to db, return auto id - * - * @author HuXia - */ - public long insert(final String sql, final List args) { - KeyHolder keyHolder = new GeneratedKeyHolder(); - int ret = jdbcTemplate.update(new PreparedStatementCreator() { - public PreparedStatement createPreparedStatement(Connection connection) throws SQLException { - PreparedStatement ps = connection.prepareStatement(sql, new String[] { "id" }); - ps = setPSParams(ps, args); - return ps; - } - }, keyHolder); - return ret > 0 && keyHolder.getKey()!=null ? (long) keyHolder.getKey() : ret; - } - - /** - * 数据库行映射到 protobuf builder对象 - */ - public class ProtobufBuilderRowMapper implements RowMapper { - @Override - public B mapRow(ResultSet rs, int rowNum) throws SQLException { - return resultSetToBuilder(rs, rowNum); - } - } - - /** - * 数据库行映射到 protobuf message对象 - */ - public class ProtobufMessageRowMapper implements RowMapper { - @Override - public M mapRow(ResultSet rs, int rowNum) throws SQLException { - M.Builder builder; - builder = resultSetToBuilder(rs, rowNum); - return (M) builder.build(); - } - } - - /** - * convert db resultset to message.builder - * - * @param rs - * resultset - * @param rowNum - * @param - * @return - * @throws SQLException - * @throws IllegalAccessException - * @throws NoSuchMethodException - */ - private B resultSetToBuilder(ResultSet rs, int rowNum) throws SQLException { - B builder = (B) ProtoBinder.newBuilder(messageClass); - ResultSetMetaData metaData = rs.getMetaData(); - int columnCount = metaData.getColumnCount();// 列个数 - String columnLabel = null;// 列名 - Object columnValue = null;// 列值 - FieldDescriptor fieldDescriptor = null; - for (int i = 1; i <= columnCount; i++) { - columnLabel = metaData.getColumnLabel(i); - columnValue = rs.getObject(i); - if (columnValue == null) - continue;// 如果为空,继续下一个 - fieldDescriptor = descriptor.findFieldByName(columnLabel); - if (fieldDescriptor == null) - continue;// 如果为空,继续下一个 - // 转换为相应的类型 ,会自动将 date 类型转换为long - if (fieldDescriptor.getType().equals(FieldDescriptor.Type.ENUM)){ - if (columnValue instanceof Integer) { - columnValue = fieldDescriptor.getEnumType().findValueByNumber((int) columnValue); - } else if (columnValue instanceof String) { - columnValue = fieldDescriptor.getEnumType().findValueByName((String) columnValue); - } - }else { - columnValue = ConvertUtils.convert(columnValue, fieldDescriptor.getDefaultValue().getClass()); - } - if(columnValue==null) { - continue; - } - builder.setField(fieldDescriptor, columnValue); - } - return builder; - } - - /** - * get connection - * - * @throws SQLException - */ - public Connection getConnection() throws SQLException { - return jdbcTemplate.getDataSource().getConnection(); - } - - /** - * insert message to db - * - * @author HuXia - * @param message - * @return - */ - protected long insertMessage(M message) { - return insertMessage(message, this.tableName); - } - - /** - * 插入或者更新,在遇到唯一索引冲突下会更新数据 - * - * @param message 信息 - * @param columnsWithDBLocalTime 需要使用mysql本地时间字段,e.g. create_time=now(),update_time=now() - */ - public long insertMessage(M message, String[] columnsWithDBLocalTime) { - return this.insertMessage(message, columnsWithDBLocalTime, this.tableName); - } - - /** - * 插入数据 - * - * @param message 数据 - * @param tableName 表名 - */ - public long insertMessage(M message, String tableName) { - return this.insertMessage(message, null, tableName); - } - - /** - * 插入数据 - * - * @param message 数据 - * @param tableName 表名 - * @param columnsWithDBLocalTime 需要使用mysql本地时间字段,e.g. create_time=now(),update_time=now() - */ - protected long insertMessage(M message, String[] columnsWithDBLocalTime, String tableName) { - StringBuilder insertSql = new StringBuilder("insert ignore into "); - insertSql.append(tableName).append("("); - StringBuilder fields = new StringBuilder(""); - StringBuilder values = new StringBuilder(""); - List args = new ArrayList(); - Map fieldMap = message.getAllFields(); - - Set columnsWithDBLocalTimeSet = null; - if (columnsWithDBLocalTime != null - && columnsWithDBLocalTime.length > 0) { - columnsWithDBLocalTimeSet = new HashSet<>(columnsWithDBLocalTime.length); - columnsWithDBLocalTimeSet.addAll(Arrays.asList(columnsWithDBLocalTime)); - } - - for (Entry entry : fieldMap.entrySet()) { - FieldDescriptor fieldDescriptor = entry.getKey(); - FieldOptions fieldOptions = fieldDescriptor.getOptions(); - ColumnFieldOption columnFieldOption = fieldOptions.getExtension(Taglib.columnFieldOption); - String fieldName = fieldDescriptor.getName(); - Object value = entry.getValue(); - - if (columnFieldOption.getColumnType() == ColumnType.DATETIME - || columnFieldOption.getColumnType() == ColumnType.TIMESTAMP) {// datetime类型 - - if (columnsWithDBLocalTimeSet != null - && columnsWithDBLocalTimeSet.contains(fieldName)) { - //使用数据库本地时间 now() - fields.append(fieldName).append(","); - values.append("now(), "); - } else if (value != null && (long) value > 0) { - fields.append(fieldName).append(","); - values.append("?, "); - args.add(new Timestamp((long) value)); - } - } else { - fields.append(fieldName).append(","); - values.append("?, "); - args.add(value); - } - } - int tmpIndex = fields.lastIndexOf(","); - insertSql.append(fields.substring(0, tmpIndex)).append(") values("); - tmpIndex = values.lastIndexOf(","); - insertSql.append(values.substring(0, tmpIndex)).append(")"); - return insert(insertSql.toString(), args); - } - - /** - * 插入或者更新,在遇到唯一索引冲突下会更新数据 - * - * @param message 信息 - */ - public long insertOrUpdateMessage(M message) { - return this.insertOrUpdateMessage(message, this.tableName); - } - - /** - * 插入或者更新,在遇到唯一索引冲突下会更新数据 - * - * @param message 信息 - * @param columnsWithDBLocalTime 需要使用mysql本地时间字段,e.g. create_time=now(),update_time=now() - */ - public long insertOrUpdateMessage(M message, String[] columnsWithDBLocalTime) { - return this.insertOrUpdateMessage(message, columnsWithDBLocalTime, this.tableName); - } - - /** - * 插入或者更新,在遇到唯一索引冲突下会更新数据 - * - * @param message 信息 - * @param tableName 表 - */ - public long insertOrUpdateMessage(M message, String tableName) { - return this.insertOrUpdateMessage(message, null, tableName); - } - - /** - * 插入或者更新,在遇到唯一索引冲突下会更新数据 - * - * @param message 数据 - * @param tableName 表名 - * @param columnsWithDBLocalTime 需要使用mysql本地时间字段,e.g. create_time=now(),update_time=now() - */ - protected long insertOrUpdateMessage(M message, String[] columnsWithDBLocalTime, String tableName) { - StringBuilder insertSql = new StringBuilder("insert into "); - insertSql.append(tableName).append("("); - StringBuilder fields = new StringBuilder(""); - StringBuilder values = new StringBuilder(""); - StringBuilder toUpdate = new StringBuilder(""); - List args = new ArrayList(); - Map fieldMap = message.getAllFields(); - Set columnsWithDBLocalTimeSet = null; - if (columnsWithDBLocalTime != null - && columnsWithDBLocalTime.length > 0) { - columnsWithDBLocalTimeSet = new HashSet<>(columnsWithDBLocalTime.length); - columnsWithDBLocalTimeSet.addAll(Arrays.asList(columnsWithDBLocalTime)); - } - List argsToUpdate = new ArrayList(); - - for (Map.Entry entry : fieldMap.entrySet()) { - Descriptors.FieldDescriptor fieldDescriptor = entry.getKey(); - FieldOptions fieldOptions = fieldDescriptor.getOptions(); - ColumnFieldOption columnFieldOption = fieldOptions.getExtension(Taglib.columnFieldOption); - String fieldName = fieldDescriptor.getName(); - Object value = entry.getValue(); - - if (columnFieldOption.getColumnType() == ColumnType.DATETIME - || columnFieldOption.getColumnType() == ColumnType.TIMESTAMP) {// datetime类型 - if (columnsWithDBLocalTimeSet != null - && columnsWithDBLocalTimeSet.contains(fieldName)) { - //使用数据库本地时间 now() - fields.append(fieldName).append(","); - values.append("now(), "); - toUpdate.append(fieldName).append("=now(), "); - } else if (value != null && (long) value > 0) { - fields.append(fieldName).append(","); - values.append("?, "); - toUpdate.append(fieldName).append("=?, "); - args.add(new Timestamp((long) value)); - argsToUpdate.add(new Timestamp((long) value)); - } - } else { - fields.append(fieldName).append(","); - values.append("?, "); - toUpdate.append(fieldName).append("=?, "); - args.add(value); - argsToUpdate.add(value); - } - } - int tmpIndex = fields.lastIndexOf(","); - insertSql.append(fields.substring(0, tmpIndex)).append(") values("); - tmpIndex = values.lastIndexOf(","); - insertSql.append(values.substring(0, tmpIndex)).append(")"); - insertSql.append(" on duplicate key update "); - tmpIndex = toUpdate.lastIndexOf(","); - insertSql.append(toUpdate.substring(0, tmpIndex)); - args.addAll(argsToUpdate); - return insert(insertSql.toString(), args); - } - - /** - * update message in db - * @param message 数据 - * @param conditionFields 条件字段 - * @param conditionParams 条件值 - */ - protected int updateMessageByCondition(M message, String[] conditionFields, Object[] conditionParams) { - return updateMessageByCondition(message, conditionFields, conditionParams, this.tableName); - } - /** - * 更新数据库数据 - * - * @param message 数据 - * @param columnsWithDBLocalTime 需要使用mysql本地时间字段,e.g. create_time=now(),update_time=now() - * @param conditionFields 条件字段 - * @param conditionParams 条件值 - */ - protected int updateMessageByCondition(M message, String[] columnsWithDBLocalTime, String[] conditionFields, Object[] conditionParams){ - return this.updateMessageByCondition(message,columnsWithDBLocalTime,conditionFields,conditionParams,this.tableName); - } - /** - * update message in db - * - * @param message 数据 - * @param conditionFields 条件字段 - * @param conditionParams 条件值 - */ - protected int updateMessageByCondition(M message, String[] conditionFields, Object[] conditionParams, - String tableName) { - return this.updateMessageByCondition(message, null, conditionFields, conditionParams, tableName); - } - - /** - * 更新数据库数据 - * - * @param message 数据 - * @param columnsWithDBLocalTime 需要使用mysql本地时间字段,e.g. create_time=now(),update_time=now() - * @param conditionFields 条件字段 - * @param conditionParams 条件值 - * @param tableName 表名 - */ - protected int updateMessageByCondition(M message, String[] columnsWithDBLocalTime, String[] conditionFields, Object[] conditionParams, - String tableName) { - if (conditionFields.length != conditionParams.length) { - throw new IllegalArgumentException("conditionFields length should equal to conditionParams length"); - } - StringBuilder updateSql = new StringBuilder("update "); - updateSql.append(tableName).append(" set "); - StringBuilder options = new StringBuilder(""); - List args = new ArrayList(); - Map fieldMap = message.getAllFields(); - Set columnsWithDBLocalTimeSet = null; - if (columnsWithDBLocalTime != null - && columnsWithDBLocalTime.length > 0) { - columnsWithDBLocalTimeSet = new HashSet<>(columnsWithDBLocalTime.length); - columnsWithDBLocalTimeSet.addAll(Arrays.asList(columnsWithDBLocalTime)); - } - for (Entry entry : fieldMap.entrySet()) { - FieldDescriptor fieldDescriptor = entry.getKey(); - - FieldOptions fieldOptions = fieldDescriptor.getOptions(); - ColumnFieldOption columnFieldOption = fieldOptions.getExtension(Taglib.columnFieldOption); - String fieldName = fieldDescriptor.getName(); - Object value = entry.getValue(); - if (columnFieldOption.getColumnType() == ColumnType.DATETIME - || columnFieldOption.getColumnType() == ColumnType.TIMESTAMP) {// datetime类型 - if (columnsWithDBLocalTimeSet != null - && columnsWithDBLocalTimeSet.contains(fieldName)) { - //使用数据库本地时间 now() - options.append(fieldName).append("=now(), "); - } else if (value != null && (long) value > 0) { - options.append(fieldName).append("=?, "); - args.add(new Timestamp((long) value)); - } - } else { - options.append(fieldName).append("=?, "); - args.add(value); - } - - } - int tmpIndex = options.lastIndexOf(","); - updateSql.append(options.substring(0, tmpIndex)).append(" where 1=1 "); - StringBuilder condition = new StringBuilder(); - - for (int i = 0; i < conditionFields.length; i++) { - condition.append("AND ").append(conditionFields[i]).append("=? "); - args.add(conditionParams[i]); - } - updateSql.append(condition); - return update(updateSql.toString(), args); - - } - - /** - * 根据条件查询单个对象 - * - * @param conditionFields - * @param conditionParams - * @return - */ - public M queryObjectByCondition(String[] conditionFields, Object[] conditionParams) { - return queryObjectByCondition(conditionFields, conditionParams, tableName); - } - - public M queryObjectByCondition(String[] conditionFields, Object[] conditionParams, String tableName) { - StringBuilder querySql = new StringBuilder("select "); - String fieldStr = getQueryFieldStr(); - List args = new ArrayList(); - querySql.append(fieldStr).append(" from ").append(tableName).append(" where 1=1 "); - for (int i = 0; i < conditionFields.length; i++) { - querySql.append("AND ").append(conditionFields[i]).append("=? "); - args.add(conditionParams[i]); - } - return queryForObject(querySql.toString(), args.toArray()); - } - - /** - * 根据条件查询列表,输出所有字段 - * - * @param conditionFields - * @param conditionParams - * @return - */ - public List queryListByCondition(String[] conditionFields, Object[] conditionParams) { - return queryListByCondition(conditionFields, conditionParams, this.tableName); - } - - /** - * 根据条件查询列表,输出所有字段 - * - * @param conditionFields - * @param conditionParams - * @param tableName - * @return - */ - public List queryListByCondition(String[] conditionFields, Object[] conditionParams, String tableName) { - StringBuilder querySql = new StringBuilder("select "); - String fieldStr = getQueryFieldStr(); - List args = new ArrayList(); - querySql.append(fieldStr).append(" from ").append(tableName).append(" where 1=1 "); - for (int i = 0; i < conditionFields.length; i++) { - querySql.append("AND ").append(conditionFields[i]).append("=? "); - args.add(conditionParams[i]); - } - return this.queryForList(querySql.toString(), args.toArray()); - } - - /** - * 获取查询的属性 - * - * @return - */ - protected String getQueryFieldStr() { - StringBuilder fieldStr = new StringBuilder(); - List fields = descriptor.getFields(); - for (int i = 0; i < fields.size(); i++) { - if (i == fields.size() - 1) { - fieldStr.append(fields.get(i).getName()); - } else { - fieldStr.append(fields.get(i).getName()).append(","); - } - } - return fieldStr.toString(); - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseRPCServer.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseRPCServer.java deleted file mode 100644 index 8ada18c..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/BaseRPCServer.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.qiyi.knowledge.thrift.server; - - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.core.env.Environment; - -/** - * base server - */ - -public class BaseRPCServer { - protected final Logger LOG = LoggerFactory.getLogger(this.getClass()); - /** - * 启动server - */ - public void start(String[] args) throws Exception { - SpringApplication springApplication = new SpringApplication(this.getClass()); - //not web app - //normally spring select context based on classpath, so we don't need set this is pom is clear - //springApplication.setWebEnvironment(false); - ConfigurableApplicationContext context = springApplication.run(args); - - ServerRunner serverRunner = context.getBean("server-runner",ServerRunner.class); - - LOG.info("Started Server successfully on port [{}]",context.getBean(Environment.class).getProperty("rpc.server.port")); - serverRunner.start(); - } - - -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/Controller.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/Controller.java deleted file mode 100644 index bc364f2..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/Controller.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.server; - -import org.apache.thrift.TException; - -import com.google.protobuf.Message; - -/** - * RPC Controller. 各服务应该实现这个接口。 - * @author Li Hengjun - * @version 1.0.0 5/16/16 - **/ -public interface Controller { - /** - * - * @param request - * @return response - * @throws TException - */ - public Response process(Request request) throws TException; -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/TProtobufProcessor.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/TProtobufProcessor.java deleted file mode 100644 index a78d1f0..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/TProtobufProcessor.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.server; - -import com.google.protobuf.Message; - -import com.googlecode.protobuf.format.JsonFormat; -import com.iqiyi.pay.sdk.service.GatewayService; -import com.iqiyi.pay.sdk.service.GatewayService.execute_result; -import com.iqiyi.pay.sdk.service.GatewayService.execute_result._Fields; - -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.thrift.TApplicationException; -import org.apache.thrift.TBase; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TMessage; -import org.apache.thrift.protocol.TMessageType; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.protocol.TProtocolUtil; -import org.apache.thrift.protocol.TType; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.core.GenericTypeResolver; - -import java.lang.reflect.Method; -import java.net.Socket; -import java.nio.ByteBuffer; - -/** - * protobuf和thrift 之间的链接。 实现如下功能: - *
    - *
  1. 根据请求的service name,选择对应的Controller来执行请求
  2. - *
  3. 将请求的byte buffer 转换成对应的Message对象。这个需要依赖Controller的Request和Response的类型。
  4. - *
- *

- *

- * 2015-12-8 修改: - * 1. slf4j改成log4j - * 2. 增加debug和warn日志打印 - * 3. 当controller处理出错时,增加往客户端显示异常信息(即将异常信息写回给client端) - * - * @author Li Hengjun - * @version 1.0.0 5/16/16 - **/ -public class TProtobufProcessor implements org.apache.thrift.TProcessor, - BeanFactoryAware { - private static final Logger LOGGER = Logger.getLogger(TProtobufProcessor.class.getName()); - - private static final int MAX_REQUEST_BYTES_LENGTH = 2048; - private static final String UN_KNOWN_IP = "unknown_ip"; - - private BeanFactory beanFactory; - - public TProtobufProcessor() { - } - - @Override - public boolean process(TProtocol in, TProtocol out) throws TException { - TMessage msg = in.readMessageBegin(); - Controller fn = (Controller) this.beanFactory - .getBean(msg.name); - if (fn == null) { - if (LOGGER.isEnabledFor(Level.WARN)) { - LOGGER.warn("Invalid request: failed to find interface=" + msg.name - + ", from: " + getInetAddress(in)); - } - - TProtocolUtil.skip(in, TType.STRUCT); - in.readMessageEnd(); - TApplicationException x = new TApplicationException( - TApplicationException.UNKNOWN_METHOD, - "Invalid method name: '" + msg.name + "'"); - out.writeMessageBegin(new TMessage(msg.name, - TMessageType.EXCEPTION, msg.seqid)); - x.write(out); - out.writeMessageEnd(); - out.getTransport().flush(); - return true; - } - process(msg.seqid, msg.name, in, out, fn); - return true; - } - - @Override - public void setBeanFactory(BeanFactory beanFactory) throws BeansException { - this.beanFactory = beanFactory; - } - - protected void process(int seqid, String methodName, TProtocol iprot, - TProtocol oprot, Controller iface) throws TException { - long startTime = System.currentTimeMillis(); - String ip = getInetAddress(iprot); - - GatewayService.execute_args args = new GatewayService.execute_args(); - try { - args.read(iprot); - } catch (TProtocolException e) { - if (LOGGER.isEnabledFor(Level.WARN)) { - LOGGER.warn("Invalid request: failed to parse request of interface=" + methodName - + ", from: " + ip); - } - - iprot.readMessageEnd(); - TApplicationException x = new TApplicationException( - TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new TMessage(methodName, - TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - TBase result = null; - try { - result = getResult(iface, args.request, methodName, ip, oprot, seqid); - } catch (TException tex) { - LOGGER.error("Internal error processing " + methodName, tex); - TApplicationException x = new TApplicationException( - TApplicationException.INTERNAL_ERROR, - new StringBuilder().append("Internal error processing ") - .append(methodName) - .append("[") - .append(tex.getClass().getSimpleName()).append("]") - .append(", cause by: ") - .append(tex.getMessage()).toString()); - oprot.writeMessageBegin(new TMessage(methodName, - TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - - if (!isOneway()) { - oprot.writeMessageBegin(new TMessage(methodName, - TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - if (LOGGER.isDebugEnabled()) { - long elapseTime = System.currentTimeMillis() - startTime; - LOGGER.debug(new StringBuilder().append("End handling query interface=").append(methodName) - .append(", time elapsed: ").append(elapseTime)); - } - } - - protected boolean isOneway() { - return false; - } - - public TBase - getResult(Controller iface, - ByteBuffer args, - String methodName, - String ip, - TProtocol oprot, - int seqid) throws TException { - GatewayService.execute_result result = new GatewayService.execute_result(); - Request request = this.parseRequest(iface, args); - - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(new StringBuilder() - .append("Begin handling query interface=").append(methodName) - .append(", request: ").append(messageToString(request)) - .append(", from: ").append(ip)); - } - - Response response = null; - try { - response = iface.process(request); - } catch (TException e) { - if (this.handleException(result, e)) {//处理异常成功,直接返回 - return result; - } else { - throw e; - } - } - result.success = ByteBuffer.wrap(response.toByteArray()); - return result; - } - - @SuppressWarnings("unchecked") - protected T parseRequest(Controller controller, - ByteBuffer request) throws TException { - Class requestClass = this.getParameterizedType(controller); - try { - Method method = requestClass.getMethod("parseFrom", byte[].class); - return (T) method.invoke(null, this.getValidBytes(request)); - } catch (Exception ex) { - throw new TException("Error in parsing request. ", ex); - } - - } - - private byte[] getValidBytes(ByteBuffer byteBuffer) { - return ArrayUtils.subarray(byteBuffer.array(), byteBuffer.position(), - byteBuffer.limit()); - } - - private Class getParameterizedType(Object target) throws TException { - Class[] arguments = GenericTypeResolver.resolveTypeArguments( - target.getClass(), Controller.class); - if (arguments.length != 2) - throw new TException( - "Error to resolve request type, please make sure " - + target.getClass() - + " has provided type arguments for Controller class."); - return arguments[0]; - } - - private String getInetAddress(TProtocol in) { - TTransport transport = in.getTransport(); - if (transport != null && transport instanceof TSocket) { - Socket socket = ((TSocket) in.getTransport()).getSocket(); - return socket.getInetAddress().getHostAddress().replace('.', ':'); - } else { - return UN_KNOWN_IP; - } - } - - /** - * 将message转换成string,并用空格取代回车符和引号. - */ - private String messageToString(Message message) { - String json = JsonFormat.printToString(message); - - return StringUtils.replaceChars( - StringUtils.replaceChars(StringUtils.left(json, MAX_REQUEST_BYTES_LENGTH), '\n', ' '), - '"', - ' '); - } - - /** - * 处理抛出异常 - * @param result 结果 - * @param e 异常 - * @return 是否处理成功 - */ - private boolean handleException(execute_result result, TException e) { - String simpleName = e.getClass().getSimpleName(); - simpleName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1); - final _Fields fields = _Fields.findByName(simpleName); - if (fields == null) {//没找到对应异常,处理失败 - return false; - } - result.setFieldValue(fields, e); - return true; - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledTransport.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledTransport.java deleted file mode 100644 index 65f1d1d..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledTransport.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ - -package com.qiyi.knowledge.thrift.sharder; - -import org.apache.commons.pool2.impl.DefaultPooledObject; -import org.apache.thrift.transport.TTransport; - -/** - * An wrapper on TTransport to support pooling . - * - * @author Li Hengjun - * @version 1.0.0 5/16/16 - **/ -public class PooledTransport extends DefaultPooledObject { - /** - * @param transport - */ - public PooledTransport(TTransport transport) { - super(transport); - } - -} \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportPoolType.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportPoolType.java deleted file mode 100644 index 4122486..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportPoolType.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.qiyi.knowledge.thrift.sharder; - -public enum TransportPoolType { - - ROUND_ROBIN, STATIC_QPS, BASIC_QOS - -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/JsonBinder.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/JsonBinder.java deleted file mode 100644 index eb0f204..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/JsonBinder.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.qiyi.knowledge.thrift.utils; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; - -/** - * Jackson的简单封装. - * - * @author calvin - */ -public class JsonBinder { - - - private static Logger logger = LoggerFactory.getLogger(JsonBinder.class); - - - private ObjectMapper mapper; - - - public JsonBinder(JsonInclude.Include inclusion) { - mapper = new ObjectMapper(); -// 设置输出包含的属性 - mapper.setSerializationInclusion(inclusion); -// 设置输入时忽略JSON字符串中存在而Java对象实际没有的属性 - mapper.getDeserializationConfig().with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - } - - - /** - * 创建输出全部属性到Json字符串的Binder. - */ - public static JsonBinder buildNormalBinder() { - return new JsonBinder(JsonInclude.Include.ALWAYS); - } - - - /** - * 创建只输出非空属性到Json字符串的Binder. - */ - public static JsonBinder buildNonNullBinder() { - return new JsonBinder(JsonInclude.Include.NON_NULL); - } - - - /** - * 创建只输出初始值被改变的属性到Json字符串的Binder. - */ - public static JsonBinder buildNonDefaultBinder() { - return new JsonBinder(JsonInclude.Include.NON_DEFAULT); - } - - - /** - * 如果JSON字符串为Null或"null"字符串,返回Null. 如果JSON字符串为"[]",返回空集合. 如需读取集合如List/Map,且不是List这种简单类型时使用如下语句: List - * beanList = binder.getMapper().readValue(listString, new TypeReference>() {}); - */ - public T fromJson(String jsonString, Class clazz) { - if (StringUtils.isEmpty(jsonString)) { - return null; - } - try { - return mapper.readValue(jsonString, clazz); - } catch (IOException e) { - logger.warn("parse json string error:" + jsonString, e); - return null; - } - } - - - /** - * 如果对象为Null,返回"null". 如果集合为空集合,返回"[]". - */ - public String toJson(Object object) { - try { - return mapper.writeValueAsString(object); - } catch (IOException e) { - logger.warn("write to json string error:" + object, e); - return null; - } - } - - - /** - * 设置转换日期类型的format pattern,如果不设置默认打印Timestamp毫秒数. - */ - public void setDateFormat(String pattern) { - if (StringUtils.isNotBlank(pattern)) { - DateFormat df = new SimpleDateFormat(pattern); - mapper.setDateFormat(df); - } - } - - - /** - * 取出Mapper做进一步的设置或使用其他序列化API. - */ - public ObjectMapper getMapper() { - return mapper; - } - -} \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/PidRecorder.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/PidRecorder.java deleted file mode 100644 index 3ee0bcb..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/PidRecorder.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * PidRecorder.java 1.0 2013/07/03 - * - * Copyright (c) 2013 qiyi inc. - */ - -package com.qiyi.knowledge.thrift.utils; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import java.io.FileWriter; -import java.io.IOException; -import java.lang.management.ManagementFactory; - -/** - * This class used to record pid of current process. - * @author wangchuanqian - * - */ - -public class PidRecorder { - private static final Logger LOG = LoggerFactory.getLogger(PidRecorder.class); - - /** - * Get pid. - * @return - */ - public Long getPID() { - String processName = ManagementFactory.getRuntimeMXBean().getName(); - return fetchPidFromPidInfo(processName.split("@")[0]); - } - - /** - * Fetch pid from the info string that contains the pid, but the pid info string - * maybe is not the same. - * For example: the pidInfo maybe is in one of those situations: - * 1: GNU libgcj 4.4.7 20120313 (Red Hat 4.4.7-3) [10600 - * 2: 32199 - * @param pidInfo - * @return - */ - private Long fetchPidFromPidInfo(String pidInfo) { - if (pidInfo == null || pidInfo.length() < 1) { - return 0L; - } - - // Judge whether it is a purely digital string. - int index = findLastNonNumericCharIndexOfPidInfo(pidInfo); - if (index == -1) { - // It only contains the digital string. - return Long.parseLong(pidInfo); - } - - // It contains other non-numeric string. - String pid = pidInfo.substring(index + 1); - return Long.parseLong(pid); - } - - /** - * Find the index of last non numeric char in the pid info string. - * @param pidInfo - * @return - * the index of the last occurrence of the non-numeric character - * in the character sequence represented by this object, - * or -1 if the character does not occur. - */ - private int findLastNonNumericCharIndexOfPidInfo(String pidInfo) { - int index = -1; - for (int i = pidInfo.length() - 1; i >= 0; i--) { - if (!Character.isDigit(pidInfo.charAt(i))) { - index = i; - break; - } - } - return index; - } - - /** - * Write pid to pid file. - * @param pidFile - * @return - */ - public boolean writePidToFile(String pidFile) { - FileWriter pidFileWriter = null; - - try { - pidFileWriter = new FileWriter(pidFile); - pidFileWriter.write(getPID().toString()); - } catch (IOException e) { - LOG.error(e.getMessage()); - return false; - } finally { - try { - pidFileWriter.close(); - } catch (IOException e) { - LOG.error(e.getMessage()); - return false; - } - } - return true; - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/ProtoBinder.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/ProtoBinder.java deleted file mode 100644 index b267bed..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/ProtoBinder.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.qiyi.knowledge.thrift.utils; - -import com.google.protobuf.Descriptors; -import com.google.protobuf.DynamicMessage; -import com.google.protobuf.Message; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.protobuf.ProtobufMapper; -import com.qiyi.knowledge.thrift.exception.InvokeException; - -import org.apache.commons.beanutils.ConvertUtils; -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.commons.lang3.reflect.MethodUtils; - -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by lihengjun on 2016/5/11. - */ -public class ProtoBinder { - private static final Map, Descriptors.Descriptor> CACHE_MESSAGE_DESCRIPTOR = new HashMap(); - private static ObjectMapper objectMapper = new ProtobufMapper(); - - /** - * convert object to protobuf message - * - * @param messageClass - * @param paramsObject - * @param - * @return - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - */ - @SuppressWarnings("unchecked") - public static T build(Class messageClass, Object paramsObject) { - return (T) newBuilder(messageClass, paramsObject).build(); - } - - /** - * convert object to protobuf builder - * - * @param messageClass - * @param paramsObject - * @param - * @return - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - */ - public static T.Builder newBuilder(Class messageClass, Object paramsObject) { - final T.Builder builder = newBuilder(messageClass); - if (paramsObject == null) { - return builder; - } - final Descriptors.Descriptor descriptor = getDescriptor((Class) messageClass); - Map paramsMap = null; - if (paramsObject instanceof Map) { - paramsMap = (Map) paramsObject; - } else { - try { - paramsMap = PropertyUtils.describe(paramsObject); - } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { - throw new InvokeException(e); - } - } - - return toBuilder(paramsMap, descriptor, builder); - } - - /** - * convert object to protobuf builder - * - * @param paramsMap - * @param descriptor - * @param builder - * @param - * @return - */ - private static T.Builder toBuilder(Map paramsMap, - Descriptors.Descriptor descriptor, T.Builder builder) { - if (paramsMap == null || paramsMap.isEmpty()) { - return builder; - } - - for(Map.Entry entry:paramsMap.entrySet()){ - Object value = entry.getValue(); - if(value==null) - continue; - final Descriptors.FieldDescriptor fieldDescriptor = descriptor.findFieldByName(entry.getKey()); - - if (fieldDescriptor != null) { - if (fieldDescriptor.getJavaType() == Descriptors.FieldDescriptor.JavaType.MESSAGE) { - // when MESSAGE java type, nothing happened - } else if (fieldDescriptor.getJavaType() == Descriptors.FieldDescriptor.JavaType.ENUM) { - // when ENUM java type, nothing happened - } else {// simple java type,convert and set - // 转换为相应的类型 ,会自动将 date 类型转换为long - value = ConvertUtils.convert(value, fieldDescriptor.getDefaultValue().getClass()); - builder.setField(fieldDescriptor, value); - } - } else { // find embedded message - final Object finalValue = value; - for(Descriptors.FieldDescriptor f:descriptor.getFields()){ - - if (f.getJavaType() == Descriptors.FieldDescriptor.JavaType.MESSAGE) { - Message.Builder fBuilder = newBuilder(f.getMessageType()); - toBuilder(paramsMap, f.getMessageType(), fBuilder); - builder.setField(f, fBuilder.build()); - } else if (f.getName().equals(entry.getKey())) { - // 转换为相应的类型 ,会自动将 date 类型转换为long - Object newValue = ConvertUtils.convert(finalValue, f.getDefaultValue().getClass()); - builder.setField(f, newValue); - } - } - } - } - return builder; - } - - /** - * get Descriptor from message class cache messageClass->descriptor - * - * @param messageClass - * @return - * @throws InvocationTargetException - * @throws IllegalAccessException - * @throws NoSuchMethodException - */ - public static Descriptors.Descriptor getDescriptor(Class messageClass){ - Descriptors.Descriptor descriptor = CACHE_MESSAGE_DESCRIPTOR.get(messageClass); - if (descriptor == null) {// cache messageClass->descriptor - try { - descriptor = (Descriptors.Descriptor) MethodUtils.invokeStaticMethod(messageClass, "getDescriptor"); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - throw new InvokeException(e); - }// 获取描述 - synchronized (ProtoBinder.class) { - CACHE_MESSAGE_DESCRIPTOR.put(messageClass, descriptor); - } - } - return descriptor; - } - - /** - * get DynamicMessage.Builder from descriptor - * - * @param descriptor - * @return - */ - public static DynamicMessage.Builder newBuilder(Descriptors.Descriptor descriptor) { - DynamicMessage.Builder builder = DynamicMessage.newBuilder(descriptor); - return builder; - } - - /** - * get Builder from messageClass - * - * @param messageClass - * @return - * @throws InvocationTargetException - * @throws IllegalAccessException - * @throws NoSuchMethodException - */ - public static T.Builder newBuilder(Class messageClass) { - T.Builder builder = null; - try { - builder = (T.Builder) MethodUtils.invokeStaticMethod(messageClass, "newBuilder"); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - throw new InvokeException(e); - } - return builder; - } - - /** - * get Builder from messageClass - * - * @param messageClass - * @return - * @throws InvocationTargetException - * @throws IllegalAccessException - * @throws NoSuchMethodException - */ - public static T parseFrom(Class messageClass, byte[] bytes) { - T message = null; - try { - message = (T) MethodUtils.invokeStaticMethod(messageClass, "parseFrom", bytes); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - throw new InvokeException(e); - } - return message; - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/RpcServiceBinder.java b/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/RpcServiceBinder.java deleted file mode 100644 index 79bd4c6..0000000 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/RpcServiceBinder.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ - -package com.qiyi.knowledge.thrift.utils; - -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.lang3.ClassUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.reflect.ConstructorUtils; -import org.apache.thrift.TServiceClient; -import org.apache.thrift.protocol.TProtocol; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry; -import org.springframework.context.annotation.ClassPathBeanDefinitionScanner; -import org.springframework.core.type.filter.AssignableTypeFilter; - -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; -import com.iqiyi.pay.sdk.RpcServiceMessageOption; -import com.iqiyi.pay.sdk.Taglib; - -/** - * rpc service builder. Init service name,client_class,request entity,response - * entity - * - * @author Li Hengjun - * @version 1.0.0 5/16/16 - **/ -public class RpcServiceBinder { - private final Logger LOGGER = LoggerFactory.getLogger(RpcServiceBinder.class); - /** - * request message class cache - */ - private final Map> REQUEST_MESSAGE_CACHE_MAP = new HashMap(); - /** - * response message class cache - */ - private final Map> RESPONSE_MESSAGE_CACHE_MAP = new HashMap(); - /** - * client method name cache - */ - private final Map METHOD_NAME_CACHE_MAP = new HashMap(); - /** - * server service name cache - */ - private final Map SERVER_SERVICE_NAME_CACHE_MAP = new HashMap(); - /** - * client class cache - */ - private final Map> CLIENT_CACHE_MAP = new HashMap(); - /** - * request message Descriptor cache - */ - private final Map REQUEST_DESCRIPTOR_CACHE_MAP = new HashMap(); - /** - * response message Descriptor cache - */ - private final Map RESPONSE_DESCRIPTOR_CACHE_MAP = new HashMap(); - - public RpcServiceBinder() { - try { - init(); - } catch (ClassNotFoundException | IllegalArgumentException e) { - LOGGER.error("init error,please check proto file config, {}", e.getMessage()); - System.exit(1); - } - } - - /** - * init system protobuf entity into cach map protobuf entity base package - * must be com.iqiyi.pay.sdk - * - * @throws ClassNotFoundException - * @throws InvocationTargetException - * @throws IllegalAccessException - * @throws NoSuchMethodException - */ - private synchronized void init() throws ClassNotFoundException { - BeanDefinitionRegistry beanDefinitionRegistry = new SimpleBeanDefinitionRegistry(); - ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(beanDefinitionRegistry, false); - scanner.addIncludeFilter(new AssignableTypeFilter(Message.class));// find message subclass - Set classes = scanner.findCandidateComponents("com.iqiyi.pay.sdk");// scan base pacakge - for (BeanDefinition bean : classes) { - String className = bean.getBeanClassName(); - Class clazz = (Class) ClassUtils.getClass(className); - if (!Message.class.isAssignableFrom(clazz)) { - continue; - } - Descriptors.Descriptor descriptor = ProtoBinder.getDescriptor(clazz); - // one to many - List rpcServiceMessageOptions = descriptor.getOptions() - .getExtension(Taglib.rpcServiceMessageOption); - for (RpcServiceMessageOption rpcServiceMessageOption : rpcServiceMessageOptions) { - if (rpcServiceMessageOption == null) {// rpcServiceMessageOption is null,continue - continue; - } - String serviceName = rpcServiceMessageOption.getName(); - if (StringUtils.isBlank(serviceName)) {// service name is blank,continue; - continue; - } - // request entity - if (rpcServiceMessageOption.getIsRequest()) {// when it is request entity,get client class name - REQUEST_MESSAGE_CACHE_MAP.put(serviceName, clazz); - String clientClassName = rpcServiceMessageOption.getClientClass();// required - String methodName = rpcServiceMessageOption.getMethodName();// required - String serverServiceName = rpcServiceMessageOption.getServerServiceName();// required - if (StringUtils.isBlank(clientClassName)) { - throw new IllegalArgumentException("clientClass is required in proto file" + className); - } else if (StringUtils.isBlank(methodName)) { - throw new IllegalArgumentException("methodName is required in proto file" + className); - } else if (StringUtils.isBlank(serverServiceName)) { - throw new IllegalArgumentException("serverServiceName is required in proto file" + className); - } - - Class clientClass = ClassUtils.getClass(clientClassName); - if (TServiceClient.class.isAssignableFrom(clientClass)) { - CLIENT_CACHE_MAP.put(serviceName, clientClass); - } else { - throw new IllegalArgumentException( - "clientClassName must be TServiceClient's subclass,invalid className:" + className); - } - METHOD_NAME_CACHE_MAP.put(serviceName, methodName); - SERVER_SERVICE_NAME_CACHE_MAP.put(serviceName, serverServiceName); - REQUEST_DESCRIPTOR_CACHE_MAP.put(serviceName, ProtoBinder.getDescriptor(clazz)); - } else {// response entity - RESPONSE_MESSAGE_CACHE_MAP.put(serviceName, clazz); - RESPONSE_DESCRIPTOR_CACHE_MAP.put(serviceName, ProtoBinder.getDescriptor(clazz)); - } - } - } - } - - /** - * get Request Descriptor by service name - * - * @param serviceName - * @return - */ - public Descriptors.Descriptor getRequestDescriptor(String serviceName) { - return REQUEST_DESCRIPTOR_CACHE_MAP.get(serviceName); - } - - /** - * get Response Descriptor by service name - * - * @param serviceName - * @return - */ - public Descriptors.Descriptor getResponseDescriptor(String serviceName) { - return RESPONSE_DESCRIPTOR_CACHE_MAP.get(serviceName); - } - - /** - * get Request Descriptor by service name - * - * @param serviceName - * @return - */ - public Class getClientClass(String serviceName) { - return CLIENT_CACHE_MAP.get(serviceName); - } - - /** - * get TServiceClient from serviceName and tProtocol - * - * @param serviceName - * @param tProtocol - * @return - */ - public TServiceClient getClient(String serviceName, TProtocol tProtocol) { - TServiceClient client = null; - Class clazz = null; - clazz = getClientClass(serviceName); - if (clazz == null) { - new IllegalArgumentException(serviceName + " client class not found"); - } - try { - client = ConstructorUtils.invokeConstructor(clazz, tProtocol); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException - | InstantiationException e) { - new IllegalArgumentException(serviceName + "[" + clazz + "] be found,but constructor newInstance failed ", - e); - } - return client; - } - - /** - * @param serviceName - * @return - */ - public Class getRequestClass(String serviceName) { - return REQUEST_MESSAGE_CACHE_MAP.get(serviceName); - } - - /** - * @param serviceName - * @return - */ - public Class getResponseClass(String serviceName) { - return RESPONSE_MESSAGE_CACHE_MAP.get(serviceName); - } - - /** - * @param serviceName - * @param paramsObject - * @param - * @return - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - */ - public T.Builder newRequestBuilder(String serviceName, Object paramsObject) - throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { - Class requestClass = (Class) REQUEST_MESSAGE_CACHE_MAP.get(serviceName); - return ProtoBinder.newBuilder(requestClass, paramsObject); - } - - /** - * @param serviceName - * @param paramsObject - * @param - * @return - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - */ - public T newRequestMessage(String serviceName, Object paramsObject) - throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { - Class requestClass = (Class) REQUEST_MESSAGE_CACHE_MAP.get(serviceName); - return ProtoBinder.build(requestClass, paramsObject); - } - - /** - * @param serviceName - * @param paramsObject - * @param - * @return - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - */ - public T.Builder newResponseBuilder(String serviceName, Object paramsObject) - throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { - Class requestClass = (Class) RESPONSE_MESSAGE_CACHE_MAP.get(serviceName); - return ProtoBinder.newBuilder(requestClass, paramsObject); - } - - public Map> getREQUEST_MESSAGE_CACHE_MAP() { - return REQUEST_MESSAGE_CACHE_MAP; - } - - public Map> getRESPONSE_MESSAGE_CACHE_MAP() { - return RESPONSE_MESSAGE_CACHE_MAP; - } - - public Map getMETHOD_NAME_CACHE_MAP() { - return METHOD_NAME_CACHE_MAP; - } - - public Map getSERVER_SERVICE_NAME_CACHE_MAP() { - return SERVER_SERVICE_NAME_CACHE_MAP; - } - - public Map> getCLIENT_CACHE_MAP() { - return CLIENT_CACHE_MAP; - } - - public Map getREQUEST_DESCRIPTOR_CACHE_MAP() { - return REQUEST_DESCRIPTOR_CACHE_MAP; - } - - public Map getRESPONSE_DESCRIPTOR_CACHE_MAP() { - return RESPONSE_DESCRIPTOR_CACHE_MAP; - } -} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/DigestAuthInfo.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/DigestAuthInfo.java similarity index 74% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/DigestAuthInfo.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/DigestAuthInfo.java index 7d12ae7..7a54fda 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/DigestAuthInfo.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/DigestAuthInfo.java @@ -1,12 +1,4 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.register; +package org.jigsaw.payment.rpc.register; import org.apache.curator.framework.AuthInfo; @@ -15,7 +7,7 @@ import java.util.Arrays; /** * A widget class for cofiguring digest auth. * - * @author Li Hengjun + * @author shamphone@gmail.com * @version 1.0.0 5/16/16 **/ public class DigestAuthInfo extends AuthInfo{ diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/JsonSerializer.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/JsonSerializer.java new file mode 100644 index 0000000..fad436b --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/JsonSerializer.java @@ -0,0 +1,137 @@ +package org.jigsaw.payment.rpc.register; + +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +import org.apache.commons.beanutils.BeanUtils; +import org.apache.commons.beanutils.PropertyUtils; +import org.apache.curator.x.discovery.ServiceInstance; +import org.apache.curator.x.discovery.ServiceInstanceBuilder; +import org.apache.curator.x.discovery.ServiceType; +import org.apache.curator.x.discovery.UriSpec; +import org.apache.curator.x.discovery.details.InstanceSerializer; +import org.springframework.util.StringUtils; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * 默认的zk是使用json格式的。 1:序列化时只采用 json; 2:反序列化时使用json格式解析 + * + * @author shamphone@gmail.com + * @version 1.0.0 5/16/16 + **/ +public class JsonSerializer implements InstanceSerializer { + private String defaltTransport; + private ObjectMapper mapper; + + public JsonSerializer() { + this.mapper = new ObjectMapper(); + // 设置输出包含的属性 + this.mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + // 设置输入时忽略JSON字符串中存在而Java对象实际没有的属性 + this.mapper.getDeserializationConfig().with( + DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + } + + @Override + public byte[] serialize(ServiceInstance instance) + throws Exception { + + Map map = PropertyUtils.describe(instance); + map.put("uriSpec", this.serializeUriSpec(instance.getUriSpec())); + map.remove("class"); + String jsonStr = this.toJson(map); + + return jsonStr.getBytes(); + } + + @SuppressWarnings("unchecked") + @Override + public ServiceInstance deserialize(byte[] bytes) + throws Exception { + ServiceInstanceBuilder builder = ServiceInstance.builder(); + String source = new String(bytes); + + Map map = this.fromJson(source, Map.class); + + builder.id(Objects.toString(map.get("id"), "")); + builder.address(Objects.toString(map.get("address"), null)); + builder.port((Integer) map.get("port")); + builder.name(Objects.toString(map.get("name"), "")); + if (map.get("sslPort") != null) { + builder.sslPort((Integer) map.get("sslPort")); + } + builder.registrationTimeUTC((long) map.get("registrationTimeUTC")); + if (map.get("serviceType") != null) { + builder.serviceType(ServiceType.valueOf(Objects.toString(map + .get("serviceType")))); + } + + if (map.containsKey("uriSpec")) { + builder.uriSpec(this.deserializeUriSpec((String) map.get("uriSpec"))); + } + + if (map.containsKey("payload")) { + RpcPayload payload = new RpcPayload(); + BeanUtils.populate(payload, + (Map) map.get("payload")); + builder.payload(payload); + } else if (!StringUtils.isEmpty(defaltTransport)) { + RpcPayload payload = new RpcPayload(); + payload.setTransport(defaltTransport); + builder.payload(payload); + } + + return builder.build(); + } + + private String serializeUriSpec(UriSpec uriSpec) { + StringBuilder sb = new StringBuilder(); + for (UriSpec.Part part : uriSpec.getParts()) { + if (part.isVariable()) { + sb.append("{"); + sb.append(part.getValue()); + sb.append("}"); + } else { + sb.append(part.getValue()); + } + } + + return sb.toString(); + } + + /** + * 如果JSON字符串为Null或"null"字符串,返回Null. 如果JSON字符串为"[]",返回空集合. + * @throws IOException + */ + private T fromJson(String jsonString, Class clazz) throws IOException { + if (StringUtils.isEmpty(jsonString)) { + return null; + } + + return mapper.readValue(jsonString, clazz); + + } + + /** + * 如果对象为Null,返回"null". 如果集合为空集合,返回"[]". + * + * @throws IOException + */ + private String toJson(Object object) throws IOException { + + return mapper.writeValueAsString(object); + + } + + private UriSpec deserializeUriSpec(String rawUriSpec) { + return new UriSpec(rawUriSpec); + } + + public void setDefaltTransport(String defaltTransport) { + this.defaltTransport = defaltTransport; + } +} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/RpcPayload.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/RpcPayload.java similarity index 84% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/RpcPayload.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/RpcPayload.java index 77ee5e3..bb5ed7b 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/register/RpcPayload.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/register/RpcPayload.java @@ -1,12 +1,4 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.register; +package org.jigsaw.payment.rpc.register; import org.apache.commons.lang3.StringUtils; @@ -15,8 +7,8 @@ import org.apache.commons.lang3.StringUtils; * A payload bean for register (thrift) RPC Server to zookeeper. The sharder * provider would use this information for choose appropriate server. * - * @author Li Hengjun - * @version 1.0.0 5/16/16 + * @author shamphone@gmail.com + * @version 1.0.0 **/ public class RpcPayload implements java.io.Serializable { diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/BaseController.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/BaseController.java new file mode 100644 index 0000000..619c759 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/BaseController.java @@ -0,0 +1,46 @@ +package org.jigsaw.payment.rpc.server; + +import org.apache.thrift.TException; +import org.jigsaw.payment.rpc.NotFoundException; +import org.jigsaw.payment.rpc.SystemException; +import org.jigsaw.payment.rpc.UserException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.protobuf.Message; + +/** + * Base Controller, every service must extend this acl. + * + * @author shamphone@gmail.com + * @version 1.0.0 + */ +public abstract class BaseController + implements Controller { + private static final Logger LOGGER = LoggerFactory.getLogger(BaseController.class); + private static int INTERNAL_ERROR = 502; + @Override + public Response process(Request request) throws NotFoundException,SystemException,UserException{ + long beginTime = System.currentTimeMillis(); + try { + Response response = doProcess(request); + LOGGER.debug("request {}, process cost time is {}", request.getClass(), + System.currentTimeMillis() - beginTime); + return response; + }catch (NotFoundException|UserException|SystemException|RuntimeException e){ + throw e; + } catch (Exception ex) { + LOGGER.error("internal error ", ex); + throw new SystemException(INTERNAL_ERROR).setMessage(ex.getMessage()); + } + } + + /** + * every service must implement this method + * + * @param request + * @return response + * @throws Exception + */ + protected abstract Response doProcess(Request request) throws Exception; +} diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/Controller.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/Controller.java new file mode 100644 index 0000000..60bea85 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/Controller.java @@ -0,0 +1,25 @@ +package org.jigsaw.payment.rpc.server; + +import org.jigsaw.payment.rpc.NotFoundException; +import org.jigsaw.payment.rpc.SystemException; +import org.jigsaw.payment.rpc.UserException; + +import com.google.protobuf.Message; + +/** + * RPC Controller. 各服务应该实现这个接口。 + * + * @author shamphone@gmail.com + * @version 1.0.0 + **/ +public interface Controller { + /** + * 处理请求的接口 + * @param request 请求 + * @return 处理结果 + * @throws NotFoundException 对于读取资源的接口, 如果资源找不到,可以抛出这个异常。 + * @throws SystemException 服务器端错误 + * @throws UserException 由于用户原因引起的错误 + */ + public Response process(Request request) throws NotFoundException,SystemException,UserException; +} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/IpPortUtil.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/IpPortResolver.java similarity index 85% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/IpPortUtil.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/IpPortResolver.java index bf11b02..356274b 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/utils/IpPortUtil.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/IpPortResolver.java @@ -1,4 +1,4 @@ -package com.qiyi.knowledge.thrift.utils; +package org.jigsaw.payment.rpc.server; import java.io.IOException; import java.net.Inet4Address; @@ -11,10 +11,17 @@ import java.net.SocketException; import java.util.Enumeration; import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -public class IpPortUtil { - private static final Logger LOG = Logger.getLogger(IpPortUtil.class); +/** + * 解析当前服务器的IP地址 + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月4日 + */ +public class IpPortResolver { + private static final Logger LOG = LoggerFactory.getLogger(IpPortResolver.class); private static final int MAX_PORT_RETRY_COUNT = 100; @@ -24,7 +31,7 @@ public class IpPortUtil { * 2 192.168的地址会被过滤,不回返回 * @return */ - public static String getIpV4Address() { + public String getIpV4Address() { String ip = null; // 1. 首先获取eth0地址. try { @@ -67,7 +74,7 @@ public class IpPortUtil { * @param port * @return */ - public static int getAvailablePort(String ip, int port) { + public int getAvailablePort(String ip, int port) { int availablePort = port; int retryCount = 0; @@ -89,7 +96,7 @@ public class IpPortUtil { * @param port * @return */ - private static boolean isPortAvailable(String ip, int port) { + private boolean isPortAvailable(String ip, int port) { boolean isOk = true; Socket socket = new Socket(); @@ -111,7 +118,7 @@ public class IpPortUtil { * @param ias * @return */ - private static String getFirstIpV4Address(Enumeration ias) { + private String getFirstIpV4Address(Enumeration ias) { String ip = null; if (ias == null) { return ip; @@ -135,7 +142,7 @@ public class IpPortUtil { * @param inetAddress * @return */ - private static String getIpV4Address(InetAddress inetAddress) { + private String getIpV4Address(InetAddress inetAddress) { if (inetAddress == null || inetAddress.isLoopbackAddress() || inetAddress instanceof Inet6Address) { diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/PidRecorder.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/PidRecorder.java new file mode 100644 index 0000000..c4c04f5 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/PidRecorder.java @@ -0,0 +1,100 @@ +package org.jigsaw.payment.rpc.server; + +import java.io.FileWriter; +import java.io.IOException; +import java.lang.management.ManagementFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author shamphone@gmail.com + * @version 1.0.0 + * @date 2017年8月5日 + */ +public class PidRecorder { + private static final Logger LOG = LoggerFactory + .getLogger(PidRecorder.class); + + /** + * Get pid. + * + * @return + */ + public Long getPID() { + String processName = ManagementFactory.getRuntimeMXBean().getName(); + return fetchPidFromPidInfo(processName.split("@")[0]); + } + + /** + * Fetch pid from the info string that contains the pid, but the pid info + * string maybe is not the same. For example: the pidInfo maybe is in one of + * those situations: 1: GNU libgcj 4.4.7 20120313 (Red Hat 4.4.7-3) [10600 + * 2: 32199 + * + * @param pidInfo + * @return + */ + private Long fetchPidFromPidInfo(String pidInfo) { + if (pidInfo == null || pidInfo.length() < 1) { + return 0L; + } + + // Judge whether it is a purely digital string. + int index = findLastNonNumericCharIndexOfPidInfo(pidInfo); + if (index == -1) { + // It only contains the digital string. + return Long.parseLong(pidInfo); + } + + // It contains other non-numeric string. + String pid = pidInfo.substring(index + 1); + return Long.parseLong(pid); + } + + /** + * Find the index of last non numeric char in the pid info string. + * + * @param pidInfo + * @return the index of the last occurrence of the non-numeric character in + * the character sequence represented by this object, or -1 if the + * character does not occur. + */ + private int findLastNonNumericCharIndexOfPidInfo(String pidInfo) { + int index = -1; + for (int i = pidInfo.length() - 1; i >= 0; i--) { + if (!Character.isDigit(pidInfo.charAt(i))) { + index = i; + break; + } + } + return index; + } + + /** + * Write pid to pid file. + * + * @param pidFile + * @return + */ + public boolean writePidToFile(String pidFile) { + FileWriter pidFileWriter = null; + + try { + pidFileWriter = new FileWriter(pidFile); + pidFileWriter.write(getPID().toString()); + } catch (IOException e) { + LOG.error(e.getMessage()); + return false; + } finally { + try { + pidFileWriter.close(); + } catch (IOException e) { + LOG.error(e.getMessage()); + return false; + } + } + return true; + } +} diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/RpcServerConfiguration.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/RpcServerConfiguration.java new file mode 100644 index 0000000..7c41cfc --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/RpcServerConfiguration.java @@ -0,0 +1,183 @@ +package org.jigsaw.payment.rpc.server; + +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.curator.RetryPolicy; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.retry.BoundedExponentialBackoffRetry; +import org.apache.curator.x.discovery.ServiceDiscovery; +import org.apache.curator.x.discovery.ServiceDiscoveryBuilder; +import org.apache.curator.x.discovery.ServiceInstance; +import org.apache.curator.x.discovery.ServiceInstanceBuilder; +import org.apache.curator.x.discovery.UriSpec; +import org.apache.curator.x.discovery.details.InstanceSerializer; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.transport.TTransportFactory; +import org.jigsaw.payment.rpc.register.JsonSerializer; +import org.jigsaw.payment.rpc.register.RpcPayload; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; + +/** + * Rpc Server 配置文件 + * + * @author shamphone@gmail.com + * + */ +@Configuration +public class RpcServerConfiguration { + + @Autowired + private Environment env; + + @Bean + public TProcessor processor() { + return new TProtobufProcessor(); + } + + public InstanceSerializer serializer() { + return new JsonSerializer(); + } + + public RpcPayload payload() { + RpcPayload payload = new RpcPayload(); + payload.setMaxQps(env.getProperty("rpc.server.max.qps", Long.class, + 1000l)); + payload.setProtocol(env.getProperty("rpc.service.protocol.type", + "binary")); + payload.setTransport(env.getProperty("rpc.service.transport.type", + "transport")); + return payload; + } + + /** + public ACLProvider aclProvider() { + return new ACLProvider() { + @Override + public List getDefaultAcl() { + return ZooDefs.Ids.CREATOR_ALL_ACL; + } + + @Override + public List getAclForPath(String path) { + return ZooDefs.Ids.CREATOR_ALL_ACL; + } + }; + } + + public List authInfo() { + String username = env.getProperty("rpc.server.zookeeper.username"); + String password = env.getProperty("rpc.server.zookeeper.password"); + List info = new ArrayList(); + info.add(new DigestAuthInfo(username, password)); + return info; + } + **/ + + public RetryPolicy retryPolicy() { + int baseSleepTimeMs = Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.base.sleep.time.ms", "1000")); + int maxSleepTimeMs = Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.max.sleep.time.ms", "5000")); + int maxRetries = Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.max.retries", "50")); + return new BoundedExponentialBackoffRetry(baseSleepTimeMs, + maxSleepTimeMs, maxRetries); + } + + @Bean(name = "curator-framework") + public CuratorFramework curatorFramework() { + return CuratorFrameworkFactory + .builder() + .connectString( + env.getProperty("rpc.server.zookeeper.connect.string")) + .sessionTimeoutMs( + Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.session.timeout.ms", + "10000"))) + .connectionTimeoutMs( + Integer.parseInt(env.getProperty( + "rpc.server.zookeeper.connection.timeout.ms", + "10000"))).retryPolicy(this.retryPolicy()) + //.aclProvider(this.aclProvider()).authorization(this.authInfo()) + .build(); + } + + @Bean(name = "service-instance") + public ServiceInstance serviceInstance() throws Exception { + ServiceInstanceBuilder instance = ServiceInstance.builder(); + instance.name(env.getProperty("rpc.server.service.name")) + .uriSpec(new UriSpec(env.getProperty("rpc.server.uri.spec"))) + .payload(this.payload()).port(this.port()) + .id(this.instanceId()).address(this.ip()); + return instance.build(); + } + + public int port() { + return env.getProperty("rpc.server.port", Integer.class); + } + + public String ip() { + return (env.getProperty("rpc.server.ip") == null) ? new IpPortResolver() + .getIpV4Address() : env.getProperty("rpc.server.ip"); + } + + public String instanceId() { + return this.ip() + ":" + this.port(); + } + + @Bean(name = "pool-server") + public TServer poolServer() throws Exception { + TServerTransport transport = new TServerSocket(this.port()); + + TThreadPoolServer.Args args = new TThreadPoolServer.Args(transport); + args.transportFactory(new TTransportFactory()); + args.protocolFactory(new TBinaryProtocol.Factory()); + + args.processor(this.processor()); + args.executorService(new ThreadPoolExecutor(env.getProperty( + "rpc.server.min.worker.threads", Integer.class, 512), env + .getProperty("rpc.server.max.worker.threads", Integer.class, + 65535), env.getProperty( + "rpc.server.thread.keep.alive.time", Long.class, 600l), + TimeUnit.SECONDS, new SynchronousQueue())); + + return new TThreadPoolServer(args); + } + + @Bean(name = "rpc-register") + public ServiceDiscovery serviceDiscovery() throws Exception { + ServiceDiscoveryBuilder builder = ServiceDiscoveryBuilder + .builder(RpcPayload.class); + return builder.client(this.curatorFramework()) + .basePath(env.getProperty("rpc.server.service.path")) + .serializer(this.serializer()) + .thisInstance(this.serviceInstance()).build(); + } + + @Bean(name = "server-runner", destroyMethod = "stop") + public ServerRunner serverRunner() throws Exception { + return ServerRunner + .newBuilder() + .server(this.poolServer()) + .curatorFramework(this.curatorFramework()) + .serviceDiscovery(this.serviceDiscovery()) + .zookeeperDeferRegisterPeriod( + env.getProperty("rpc.server.zookeeper.register.delay", + Integer.class, 2000)) + .zookeeperUnregisterPeriod( + env.getProperty( + "rpc.server.zookeeper.unregister.before", + Integer.class, 5000)).build(); + } +} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/ServerRunner.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/ServerRunner.java similarity index 60% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/ServerRunner.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/ServerRunner.java index a744c0c..f89e690 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/server/ServerRunner.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/ServerRunner.java @@ -1,41 +1,39 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.server; +package org.jigsaw.payment.rpc.server; import java.util.concurrent.TimeUnit; -import com.qiyi.knowledge.thrift.register.RpcPayload; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.x.discovery.ServiceDiscovery; -import org.apache.log4j.Logger; import org.apache.thrift.server.TServer; - +import org.jigsaw.payment.rpc.register.RpcPayload; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** - * - * - * @author Li Hengjun - * @version 1.0.0 5/16/16 - **/ + * + * @author shamphone@gmail.com + * @version 1.0.0 + */ public class ServerRunner { - private static final Logger LOG = Logger.getLogger(ServerRunner.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerRunner.class); public static class Builder { // 在server完全启动后注册到zookeeper上; private int zookeeperDeferRegisterPeriod = 2000; // 在server关闭提前从zookeeper上注销 private int zookeeperUnregisterPeriod = 5000; - + // 连接到zookeeper private CuratorFramework framework = null; + // 运行的服务器; private TServer server = null; + // zk服务发现设置 private ServiceDiscovery discovery = null; - + // 是否在子线程中启动server + private boolean async = false; + // 异步线程名称 + private String threadName = "RPCService"; + // 异步线程关闭timeout; + private int shutdownTimeout = 1000; /** * 在server完全启动后注册到zookeeper上的时间间隔,毫秒为单位 * @@ -67,12 +65,26 @@ public class ServerRunner { this.discovery = discovery; return this; } + public Builder server(TServer server) { this.server = server; return this; } - public ServerRunner build() { + public Builder async(boolean async) { + this.async = async; + return this; + } + + public Builder threadName(String threadName) { + this.threadName = threadName; + return this; + } + public Builder shutdownTimeout(int shutdownTimeout) { + this.shutdownTimeout = shutdownTimeout; + return this; + } + public ServerRunner build() { return new ServerRunner(this); } } @@ -84,6 +96,8 @@ public class ServerRunner { private Builder builder; // 是否注册到zk上了; private boolean registered = false; + // 异步线程; + private Thread runningThread = null; private ServerRunner(Builder builder) { this.builder = builder; @@ -115,8 +129,21 @@ public class ServerRunner { LOG.info("Register to zookeeper successfully."); } }).start(); - LOG.info("rpc server start serving... "); - builder.server.serve(); + if(builder.async){ + Runnable runnable = new Runnable(){ + @Override + public void run() { + LOG.info("rpc server start serving... "); + builder.server.serve(); + } + }; + this.runningThread = new Thread(runnable, builder.threadName); + this.runningThread.start(); + + }else { + LOG.info("rpc server start serving... "); + builder.server.serve(); + } } public void stop() throws InterruptedException { @@ -124,16 +151,24 @@ public class ServerRunner { try { if (registered) { builder.discovery.close(); + LOG.info("Unregister from zookeeper server successfully. "); builder.framework.close(); + LOG.info("Close zookeeper connection successfully. "); } registered = false; - LOG.info("unregister from zookeeper server. "); + TimeUnit.MILLISECONDS.sleep(builder.zookeeperUnregisterPeriod); } catch (Exception e) { LOG.error("Failed to unregister from zookeeper server.", e); } - if(builder.server.isServing()) + if (builder.server.isServing()){ builder.server.stop(); - LOG.info("rpc server stoped. "); + LOG.info("Rpc server shut down."); + } + if(builder.async && this.runningThread!=null && this.runningThread.isAlive()){ + this.runningThread.join(builder.shutdownTimeout); + LOG.info("Rpc server thread "+ this.builder.threadName +" shut down."); + } + LOG.info("rpc server stopped successfully. "); } } diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/TProtobufProcessor.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/TProtobufProcessor.java new file mode 100644 index 0000000..fb397d0 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/server/TProtobufProcessor.java @@ -0,0 +1,255 @@ +package org.jigsaw.payment.rpc.server; + +import java.lang.reflect.Method; +import java.net.Socket; +import java.nio.ByteBuffer; + +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.thrift.TApplicationException; +import org.apache.thrift.TBase; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TMessage; +import org.apache.thrift.protocol.TMessageType; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.protocol.TProtocolUtil; +import org.apache.thrift.protocol.TType; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.jigsaw.payment.rpc.BaseService; +import org.jigsaw.payment.rpc.BaseService.execute_result; +import org.jigsaw.payment.rpc.BaseService.execute_result._Fields; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.BeanFactoryAware; +import org.springframework.core.GenericTypeResolver; + +import com.google.protobuf.Message; +import com.googlecode.protobuf.format.JsonFormat; + +/** + * protobuf和thrift 之间的链接。 实现如下功能: + *

    + *
  1. 根据请求的service name,选择对应的Controller来执行请求
  2. + *
  3. 将请求的byte buffer 转换成对应的Message对象。这个需要依赖Controller的Request和Response的类型。
  4. + *
+ *

+ *

+ * 当controller处理出错时,增加往客户端显示异常信息(即将异常信息写回给client端) + * + * @author shamphone@gmail.com + * @version 1.0.0 + **/ +public class TProtobufProcessor implements org.apache.thrift.TProcessor, + BeanFactoryAware { + private static final Logger LOGGER = LoggerFactory.getLogger(TProtobufProcessor.class); + + private static final int MAX_REQUEST_BYTES_LENGTH = 2048; + private static final String UN_KNOWN_IP = "unknown_ip"; + + private BeanFactory beanFactory; + + public TProtobufProcessor() { + } + + @Override + public boolean process(TProtocol in, TProtocol out) throws TException { + TMessage msg = in.readMessageBegin(); + Controller fn = (Controller) this.beanFactory + .getBean(msg.name); + if (fn == null) { + if (LOGGER.isWarnEnabled()) { + LOGGER.warn("Invalid request: failed to find interface=" + + msg.name + ", from: " + getInetAddress(in)); + } + + TProtocolUtil.skip(in, TType.STRUCT); + in.readMessageEnd(); + TApplicationException x = new TApplicationException( + TApplicationException.UNKNOWN_METHOD, + "Invalid method name: '" + msg.name + "'"); + out.writeMessageBegin(new TMessage(msg.name, + TMessageType.EXCEPTION, msg.seqid)); + x.write(out); + out.writeMessageEnd(); + out.getTransport().flush(); + return true; + } + process(msg.seqid, msg.name, in, out, fn); + return true; + } + + @Override + public void setBeanFactory(BeanFactory beanFactory) throws BeansException { + this.beanFactory = beanFactory; + } + + protected void process(int seqid, String methodName, TProtocol iprot, + TProtocol oprot, Controller iface) throws TException { + long startTime = System.currentTimeMillis(); + String ip = getInetAddress(iprot); + + BaseService.execute_args args = new BaseService.execute_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + if (LOGGER.isWarnEnabled()) { + LOGGER.warn("Invalid request: failed to parse request of interface=" + + methodName + ", from: " + ip); + } + + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException( + TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage(methodName, + TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + TBase result = null; + try { + result = getResult(iface, args.request, methodName, ip, oprot, + seqid); + } catch (TException tex) { + LOGGER.error("Internal error processing " + methodName, tex); + TApplicationException x = new TApplicationException( + TApplicationException.INTERNAL_ERROR, new StringBuilder() + .append("Internal error processing ") + .append(methodName).append("[") + .append(tex.getClass().getSimpleName()).append("]") + .append(", cause by: ").append(tex.getMessage()) + .toString()); + oprot.writeMessageBegin(new TMessage(methodName, + TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + + if (!isOneway()) { + oprot.writeMessageBegin(new TMessage(methodName, + TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + if (LOGGER.isDebugEnabled()) { + long elapseTime = System.currentTimeMillis() - startTime; + LOGGER.debug(new StringBuilder() + .append("End handling query interface=").append(methodName) + .append(", time elapsed: ").append(elapseTime).toString()); + } + } + + protected boolean isOneway() { + return false; + } + + public TBase getResult( + Controller iface, ByteBuffer args, + String methodName, String ip, TProtocol oprot, int seqid) + throws TException { + BaseService.execute_result result = new BaseService.execute_result(); + Request request = this.parseRequest(iface, args); + + if (LOGGER.isDebugEnabled()) { + LOGGER.debug(new StringBuilder() + .append("Begin handling query interface=") + .append(methodName).append(", request: ") + .append(messageToString(request)).append(", from: ") + .append(ip).toString()); + } + + Response response = null; + try { + response = iface.process(request); + } catch (TException e) { + if (this.handleException(result, e)) {// 处理异常成功,直接返回 + return result; + } else { + throw e; + } + } + result.success = ByteBuffer.wrap(response.toByteArray()); + return result; + } + + @SuppressWarnings("unchecked") + protected T parseRequest(Controller controller, + ByteBuffer request) throws TException { + Class requestClass = this.getParameterizedType(controller); + try { + Method method = requestClass.getMethod("parseFrom", byte[].class); + return (T) method.invoke(null, this.getValidBytes(request)); + } catch (Exception ex) { + throw new TException("Error in parsing request. ", ex); + } + + } + + private byte[] getValidBytes(ByteBuffer byteBuffer) { + return ArrayUtils.subarray(byteBuffer.array(), byteBuffer.position(), + byteBuffer.limit()); + } + + private Class getParameterizedType(Object target) throws TException { + Class[] arguments = GenericTypeResolver.resolveTypeArguments( + target.getClass(), Controller.class); + if (arguments.length != 2) + throw new TException( + "Error to resolve request type, please make sure " + + target.getClass() + + " has provided type arguments for Controller class."); + return arguments[0]; + } + + private String getInetAddress(TProtocol in) { + TTransport transport = in.getTransport(); + if (transport != null && transport instanceof TSocket) { + Socket socket = ((TSocket) in.getTransport()).getSocket(); + return socket.getInetAddress().getHostAddress().replace('.', ':'); + } else { + return UN_KNOWN_IP; + } + } + + /** + * 将message转换成string,并用空格取代回车符和引号. + */ + private String messageToString(Message message) { + String json = JsonFormat.printToString(message); + + return StringUtils.replaceChars(StringUtils.replaceChars( + StringUtils.left(json, MAX_REQUEST_BYTES_LENGTH), '\n', ' '), + '"', ' '); + } + + /** + * 处理抛出异常 + * + * @param result + * 结果 + * @param e + * 异常 + * @return 是否处理成功 + */ + private boolean handleException(execute_result result, TException e) { + String simpleName = e.getClass().getSimpleName(); + simpleName = simpleName.substring(0, 1).toLowerCase() + + simpleName.substring(1); + final _Fields fields = _Fields.findByName(simpleName); + if (fields == null) {// 没找到对应异常,处理失败 + return false; + } + result.setFieldValue(fields, e); + return true; + } +} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/AbstractTransportPool.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/AbstractTransportPool.java similarity index 94% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/AbstractTransportPool.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/AbstractTransportPool.java index b646d11..cea8490 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/AbstractTransportPool.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/AbstractTransportPool.java @@ -1,26 +1,19 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.sharder; +package org.jigsaw.payment.rpc.sharder; -import com.qiyi.knowledge.thrift.register.RpcPayload; import org.apache.commons.pool2.BaseKeyedPooledObjectFactory; import org.apache.commons.pool2.KeyedObjectPool; import org.apache.commons.pool2.PooledObject; import org.apache.commons.pool2.impl.GenericKeyedObjectPool; import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; import org.apache.curator.x.discovery.ServiceInstance; -import org.apache.log4j.Logger; import org.apache.thrift.TException; import org.apache.thrift.transport.TFramedTransport; import org.apache.thrift.transport.TSocket; import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException; +import org.jigsaw.payment.rpc.register.RpcPayload; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.Closeable; import java.io.IOException; @@ -28,14 +21,14 @@ import java.io.IOException; /** * 实现PooledObjectFactory的基本方法来支持对ObjectPool的实现 * - * @author Li Hengjun + * @author shamphone@gmail.com * @version 1.0.0 5/16/16 **/ public abstract class AbstractTransportPool extends BaseKeyedPooledObjectFactory, TTransport> implements Closeable, TransportManager { - private static Logger LOG = Logger.getLogger(AbstractTransportPool.class); + private static Logger LOG = LoggerFactory.getLogger(AbstractTransportPool.class); /** * 被封装的连接池。key为RPC server 实例,value为链接到该server的transport. */ @@ -66,7 +59,6 @@ public abstract class AbstractTransportPool extends *

  • 接管socket/transport的通道管理,不执行实际的关闭。
  • *
  • 当链接出错时,将链接标记为passive,准备回收。
  • * - * @author Li Xiongfeng * */ public class ManagedTransport extends TTransportWrapper { @@ -83,7 +75,7 @@ public abstract class AbstractTransportPool extends * (non-Javadoc) * * @see - * com.qiyi.knowledge.thrift.sharder.TTransportWrapper#onException(java + * org.jigsaw.payment.rpc.sharder.TTransportWrapper#onException(java * .lang.Exception) */ @Override diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/BasicQosTransportPool.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/BasicQosTransportPool.java similarity index 96% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/BasicQosTransportPool.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/BasicQosTransportPool.java index 4556b39..034487e 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/BasicQosTransportPool.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/BasicQosTransportPool.java @@ -1,8 +1,7 @@ -package com.qiyi.knowledge.thrift.sharder; - -import com.qiyi.knowledge.thrift.register.RpcPayload; +package org.jigsaw.payment.rpc.sharder; import org.apache.curator.x.discovery.ServiceInstance; +import org.jigsaw.payment.rpc.register.RpcPayload; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,7 +20,8 @@ import java.util.concurrent.locks.ReentrantLock; /** * 基于服务质量的连接池 - * @author Liang Liuwei(liangliuwei@qiyi.com) + * @author shamphone@gmail.com + * @version 1.0.0 */ public class BasicQosTransportPool extends RefreshableTransportPool { private static Logger LOG = LoggerFactory.getLogger(BasicQosTransportPool.class); @@ -106,7 +106,7 @@ public class BasicQosTransportPool extends RefreshableTransportPool { /* * (non-Javadoc) - * @see com.qiyi.knowledge.thrift.sharder.RefreshableTransportPool# + * @see org.jigsaw.payment.rpc.sharder.RefreshableTransportPool# * isInstanceAvailable(org.apache.curator.x.discovery.ServiceInstance) */ @Override @@ -118,7 +118,7 @@ public class BasicQosTransportPool extends RefreshableTransportPool { /* * (non-Javadoc) * @see - * com.qiyi.knowledge.thrift.sharder.AbstractTransportPool#markError(org + * org.jigsaw.payment.rpc.sharder.AbstractTransportPool#markError(org * .apache.curator.x.discovery.ServiceInstance) */ @Override diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/BasicTransportPool.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/BasicTransportPool.java similarity index 89% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/BasicTransportPool.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/BasicTransportPool.java index eb24ed2..7577209 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/BasicTransportPool.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/BasicTransportPool.java @@ -1,19 +1,19 @@ -/******************************************************* - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of Knowlege Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - *******************************************************/ -package com.qiyi.knowledge.thrift.sharder; +package org.jigsaw.payment.rpc.sharder; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.curator.x.discovery.ServiceInstance; +import org.jigsaw.payment.rpc.register.RpcPayload; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import com.qiyi.knowledge.thrift.register.RpcPayload; -import org.apache.curator.x.discovery.ServiceInstance; -import org.apache.log4j.Logger; - -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicInteger; /** * 最简单的连接池实现:
      @@ -39,11 +39,11 @@ import java.util.concurrent.atomic.AtomicInteger; *
    *

    * - * @author Li Hengjun - * @version 1.0.0 5/16/16 + * @author shamphone@gmail.com + * @version 1.0.0 **/ public class BasicTransportPool extends RefreshableTransportPool { - private static Logger LOG = Logger.getLogger(BasicTransportPool.class); + private static Logger LOG = LoggerFactory.getLogger(BasicTransportPool.class); /** * 可用的server队列的最多个数 */ @@ -162,7 +162,7 @@ public class BasicTransportPool extends RefreshableTransportPool { /* * (non-Javadoc) - * @see com.qiyi.knowledge.thrift.sharder.RefreshableTransportPool# + * @see org.jigsaw.payment.rpc.sharder.RefreshableTransportPool# * isInstanceAvailable(org.apache.curator.x.discovery.ServiceInstance) */ @Override @@ -182,7 +182,7 @@ public class BasicTransportPool extends RefreshableTransportPool { /* * (non-Javadoc) * @see - * com.qiyi.knowledge.thrift.sharder.AbstractTransportPool#markError(org + * org.jigsaw.payment.rpc.sharder.AbstractTransportPool#markError(org * .apache.curator.x.discovery.ServiceInstance) */ @Override diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledException.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledException.java similarity index 59% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledException.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledException.java index cc650cd..68ff2b4 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/PooledException.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledException.java @@ -1,15 +1,9 @@ -/******************************************************* - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of Knowlege Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - *******************************************************/ -package com.qiyi.knowledge.thrift.sharder; +package org.jigsaw.payment.rpc.sharder; /** - * pool exception - * @author Li Hengjun - * @version 1.0.0 5/16/16 + * 连接池异常 + * @author shamphone@gmail.com + * @version 1.0.0 **/ public class PooledException extends RuntimeException{ diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledTransport.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledTransport.java new file mode 100644 index 0000000..d9042a4 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/PooledTransport.java @@ -0,0 +1,20 @@ +package org.jigsaw.payment.rpc.sharder; + +import org.apache.commons.pool2.impl.DefaultPooledObject; +import org.apache.thrift.transport.TTransport; + +/** + * An wrapper on TTransport to support pooling . + * + * @author shamphone@gmail.com + * @version 1.0.0 + **/ +public class PooledTransport extends DefaultPooledObject { + /** + * @param transport + */ + public PooledTransport(TTransport transport) { + super(transport); + } + +} \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/RefreshableTransportPool.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RefreshableTransportPool.java similarity index 91% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/RefreshableTransportPool.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RefreshableTransportPool.java index 2285d0a..d21914a 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/RefreshableTransportPool.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RefreshableTransportPool.java @@ -1,15 +1,10 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - **/ -package com.qiyi.knowledge.thrift.sharder; +package org.jigsaw.payment.rpc.sharder; + +import java.io.IOException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; -import com.qiyi.knowledge.thrift.register.JsonSerializer; -import com.qiyi.knowledge.thrift.register.RpcPayload; import org.apache.commons.lang3.ArrayUtils; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.ChildData; @@ -21,12 +16,10 @@ import org.apache.curator.utils.CloseableExecutorService; import org.apache.curator.utils.PathUtils; import org.apache.curator.x.discovery.ServiceInstance; import org.apache.curator.x.discovery.details.InstanceSerializer; -import org.apache.log4j.Logger; - -import java.io.IOException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; +import org.jigsaw.payment.rpc.register.JsonSerializer; +import org.jigsaw.payment.rpc.register.RpcPayload; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * TProtocol 连接池客户端。 其sharding的策略: @@ -34,13 +27,13 @@ import java.util.concurrent.ThreadFactory; *
  • 优先选择同网段的服务器
  • *
  • 优先选择QPS高的服务器
  • * - * @author Li Hengjun + * @author shamphone@gmail.com * @version 1.0.0 5/16/16 **/ public abstract class RefreshableTransportPool extends AbstractTransportPool implements PathChildrenCacheListener { - private static Logger LOG = Logger + private static Logger LOG = LoggerFactory .getLogger(RefreshableTransportPool.class); /** * this curator client; @@ -136,7 +129,7 @@ public abstract class RefreshableTransportPool extends AbstractTransportPool } this.cache.getListenable().addListener(this); this.cache.start(StartMode.POST_INITIALIZED_EVENT); - // this.prepareInstances(); + //this.prepareInstances(); // call super to initialize the pool; super.start(); LOG.info("transport pooling factory started. "); diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcPayload.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcPayload.java new file mode 100644 index 0000000..d1413ca --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcPayload.java @@ -0,0 +1,71 @@ +package org.jigsaw.payment.rpc.sharder; + +import org.codehaus.jackson.annotate.JsonAutoDetect; +import org.codehaus.jackson.map.annotate.JsonRootName; + +/** + * A payload dao for register (thrift) RPC Server to zookeeper. The sharder + * provider would use this information for choose appropriate server. + * + * @author shamphone@gmail.com + * + */ +@JsonRootName("rpc") +@JsonAutoDetect +public class RpcPayload implements java.io.Serializable { + + /** + * + */ + private static final long serialVersionUID = -1805209922621329565L; + /** + * max qps that could be provided by this server; + */ + private long maxQps = 1000l; + /** + * the transport type in used: + *
      + *
    • socket:TSocket
    • + *
    • framed-transport : TFramedTransport
    • + *
    • file-transport: TFileTransport
    • + *
    • non-blocking-socket:TNonblockingTransport
    • + *
    • http-client:THttpClient
    • + *
    + */ + private String transport = "socket"; + /** + * the protocol type in used: + *
      + *
    • binary : TBinaryProtocol
    • + *
    • compact: TCompactProtocol
    • + *
    • json: TJSONProtocol
    • + *
    • simple-json: TSimpleJSONProtocol
    • + *
    + */ + private String protocol = "binary"; + + public long getMaxQps() { + return maxQps; + } + + public void setMaxQps(long maxQps) { + this.maxQps = maxQps; + } + + public String getTransport() { + return transport; + } + + public void setTransport(String transport) { + this.transport = transport; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + +} \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcServiceClient.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcServiceClient.java new file mode 100644 index 0000000..6f6a496 --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/RpcServiceClient.java @@ -0,0 +1,104 @@ +package org.jigsaw.payment.rpc.sharder; + +import java.lang.reflect.InvocationTargetException; +import java.nio.ByteBuffer; + +import org.apache.commons.beanutils.MethodUtils; +import org.apache.thrift.TBase; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.transport.TTransport; +import org.jigsaw.payment.rpc.BaseService; +import org.jigsaw.payment.rpc.SystemException; + +import com.google.protobuf.Message; + +/** + * 调用RPC的客户端 + * @author shamphone@gmail.com + */ +public class RpcServiceClient { + /** + * Transport 连接池 + */ + protected TransportManager transportManager; + public void setTransportManager( TransportManager transportManager){ + this.transportManager = transportManager; + + } + + + + /** + * 调用RPC的通用方法。这里的实现方法是通过对BaseService的execute调用进行转换,这使得其他的RPC调用不需要再定义thrift 方法,仅需定义输入输出的protobuf message。 + * @param serviceName:RPC服务方法名 + * @param request: 请求的message + * @param responseClass: 返回的response类型 + * @return rpc调用结果 + * @throws TException 调用中发生的错误 + */ + public Response execute( + final String serviceName, final Request request, + final Class responseClass) throws TException { + TTransport transport = null; + try { + transport = this.transportManager.getTransport(); + TBinaryProtocol protocol = new TBinaryProtocol(transport); + BaseService.Client client = new BaseService.Client(protocol) { + /** + * 替换BaseService中的methodName(硬编码为execute)为对应的服务名。 + */ + protected void sendBase(String methodName, TBase args) + throws TException { + super.sendBase(serviceName, args); + } + + /** + * 替换BaseService中的methodName(硬编码为execute)为对应的服务名。 + */ + protected void sendBaseOneway(String methodName, + TBase args) throws TException { + super.sendBaseOneway(serviceName, args); + } + + /** + * 替换BaseService中的methodName(硬编码为execute)为对应的服务名。 + */ + protected void receiveBase(TBase result, String methodName) + throws TException { + super.receiveBase(result, serviceName); + } + }; + ByteBuffer responseBuffer = client.execute(ByteBuffer.wrap(request + .toByteArray())); + return this.parseFrom(responseClass, responseBuffer.array()); + } finally { + if (transport != null) { + transport.close(); + } + } + } + + /** + * 将protobuf字节流转换为对应的message对象。 + * + * @param messageClass + * @return + */ + @SuppressWarnings("unchecked") + protected T parseFrom(Class messageClass, + byte[] bytes) throws SystemException { + T message = null; + try { + message = (T) MethodUtils.invokeStaticMethod(messageClass, + "parseFrom", bytes); + } catch (NoSuchMethodException | IllegalAccessException + | InvocationTargetException e) { + SystemException ex = new SystemException(); + ex.setErrorCode(500); + ex.setMessage(e.getMessage()); + throw ex; + } + return message; + } +} diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/StaticQpsTransportPool.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/StaticQpsTransportPool.java similarity index 89% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/StaticQpsTransportPool.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/StaticQpsTransportPool.java index cc6c741..d09772e 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/StaticQpsTransportPool.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/StaticQpsTransportPool.java @@ -1,13 +1,18 @@ -package com.qiyi.knowledge.thrift.sharder; - -import com.qiyi.knowledge.thrift.register.RpcPayload; +package org.jigsaw.payment.rpc.sharder; import org.apache.curator.x.discovery.ServiceInstance; +import org.jigsaw.payment.rpc.register.RpcPayload; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.concurrent.atomic.AtomicInteger; + +/** + * 静态qps连接池 + * @author shamphone@gmail.com + * @version 1.0.0 + */ public class StaticQpsTransportPool extends BasicTransportPool { private static Logger LOG = LoggerFactory.getLogger(StaticQpsTransportPool.class); diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TTransportWrapper.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/TTransportWrapper.java similarity index 89% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TTransportWrapper.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/TTransportWrapper.java index 2743c6c..efebdf5 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TTransportWrapper.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/TTransportWrapper.java @@ -1,15 +1,9 @@ -/******************************************************* - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of Knowlege Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - *******************************************************/ -package com.qiyi.knowledge.thrift.sharder; +package org.jigsaw.payment.rpc.sharder; -import com.qiyi.knowledge.thrift.register.RpcPayload; import org.apache.curator.x.discovery.ServiceInstance; import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException; +import org.jigsaw.payment.rpc.register.RpcPayload; /** @@ -17,8 +11,8 @@ import org.apache.thrift.transport.TTransportException; * closed, it will be return to the pool. It will be marked as invalid when * exception happened in transfering. * - * @author Li Hengjun - * @version 1.0.0 5/16/16 + * @author shamphone@gmail.com + * @version 1.0.0 **/ public abstract class TTransportWrapper extends TTransport { private TTransport transport; diff --git a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportManager.java b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/TransportManager.java similarity index 76% rename from jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportManager.java rename to jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/TransportManager.java index ed35869..4a3bc59 100644 --- a/jigsaw-thrift-protobuf/src/main/java/com/qiyi/knowledge/thrift/sharder/TransportManager.java +++ b/jigsaw-thrift-protobuf/src/main/java/org/jigsaw/payment/rpc/sharder/TransportManager.java @@ -1,10 +1,4 @@ -/******************************************************* - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of Knowlege Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - *******************************************************/ -package com.qiyi.knowledge.thrift.sharder; +package org.jigsaw.payment.rpc.sharder; import org.apache.thrift.TException; import org.apache.thrift.transport.TTransport; @@ -22,8 +16,8 @@ A TransportManager object has properties that can be modified when necessary. For example, if the transport manager is moved to a different server, the property for the server can be changed. The benefit is that because the transport manager's properties can be changed, any code accessing that transport manager does not need to be changed. - * @author Li Hengjun - * @version 1.0.0 5/16/16 + * @author shamphone@gmail.com + * @version 1.0.0 **/ public interface TransportManager { /** diff --git a/jigsaw-thrift-protobuf/src/main/resources/rpc_service.thrift b/jigsaw-thrift-protobuf/src/main/resources/rpc_service.thrift new file mode 100644 index 0000000..adde2ae --- /dev/null +++ b/jigsaw-thrift-protobuf/src/main/resources/rpc_service.thrift @@ -0,0 +1,79 @@ +namespace java org.jigsaw.payment.rpc + + +/** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem in the service that could not be changed through caller action. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * message: This may contain additional information about the error + * + * rateLimitDuration: Indicates the minimum number of seconds that an application should + * expect subsequent API calls for this user to fail. The application should not retry + * API requests for the user until at least this many seconds have passed. Present only + * when errorCode is RATE_LIMIT_REACHED, + */ +exception SystemException { + 1: required i32 errorCode, + 2: optional string message +} + + +/** + * This exception is thrown by EDAM procedures when a caller asks to perform + * an operation on an object that does not exist. This may be thrown based on an invalid + * primary identifier (e.g. a bad GUID), or when the caller refers to an object + * by another unique identifier (e.g. a User's email address). + * + * identifier: A description of the object that was not found on the server. + * For example, "Note.notebookGuid" when a caller attempts to create a note in a + * notebook that does not exist in the user's account. + * + * key: The value passed from the client in the identifier, which was not + * found. For example, the GUID that was not found. + */ +exception NotFoundException { + 1: optional string identifier, + 2: optional string key +} + + +/** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem that a caller may be able to resolve. For example, if the user + * attempts to add a note to their account which would exceed their storage + * quota, this type of exception may be thrown to indicate the source of the + * error so that they can choose an alternate action. + * + * This exception would not be used for internal system errors that do not + * reflect user actions, but rather reflect a problem within the service that + * the user cannot resolve. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * message: This may contain additional information about the error. + */ +exception UserException { + 1: required i32 errorCode, + 2: optional string message +} + + +/** + * 这个类定义通用的Protobuf作为Protocol的服务 + * + */ +service BaseService { + /** + * 通用的execute服务。 + **/ + binary execute(1:binary request) + throws( 1:NotFoundException notFoundException, + 2:SystemException systemException, + 3:UserException userException + ); + +} \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/Appconfig.java b/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/Appconfig.java deleted file mode 100644 index fd2e459..0000000 --- a/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/Appconfig.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi qiyipay Tool project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - ***/ -package com.qiyi.knowledge.thrift.server; - -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; -import org.springframework.jdbc.datasource.DataSourceUtils; -import org.springframework.test.context.ActiveProfiles; - -import javax.sql.DataSource; - -/** - * @author lihengjun@qiyi.com - * @time 5/15/17 - */ -@Configuration -@Import(DataSourceAutoConfiguration.class) -@PropertySource("application.properties") -public class Appconfig { - - @Bean - public TradeRepository tradeRepository(DataSource dataSource) { - return new TradeRepository(); - } -} diff --git a/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepositoryTest.java b/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepositoryTest.java deleted file mode 100644 index 2913b99..0000000 --- a/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/BaseProtobufRepositoryTest.java +++ /dev/null @@ -1,311 +0,0 @@ -package com.qiyi.knowledge.thrift.server; - -import com.google.protobuf.Descriptors; - -import com.iqiyi.pay.sdk.EntityType; -import com.iqiyi.pay.sdk.Trade; -import com.iqiyi.pay.sdk.TradeStatus; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; - -/** - * @author lihengjun@qiyi.com - * @time 5/15/17 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration(classes = Appconfig.class) -@ActiveProfiles("dev") -public class BaseProtobufRepositoryTest { - @Autowired - TradeRepository tradeRepository; - long uid = 1012977600; - int partnerId = 1; - String code = "1111111111111"; - String tableName = "pay_trade_0"; - Trade trade; - long time = (System.currentTimeMillis() / 1000) * 1000;//去掉毫秒数 - List list = new ArrayList<>(); - List codeList = new ArrayList<>(); - - @Before - public void init() { - for (int i = 0; i < 1; i++) { - Trade.Builder tb = Trade.newBuilder(); - tb.setId(1111111111111L); - tb.setCode(code); - tb.setPayIndex(1); - tb.setPayScenarios(1); - tb.setSubId(uid); - tb.setAppId("123"); - tb.setReturnUrl("123"); - tb.setNotifyUrl("123"); - tb.setPartnerId(partnerId); - tb.setFee(123); - tb.setFeeReal(123); - tb.setPartnerOrderNo(uid + "" + i); - tb.setParentId(1); - tb.setCurrentKey(122); - tb.setSubType(EntityType.USER); - tb.setDestPayType(344); - tb.setSourcePayType(261); - tb.setStatus(TradeStatus.UNPAID); - tb.setSubIp("44.23465.2"); - tb.setOrderId("8888"); - tb.setCreateTime(time); - tb.setUpdateTime(time); - tb.setExpireTime(time); - tb.setPayTime(time); - tb.setThirdCreateTime(time); - tb.setThirdPayTime(time); - updateBuilder(tb, 1); - - trade = tb.build(); - list.add(trade); - } - } - private void updateBuilder(Trade.Builder tb, int loadFactor) { - this.updateBuilder(tb,loadFactor,null); - } - private void updateBuilder(Trade.Builder tb, int loadFactor,String[] excludeFields) { - Set set = null; - if (excludeFields != null && excludeFields.length > 0) { - set = new HashSet<>(Arrays.asList(excludeFields)); - } - - final Descriptors.Descriptor descriptor = tb.getDescriptorForType(); - for (Descriptors.FieldDescriptor fieldDescriptor : descriptor.getFields()) { - if(set!=null&&set.contains(fieldDescriptor.getName())){ - continue; - } - switch (fieldDescriptor.getJavaType()) { - case LONG: - tb.setField(fieldDescriptor, 10000000 + loadFactor * 10000); - break; - case DOUBLE: - tb.setField(fieldDescriptor, 100000 + loadFactor); - break; - case INT: - tb.setField(fieldDescriptor, 10 + loadFactor); - break; - case STRING: - tb.setField(fieldDescriptor, "test" + loadFactor); - break; - case ENUM: - tb.setField(fieldDescriptor, fieldDescriptor.getEnumType().getValues().get(1)); - break; - default: - break; - } - } - } - - - private void validate(Trade expected, Trade actual) { - this.validate(expected, actual, null); - } - - private void validate(Trade expected, Trade actual, String[] notEquals) { - final Descriptors.Descriptor descriptor = actual.getDescriptorForType(); - Set set = null; - if (notEquals != null && notEquals.length > 0) { - set = new HashSet<>(Arrays.asList(notEquals)); - } - for (Descriptors.FieldDescriptor fieldDescriptor : descriptor.getFields()) { - if (set != null && set.contains(fieldDescriptor.getName())) { - assertNotEquals(fieldDescriptor.getName() + " is equal", actual.getField(fieldDescriptor), expected.getField(fieldDescriptor)); - } else { - assertEquals(fieldDescriptor.getName() + " is not equal", actual.getField(fieldDescriptor), expected.getField(fieldDescriptor)); - } - } - } - - @Test - public void insertMessage() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 10); - final Trade trade2 = builder.build(); - delete(trade2.getCode()); - final long count = tradeRepository.insertMessage(trade2, new String[]{}); - assertEquals(1, count); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode())); - delete(trade2.getCode()); - } - - @Test - public void insertMessage1() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 11); - final Trade trade2 = builder.build(); - delete(trade2.getCode()); - assertEquals(1, tradeRepository.insertMessage(trade2, tableName)); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode())); - delete(trade2.getCode()); - } - - @Test - public void insertMessage2() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 13); - final Trade trade2 = builder.build(); - delete(trade2.getCode()); - assertEquals(1, tradeRepository.insertMessage(trade2, new String[]{"create_time"}, tableName)); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode()), new String[]{"create_time"}); - delete(trade2.getCode()); - } - - @Test - public void insertMessage3() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 2); - final Trade trade2 = builder.build(); - delete(trade2.getCode()); - assertEquals(1, tradeRepository.insertMessage(trade2)); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode())); - delete(trade2.getCode()); - } - - @Test - public void insertOrUpdateMessage1() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 2); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(builder.build()); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.insertOrUpdateMessage(trade2, new String[]{"create_time","update_time"}); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode()), new String[]{"create_time","update_time"}); - delete(trade2.getCode()); - } - - @Test - public void insertOrUpdateMessage2() throws Exception { - - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 2); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(builder.build()); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.insertOrUpdateMessage(trade2, new String[]{"create_time","update_time"}); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode()), new String[]{"create_time","update_time"}); - delete(trade2.getCode()); - } - - @Test - public void insertOrUpdateMessage3() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 2); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(trade2); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.insertOrUpdateMessage(trade2,tableName); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode())); - delete(trade2.getCode()); - } - - @Test - public void insertOrUpdateMessage4() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 2); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(trade2); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.insertOrUpdateMessage(trade2, new String[]{"create_time","update_time"}, tableName); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode()), new String[]{"create_time","update_time"}); - delete(trade2.getCode()); - - } - - @Test - public void updateMessageByCondition() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 20); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(trade2); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.updateMessageByCondition(trade2, new String[]{"create_time","update_time"},new String[]{"code"},new Object[]{trade2.getCode()} ); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode()), new String[]{"create_time","update_time"}); - delete(trade2.getCode()); - } - - @Test - public void updateMessageByCondition1() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 21); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(trade2); - this.updateBuilder(builder, 11,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.updateMessageByCondition(trade2, new String[]{"create_time","update_time"},new String[]{"code"},new Object[]{trade2.getCode()},tableName ); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode()), new String[]{"create_time","update_time"}); - delete(trade2.getCode()); - } - - @Test - public void updateMessageByCondition2() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 22); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(trade2); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.updateMessageByCondition(trade2,new String[]{"code"},new Object[]{trade2.getCode()},tableName ); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode())); - delete(trade2.getCode()); - } - - @Test - public void updateMessageByCondition3() throws Exception { - Trade.Builder builder = Trade.newBuilder(trade); - this.updateBuilder(builder, 22); - Trade trade2 = builder.build(); - delete(trade2.getCode()); - long count = tradeRepository.insertOrUpdateMessage(trade2); - this.updateBuilder(builder, 21,new String[]{"code"}); - trade2 =builder.build(); - count += tradeRepository.updateMessageByCondition(trade2,new String[]{"code"},new Object[]{trade2.getCode()}); - assertTrue(count>=2); - this.validate(trade2, tradeRepository.queryByCode(trade2.getCode())); - delete(trade2.getCode()); - } - - - private int delete(String code) { - final int update = tradeRepository.update("delete from pay_trade_0 where code=?", code); - System.out.print("delete count:" + update); - return update; - } -} \ No newline at end of file diff --git a/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/TradeRepository.java b/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/TradeRepository.java deleted file mode 100644 index ed340f3..0000000 --- a/jigsaw-thrift-protobuf/src/test/java/com/qiyi/knowledge/thrift/server/TradeRepository.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * ***************************************************** - * Copyright (C) 2016 iQIYI.COM - All Rights Reserved - * This file is part of iQiyi Pay project. - * Unauthorized copy of this file, via any medium is strictly prohibited. - * Proprietary and Confidential. - * **************************************************** - */ -package com.qiyi.knowledge.thrift.server; - - -import com.iqiyi.pay.sdk.Trade; -import com.qiyi.knowledge.thrift.server.BaseProtobufRepository; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -import javax.sql.DataSource; - -/** - * mysql实时库 - * - * @author zhangchong@qiyi.com - * - */ -@Repository -public class TradeRepository extends BaseProtobufRepository { - - public TradeRepository() { - super(Trade.class, "pay_trade_0"); - } - - @Autowired - public void setDataSource(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); - namedParameterJdbcTemplate=new NamedParameterJdbcTemplate(dataSource); - } - - public long create(Trade trade) { - return insertMessage(trade); - } - - public long createOrUpdate(Trade trade) { - return insertOrUpdateMessage(trade); - } - - public int update(Trade trade){ - //possible? - if(StringUtils.isNotBlank(trade.getExtraParams())&&trade.getExtraParams().length()>=1024) - trade=trade.toBuilder().setExtraParams("").build(); - return updateMessageByCondition(trade,new String[]{"sub_id","code"},new String[]{String.valueOf(trade.getSubId()),trade.getCode()}); - } - - public Trade queryByCode(String code) { - return queryObjectByCondition(new String[]{"code"},new String[]{code}); - } - - public Trade queryByCode(String code,String uid) { - return queryObjectByCondition(new String[]{"sub_id","code"},new String[]{uid,code}); - } - - public Trade queryByPartnerOrderNo(int partnerId,String partnerOrderNo) { - return queryObjectByCondition(new String[]{"partner_id","partner_order_no"},new Object[]{Integer.valueOf(partnerId),partnerOrderNo}); - } - -} diff --git a/jigsaw-thrift-protobuf/src/test/resources/application.properties b/jigsaw-thrift-protobuf/src/test/resources/application.properties deleted file mode 100644 index c292b70..0000000 --- a/jigsaw-thrift-protobuf/src/test/resources/application.properties +++ /dev/null @@ -1,19 +0,0 @@ -spring.profiles.active=dev -#datasource setting - -#ds_00 setting - -spring.datasource.url=jdbc:mysql://cq.paytest.w.qiyi.db:8767/pay_trade_0?useUnicode=true&autoReconnect=true&&zeroDateTimeBehavior=convertToNull -spring.datasource.username=pay_test -spring.datasource.password=1w2E5L_o6V3e_iqiyi -spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.datasource.max-idle=2 -spring.datasource.max-wait=10000 -spring.datasource.min-idle=2 -spring.datasource.initial-size=2 -spring.datasource.validation-query=SELECT 1 -spring.datasource.test-on-borrow=false -spring.datasource.test-while-idle=true -spring.datasource.time-between-eviction-runs-millis=18800 -spring.datasource.jdbc-interceptors=ConnectionState; - diff --git a/libs/jigsaw-rpc-example-server-1.0.0-SNAPSHOT.jar b/libs/jigsaw-rpc-example-server-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..34836e292bdb8eb5a3e3a243bc0cebc61b984537 GIT binary patch literal 68588 zcma&M18}a-w?^Q-d)wJmx44HI1I?YeVdj)rT=H+KPu>d{<5Mfg0zxyV)P3C0s9HE@egeDGSbiL zpYFha3flh{CMzf>DJH6{LMJQsAUicFBTY*;4=+tiH8VBaq{Ohq{O8D#Mrvk^Mw(XW zC)8oFS~3Q8KZ$!sc9asTw34!O4pj{rE-XqCvl6;D>ZH=cKRr^+PE!5*oEhi>(`ObH z9%o2{a2v9p@)sBt@D3jfcbwmaI`o6FO2a2??%RUwg8L&YAbmEcUyB)Yi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