PageRenderTime 54ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 2ms

/core/src/main/java/org/bitcoin/paymentchannel/Protos.java

https://code.google.com/
Java | 8084 lines | 5525 code | 450 blank | 2109 comment | 830 complexity | 90fedbd2bcfe7f60ebb0059125ba9f1c MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: paymentchannel.proto
  3. package org.bitcoin.paymentchannel;
  4. public final class Protos {
  5. private Protos() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public interface TwoWayChannelMessageOrBuilder
  10. extends com.google.protobuf.MessageOrBuilder {
  11. // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;
  12. /**
  13. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  14. *
  15. * <pre>
  16. * This is required so if a new message type is added in future, old software aborts trying
  17. * to read the message as early as possible. If the message doesn't parse, the socket should
  18. * be closed.
  19. * </pre>
  20. */
  21. boolean hasType();
  22. /**
  23. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  24. *
  25. * <pre>
  26. * This is required so if a new message type is added in future, old software aborts trying
  27. * to read the message as early as possible. If the message doesn't parse, the socket should
  28. * be closed.
  29. * </pre>
  30. */
  31. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType();
  32. // optional .paymentchannels.ClientVersion client_version = 2;
  33. /**
  34. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  35. *
  36. * <pre>
  37. * Now one optional field for each message. Only the field specified by type should be read.
  38. * </pre>
  39. */
  40. boolean hasClientVersion();
  41. /**
  42. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  43. *
  44. * <pre>
  45. * Now one optional field for each message. Only the field specified by type should be read.
  46. * </pre>
  47. */
  48. org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion();
  49. /**
  50. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  51. *
  52. * <pre>
  53. * Now one optional field for each message. Only the field specified by type should be read.
  54. * </pre>
  55. */
  56. org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder();
  57. // optional .paymentchannels.ServerVersion server_version = 3;
  58. /**
  59. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  60. */
  61. boolean hasServerVersion();
  62. /**
  63. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  64. */
  65. org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion();
  66. /**
  67. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  68. */
  69. org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder();
  70. // optional .paymentchannels.Initiate initiate = 4;
  71. /**
  72. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  73. */
  74. boolean hasInitiate();
  75. /**
  76. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  77. */
  78. org.bitcoin.paymentchannel.Protos.Initiate getInitiate();
  79. /**
  80. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  81. */
  82. org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder();
  83. // optional .paymentchannels.ProvideRefund provide_refund = 5;
  84. /**
  85. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  86. */
  87. boolean hasProvideRefund();
  88. /**
  89. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  90. */
  91. org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund();
  92. /**
  93. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  94. */
  95. org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder();
  96. // optional .paymentchannels.ReturnRefund return_refund = 6;
  97. /**
  98. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  99. */
  100. boolean hasReturnRefund();
  101. /**
  102. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  103. */
  104. org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund();
  105. /**
  106. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  107. */
  108. org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder();
  109. // optional .paymentchannels.ProvideContract provide_contract = 7;
  110. /**
  111. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  112. */
  113. boolean hasProvideContract();
  114. /**
  115. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  116. */
  117. org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract();
  118. /**
  119. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  120. */
  121. org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder();
  122. // optional .paymentchannels.UpdatePayment update_payment = 8;
  123. /**
  124. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  125. */
  126. boolean hasUpdatePayment();
  127. /**
  128. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  129. */
  130. org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment();
  131. /**
  132. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  133. */
  134. org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder();
  135. // optional .paymentchannels.Close close = 9;
  136. /**
  137. * <code>optional .paymentchannels.Close close = 9;</code>
  138. */
  139. boolean hasClose();
  140. /**
  141. * <code>optional .paymentchannels.Close close = 9;</code>
  142. */
  143. org.bitcoin.paymentchannel.Protos.Close getClose();
  144. /**
  145. * <code>optional .paymentchannels.Close close = 9;</code>
  146. */
  147. org.bitcoin.paymentchannel.Protos.CloseOrBuilder getCloseOrBuilder();
  148. // optional .paymentchannels.Error error = 10;
  149. /**
  150. * <code>optional .paymentchannels.Error error = 10;</code>
  151. */
  152. boolean hasError();
  153. /**
  154. * <code>optional .paymentchannels.Error error = 10;</code>
  155. */
  156. org.bitcoin.paymentchannel.Protos.Error getError();
  157. /**
  158. * <code>optional .paymentchannels.Error error = 10;</code>
  159. */
  160. org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder();
  161. }
  162. /**
  163. * Protobuf type {@code paymentchannels.TwoWayChannelMessage}
  164. *
  165. * <pre>
  166. * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
  167. * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
  168. * and "secondary" as "server".
  169. * </pre>
  170. */
  171. public static final class TwoWayChannelMessage extends
  172. com.google.protobuf.GeneratedMessage
  173. implements TwoWayChannelMessageOrBuilder {
  174. // Use TwoWayChannelMessage.newBuilder() to construct.
  175. private TwoWayChannelMessage(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  176. super(builder);
  177. this.unknownFields = builder.getUnknownFields();
  178. }
  179. private TwoWayChannelMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  180. private static final TwoWayChannelMessage defaultInstance;
  181. public static TwoWayChannelMessage getDefaultInstance() {
  182. return defaultInstance;
  183. }
  184. public TwoWayChannelMessage getDefaultInstanceForType() {
  185. return defaultInstance;
  186. }
  187. private final com.google.protobuf.UnknownFieldSet unknownFields;
  188. @java.lang.Override
  189. public final com.google.protobuf.UnknownFieldSet
  190. getUnknownFields() {
  191. return this.unknownFields;
  192. }
  193. private TwoWayChannelMessage(
  194. com.google.protobuf.CodedInputStream input,
  195. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  196. throws com.google.protobuf.InvalidProtocolBufferException {
  197. initFields();
  198. int mutable_bitField0_ = 0;
  199. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  200. com.google.protobuf.UnknownFieldSet.newBuilder();
  201. try {
  202. boolean done = false;
  203. while (!done) {
  204. int tag = input.readTag();
  205. switch (tag) {
  206. case 0:
  207. done = true;
  208. break;
  209. default: {
  210. if (!parseUnknownField(input, unknownFields,
  211. extensionRegistry, tag)) {
  212. done = true;
  213. }
  214. break;
  215. }
  216. case 8: {
  217. int rawValue = input.readEnum();
  218. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(rawValue);
  219. if (value == null) {
  220. unknownFields.mergeVarintField(1, rawValue);
  221. } else {
  222. bitField0_ |= 0x00000001;
  223. type_ = value;
  224. }
  225. break;
  226. }
  227. case 18: {
  228. org.bitcoin.paymentchannel.Protos.ClientVersion.Builder subBuilder = null;
  229. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  230. subBuilder = clientVersion_.toBuilder();
  231. }
  232. clientVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ClientVersion.PARSER, extensionRegistry);
  233. if (subBuilder != null) {
  234. subBuilder.mergeFrom(clientVersion_);
  235. clientVersion_ = subBuilder.buildPartial();
  236. }
  237. bitField0_ |= 0x00000002;
  238. break;
  239. }
  240. case 26: {
  241. org.bitcoin.paymentchannel.Protos.ServerVersion.Builder subBuilder = null;
  242. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  243. subBuilder = serverVersion_.toBuilder();
  244. }
  245. serverVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ServerVersion.PARSER, extensionRegistry);
  246. if (subBuilder != null) {
  247. subBuilder.mergeFrom(serverVersion_);
  248. serverVersion_ = subBuilder.buildPartial();
  249. }
  250. bitField0_ |= 0x00000004;
  251. break;
  252. }
  253. case 34: {
  254. org.bitcoin.paymentchannel.Protos.Initiate.Builder subBuilder = null;
  255. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  256. subBuilder = initiate_.toBuilder();
  257. }
  258. initiate_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Initiate.PARSER, extensionRegistry);
  259. if (subBuilder != null) {
  260. subBuilder.mergeFrom(initiate_);
  261. initiate_ = subBuilder.buildPartial();
  262. }
  263. bitField0_ |= 0x00000008;
  264. break;
  265. }
  266. case 42: {
  267. org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder subBuilder = null;
  268. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  269. subBuilder = provideRefund_.toBuilder();
  270. }
  271. provideRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideRefund.PARSER, extensionRegistry);
  272. if (subBuilder != null) {
  273. subBuilder.mergeFrom(provideRefund_);
  274. provideRefund_ = subBuilder.buildPartial();
  275. }
  276. bitField0_ |= 0x00000010;
  277. break;
  278. }
  279. case 50: {
  280. org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder subBuilder = null;
  281. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  282. subBuilder = returnRefund_.toBuilder();
  283. }
  284. returnRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ReturnRefund.PARSER, extensionRegistry);
  285. if (subBuilder != null) {
  286. subBuilder.mergeFrom(returnRefund_);
  287. returnRefund_ = subBuilder.buildPartial();
  288. }
  289. bitField0_ |= 0x00000020;
  290. break;
  291. }
  292. case 58: {
  293. org.bitcoin.paymentchannel.Protos.ProvideContract.Builder subBuilder = null;
  294. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  295. subBuilder = provideContract_.toBuilder();
  296. }
  297. provideContract_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideContract.PARSER, extensionRegistry);
  298. if (subBuilder != null) {
  299. subBuilder.mergeFrom(provideContract_);
  300. provideContract_ = subBuilder.buildPartial();
  301. }
  302. bitField0_ |= 0x00000040;
  303. break;
  304. }
  305. case 66: {
  306. org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = null;
  307. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  308. subBuilder = updatePayment_.toBuilder();
  309. }
  310. updatePayment_ = input.readMessage(org.bitcoin.paymentchannel.Protos.UpdatePayment.PARSER, extensionRegistry);
  311. if (subBuilder != null) {
  312. subBuilder.mergeFrom(updatePayment_);
  313. updatePayment_ = subBuilder.buildPartial();
  314. }
  315. bitField0_ |= 0x00000080;
  316. break;
  317. }
  318. case 74: {
  319. org.bitcoin.paymentchannel.Protos.Close.Builder subBuilder = null;
  320. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  321. subBuilder = close_.toBuilder();
  322. }
  323. close_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Close.PARSER, extensionRegistry);
  324. if (subBuilder != null) {
  325. subBuilder.mergeFrom(close_);
  326. close_ = subBuilder.buildPartial();
  327. }
  328. bitField0_ |= 0x00000100;
  329. break;
  330. }
  331. case 82: {
  332. org.bitcoin.paymentchannel.Protos.Error.Builder subBuilder = null;
  333. if (((bitField0_ & 0x00000200) == 0x00000200)) {
  334. subBuilder = error_.toBuilder();
  335. }
  336. error_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Error.PARSER, extensionRegistry);
  337. if (subBuilder != null) {
  338. subBuilder.mergeFrom(error_);
  339. error_ = subBuilder.buildPartial();
  340. }
  341. bitField0_ |= 0x00000200;
  342. break;
  343. }
  344. }
  345. }
  346. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  347. throw e.setUnfinishedMessage(this);
  348. } catch (java.io.IOException e) {
  349. throw new com.google.protobuf.InvalidProtocolBufferException(
  350. e.getMessage()).setUnfinishedMessage(this);
  351. } finally {
  352. this.unknownFields = unknownFields.build();
  353. makeExtensionsImmutable();
  354. }
  355. }
  356. public static final com.google.protobuf.Descriptors.Descriptor
  357. getDescriptor() {
  358. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  359. }
  360. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  361. internalGetFieldAccessorTable() {
  362. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable
  363. .ensureFieldAccessorsInitialized(
  364. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class);
  365. }
  366. public static com.google.protobuf.Parser<TwoWayChannelMessage> PARSER =
  367. new com.google.protobuf.AbstractParser<TwoWayChannelMessage>() {
  368. public TwoWayChannelMessage parsePartialFrom(
  369. com.google.protobuf.CodedInputStream input,
  370. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  371. throws com.google.protobuf.InvalidProtocolBufferException {
  372. return new TwoWayChannelMessage(input, extensionRegistry);
  373. }
  374. };
  375. @java.lang.Override
  376. public com.google.protobuf.Parser<TwoWayChannelMessage> getParserForType() {
  377. return PARSER;
  378. }
  379. /**
  380. * Protobuf enum {@code paymentchannels.TwoWayChannelMessage.MessageType}
  381. */
  382. public enum MessageType
  383. implements com.google.protobuf.ProtocolMessageEnum {
  384. /**
  385. * <code>CLIENT_VERSION = 1;</code>
  386. */
  387. CLIENT_VERSION(0, 1),
  388. /**
  389. * <code>SERVER_VERSION = 2;</code>
  390. */
  391. SERVER_VERSION(1, 2),
  392. /**
  393. * <code>INITIATE = 3;</code>
  394. */
  395. INITIATE(2, 3),
  396. /**
  397. * <code>PROVIDE_REFUND = 4;</code>
  398. */
  399. PROVIDE_REFUND(3, 4),
  400. /**
  401. * <code>RETURN_REFUND = 5;</code>
  402. */
  403. RETURN_REFUND(4, 5),
  404. /**
  405. * <code>PROVIDE_CONTRACT = 6;</code>
  406. */
  407. PROVIDE_CONTRACT(5, 6),
  408. /**
  409. * <code>CHANNEL_OPEN = 7;</code>
  410. *
  411. * <pre>
  412. * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
  413. * secondary to the primary to indicate that the provided contract was received,
  414. * verified, and broadcast successfully and the primary can now provide UPDATE messages
  415. * at will to begin paying secondary. If the channel is interrupted after the
  416. * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
  417. * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
  418. * message.
  419. * </pre>
  420. */
  421. CHANNEL_OPEN(6, 7),
  422. /**
  423. * <code>UPDATE_PAYMENT = 8;</code>
  424. */
  425. UPDATE_PAYMENT(7, 8),
  426. /**
  427. * <code>CLOSE = 9;</code>
  428. *
  429. * <pre>
  430. * Either side can send this message. If the client sends it to the server, then the server
  431. * takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a
  432. * valid transaction, which it then broadcasts on the network.
  433. *
  434. * If the server sends it to the client, then it can either be a simple "good bye" message or
  435. * it can include the fully signed close transaction and give it back so the client can
  436. * eventually broadcast it as well, in case the server fails to do so for some reason (and
  437. * more usefully so the client can build on it). In that case the server replies to a CLOSE
  438. * with another CLOSE and then disconnects.
  439. * </pre>
  440. */
  441. CLOSE(8, 9),
  442. /**
  443. * <code>ERROR = 10;</code>
  444. *
  445. * <pre>
  446. * Used to indicate an error condition.
  447. * Both parties should make an effort to send either an ERROR or a CLOSE immediately
  448. * before closing the socket (unless they just received an ERROR or a CLOSE). This is important
  449. * because the protocol may not run over TCP.
  450. * </pre>
  451. */
  452. ERROR(9, 10),
  453. ;
  454. /**
  455. * <code>CLIENT_VERSION = 1;</code>
  456. */
  457. public static final int CLIENT_VERSION_VALUE = 1;
  458. /**
  459. * <code>SERVER_VERSION = 2;</code>
  460. */
  461. public static final int SERVER_VERSION_VALUE = 2;
  462. /**
  463. * <code>INITIATE = 3;</code>
  464. */
  465. public static final int INITIATE_VALUE = 3;
  466. /**
  467. * <code>PROVIDE_REFUND = 4;</code>
  468. */
  469. public static final int PROVIDE_REFUND_VALUE = 4;
  470. /**
  471. * <code>RETURN_REFUND = 5;</code>
  472. */
  473. public static final int RETURN_REFUND_VALUE = 5;
  474. /**
  475. * <code>PROVIDE_CONTRACT = 6;</code>
  476. */
  477. public static final int PROVIDE_CONTRACT_VALUE = 6;
  478. /**
  479. * <code>CHANNEL_OPEN = 7;</code>
  480. *
  481. * <pre>
  482. * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
  483. * secondary to the primary to indicate that the provided contract was received,
  484. * verified, and broadcast successfully and the primary can now provide UPDATE messages
  485. * at will to begin paying secondary. If the channel is interrupted after the
  486. * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
  487. * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
  488. * message.
  489. * </pre>
  490. */
  491. public static final int CHANNEL_OPEN_VALUE = 7;
  492. /**
  493. * <code>UPDATE_PAYMENT = 8;</code>
  494. */
  495. public static final int UPDATE_PAYMENT_VALUE = 8;
  496. /**
  497. * <code>CLOSE = 9;</code>
  498. *
  499. * <pre>
  500. * Either side can send this message. If the client sends it to the server, then the server
  501. * takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a
  502. * valid transaction, which it then broadcasts on the network.
  503. *
  504. * If the server sends it to the client, then it can either be a simple "good bye" message or
  505. * it can include the fully signed close transaction and give it back so the client can
  506. * eventually broadcast it as well, in case the server fails to do so for some reason (and
  507. * more usefully so the client can build on it). In that case the server replies to a CLOSE
  508. * with another CLOSE and then disconnects.
  509. * </pre>
  510. */
  511. public static final int CLOSE_VALUE = 9;
  512. /**
  513. * <code>ERROR = 10;</code>
  514. *
  515. * <pre>
  516. * Used to indicate an error condition.
  517. * Both parties should make an effort to send either an ERROR or a CLOSE immediately
  518. * before closing the socket (unless they just received an ERROR or a CLOSE). This is important
  519. * because the protocol may not run over TCP.
  520. * </pre>
  521. */
  522. public static final int ERROR_VALUE = 10;
  523. public final int getNumber() { return value; }
  524. public static MessageType valueOf(int value) {
  525. switch (value) {
  526. case 1: return CLIENT_VERSION;
  527. case 2: return SERVER_VERSION;
  528. case 3: return INITIATE;
  529. case 4: return PROVIDE_REFUND;
  530. case 5: return RETURN_REFUND;
  531. case 6: return PROVIDE_CONTRACT;
  532. case 7: return CHANNEL_OPEN;
  533. case 8: return UPDATE_PAYMENT;
  534. case 9: return CLOSE;
  535. case 10: return ERROR;
  536. default: return null;
  537. }
  538. }
  539. public static com.google.protobuf.Internal.EnumLiteMap<MessageType>
  540. internalGetValueMap() {
  541. return internalValueMap;
  542. }
  543. private static com.google.protobuf.Internal.EnumLiteMap<MessageType>
  544. internalValueMap =
  545. new com.google.protobuf.Internal.EnumLiteMap<MessageType>() {
  546. public MessageType findValueByNumber(int number) {
  547. return MessageType.valueOf(number);
  548. }
  549. };
  550. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  551. getValueDescriptor() {
  552. return getDescriptor().getValues().get(index);
  553. }
  554. public final com.google.protobuf.Descriptors.EnumDescriptor
  555. getDescriptorForType() {
  556. return getDescriptor();
  557. }
  558. public static final com.google.protobuf.Descriptors.EnumDescriptor
  559. getDescriptor() {
  560. return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDescriptor().getEnumTypes().get(0);
  561. }
  562. private static final MessageType[] VALUES = values();
  563. public static MessageType valueOf(
  564. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  565. if (desc.getType() != getDescriptor()) {
  566. throw new java.lang.IllegalArgumentException(
  567. "EnumValueDescriptor is not for this type.");
  568. }
  569. return VALUES[desc.getIndex()];
  570. }
  571. private final int index;
  572. private final int value;
  573. private MessageType(int index, int value) {
  574. this.index = index;
  575. this.value = value;
  576. }
  577. // @@protoc_insertion_point(enum_scope:paymentchannels.TwoWayChannelMessage.MessageType)
  578. }
  579. private int bitField0_;
  580. // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;
  581. public static final int TYPE_FIELD_NUMBER = 1;
  582. private org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType type_;
  583. /**
  584. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  585. *
  586. * <pre>
  587. * This is required so if a new message type is added in future, old software aborts trying
  588. * to read the message as early as possible. If the message doesn't parse, the socket should
  589. * be closed.
  590. * </pre>
  591. */
  592. public boolean hasType() {
  593. return ((bitField0_ & 0x00000001) == 0x00000001);
  594. }
  595. /**
  596. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  597. *
  598. * <pre>
  599. * This is required so if a new message type is added in future, old software aborts trying
  600. * to read the message as early as possible. If the message doesn't parse, the socket should
  601. * be closed.
  602. * </pre>
  603. */
  604. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() {
  605. return type_;
  606. }
  607. // optional .paymentchannels.ClientVersion client_version = 2;
  608. public static final int CLIENT_VERSION_FIELD_NUMBER = 2;
  609. private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_;
  610. /**
  611. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  612. *
  613. * <pre>
  614. * Now one optional field for each message. Only the field specified by type should be read.
  615. * </pre>
  616. */
  617. public boolean hasClientVersion() {
  618. return ((bitField0_ & 0x00000002) == 0x00000002);
  619. }
  620. /**
  621. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  622. *
  623. * <pre>
  624. * Now one optional field for each message. Only the field specified by type should be read.
  625. * </pre>
  626. */
  627. public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() {
  628. return clientVersion_;
  629. }
  630. /**
  631. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  632. *
  633. * <pre>
  634. * Now one optional field for each message. Only the field specified by type should be read.
  635. * </pre>
  636. */
  637. public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() {
  638. return clientVersion_;
  639. }
  640. // optional .paymentchannels.ServerVersion server_version = 3;
  641. public static final int SERVER_VERSION_FIELD_NUMBER = 3;
  642. private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_;
  643. /**
  644. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  645. */
  646. public boolean hasServerVersion() {
  647. return ((bitField0_ & 0x00000004) == 0x00000004);
  648. }
  649. /**
  650. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  651. */
  652. public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() {
  653. return serverVersion_;
  654. }
  655. /**
  656. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  657. */
  658. public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() {
  659. return serverVersion_;
  660. }
  661. // optional .paymentchannels.Initiate initiate = 4;
  662. public static final int INITIATE_FIELD_NUMBER = 4;
  663. private org.bitcoin.paymentchannel.Protos.Initiate initiate_;
  664. /**
  665. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  666. */
  667. public boolean hasInitiate() {
  668. return ((bitField0_ & 0x00000008) == 0x00000008);
  669. }
  670. /**
  671. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  672. */
  673. public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() {
  674. return initiate_;
  675. }
  676. /**
  677. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  678. */
  679. public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() {
  680. return initiate_;
  681. }
  682. // optional .paymentchannels.ProvideRefund provide_refund = 5;
  683. public static final int PROVIDE_REFUND_FIELD_NUMBER = 5;
  684. private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_;
  685. /**
  686. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  687. */
  688. public boolean hasProvideRefund() {
  689. return ((bitField0_ & 0x00000010) == 0x00000010);
  690. }
  691. /**
  692. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  693. */
  694. public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() {
  695. return provideRefund_;
  696. }
  697. /**
  698. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  699. */
  700. public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() {
  701. return provideRefund_;
  702. }
  703. // optional .paymentchannels.ReturnRefund return_refund = 6;
  704. public static final int RETURN_REFUND_FIELD_NUMBER = 6;
  705. private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_;
  706. /**
  707. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  708. */
  709. public boolean hasReturnRefund() {
  710. return ((bitField0_ & 0x00000020) == 0x00000020);
  711. }
  712. /**
  713. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  714. */
  715. public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() {
  716. return returnRefund_;
  717. }
  718. /**
  719. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  720. */
  721. public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() {
  722. return returnRefund_;
  723. }
  724. // optional .paymentchannels.ProvideContract provide_contract = 7;
  725. public static final int PROVIDE_CONTRACT_FIELD_NUMBER = 7;
  726. private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_;
  727. /**
  728. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  729. */
  730. public boolean hasProvideContract() {
  731. return ((bitField0_ & 0x00000040) == 0x00000040);
  732. }
  733. /**
  734. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  735. */
  736. public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() {
  737. return provideContract_;
  738. }
  739. /**
  740. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  741. */
  742. public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() {
  743. return provideContract_;
  744. }
  745. // optional .paymentchannels.UpdatePayment update_payment = 8;
  746. public static final int UPDATE_PAYMENT_FIELD_NUMBER = 8;
  747. private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_;
  748. /**
  749. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  750. */
  751. public boolean hasUpdatePayment() {
  752. return ((bitField0_ & 0x00000080) == 0x00000080);
  753. }
  754. /**
  755. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  756. */
  757. public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() {
  758. return updatePayment_;
  759. }
  760. /**
  761. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  762. */
  763. public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() {
  764. return updatePayment_;
  765. }
  766. // optional .paymentchannels.Close close = 9;
  767. public static final int CLOSE_FIELD_NUMBER = 9;
  768. private org.bitcoin.paymentchannel.Protos.Close close_;
  769. /**
  770. * <code>optional .paymentchannels.Close close = 9;</code>
  771. */
  772. public boolean hasClose() {
  773. return ((bitField0_ & 0x00000100) == 0x00000100);
  774. }
  775. /**
  776. * <code>optional .paymentchannels.Close close = 9;</code>
  777. */
  778. public org.bitcoin.paymentchannel.Protos.Close getClose() {
  779. return close_;
  780. }
  781. /**
  782. * <code>optional .paymentchannels.Close close = 9;</code>
  783. */
  784. public org.bitcoin.paymentchannel.Protos.CloseOrBuilder getCloseOrBuilder() {
  785. return close_;
  786. }
  787. // optional .paymentchannels.Error error = 10;
  788. public static final int ERROR_FIELD_NUMBER = 10;
  789. private org.bitcoin.paymentchannel.Protos.Error error_;
  790. /**
  791. * <code>optional .paymentchannels.Error error = 10;</code>
  792. */
  793. public boolean hasError() {
  794. return ((bitField0_ & 0x00000200) == 0x00000200);
  795. }
  796. /**
  797. * <code>optional .paymentchannels.Error error = 10;</code>
  798. */
  799. public org.bitcoin.paymentchannel.Protos.Error getError() {
  800. return error_;
  801. }
  802. /**
  803. * <code>optional .paymentchannels.Error error = 10;</code>
  804. */
  805. public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() {
  806. return error_;
  807. }
  808. private void initFields() {
  809. type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION;
  810. clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  811. serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  812. initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  813. provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  814. returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  815. provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  816. updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  817. close_ = org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  818. error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  819. }
  820. private byte memoizedIsInitialized = -1;
  821. public final boolean isInitialized() {
  822. byte isInitialized = memoizedIsInitialized;
  823. if (isInitialized != -1) return isInitialized == 1;
  824. if (!hasType()) {
  825. memoizedIsInitialized = 0;
  826. return false;
  827. }
  828. if (hasClientVersion()) {
  829. if (!getClientVersion().isInitialized()) {
  830. memoizedIsInitialized = 0;
  831. return false;
  832. }
  833. }
  834. if (hasServerVersion()) {
  835. if (!getServerVersion().isInitialized()) {
  836. memoizedIsInitialized = 0;
  837. return false;
  838. }
  839. }
  840. if (hasInitiate()) {
  841. if (!getInitiate().isInitialized()) {
  842. memoizedIsInitialized = 0;
  843. return false;
  844. }
  845. }
  846. if (hasProvideRefund()) {
  847. if (!getProvideRefund().isInitialized()) {
  848. memoizedIsInitialized = 0;
  849. return false;
  850. }
  851. }
  852. if (hasReturnRefund()) {
  853. if (!getReturnRefund().isInitialized()) {
  854. memoizedIsInitialized = 0;
  855. return false;
  856. }
  857. }
  858. if (hasProvideContract()) {
  859. if (!getProvideContract().isInitialized()) {
  860. memoizedIsInitialized = 0;
  861. return false;
  862. }
  863. }
  864. if (hasUpdatePayment()) {
  865. if (!getUpdatePayment().isInitialized()) {
  866. memoizedIsInitialized = 0;
  867. return false;
  868. }
  869. }
  870. if (hasClose()) {
  871. if (!getClose().isInitialized()) {
  872. memoizedIsInitialized = 0;
  873. return false;
  874. }
  875. }
  876. memoizedIsInitialized = 1;
  877. return true;
  878. }
  879. public void writeTo(com.google.protobuf.CodedOutputStream output)
  880. throws java.io.IOException {
  881. getSerializedSize();
  882. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  883. output.writeEnum(1, type_.getNumber());
  884. }
  885. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  886. output.writeMessage(2, clientVersion_);
  887. }
  888. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  889. output.writeMessage(3, serverVersion_);
  890. }
  891. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  892. output.writeMessage(4, initiate_);
  893. }
  894. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  895. output.writeMessage(5, provideRefund_);
  896. }
  897. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  898. output.writeMessage(6, returnRefund_);
  899. }
  900. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  901. output.writeMessage(7, provideContract_);
  902. }
  903. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  904. output.writeMessage(8, updatePayment_);
  905. }
  906. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  907. output.writeMessage(9, close_);
  908. }
  909. if (((bitField0_ & 0x00000200) == 0x00000200)) {
  910. output.writeMessage(10, error_);
  911. }
  912. getUnknownFields().writeTo(output);
  913. }
  914. private int memoizedSerializedSize = -1;
  915. public int getSerializedSize() {
  916. int size = memoizedSerializedSize;
  917. if (size != -1) return size;
  918. size = 0;
  919. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  920. size += com.google.protobuf.CodedOutputStream
  921. .computeEnumSize(1, type_.getNumber());
  922. }
  923. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  924. size += com.google.protobuf.CodedOutputStream
  925. .computeMessageSize(2, clientVersion_);
  926. }
  927. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  928. size += com.google.protobuf.CodedOutputStream
  929. .computeMessageSize(3, serverVersion_);
  930. }
  931. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  932. size += com.google.protobuf.CodedOutputStream
  933. .computeMessageSize(4, initiate_);
  934. }
  935. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  936. size += com.google.protobuf.CodedOutputStream
  937. .computeMessageSize(5, provideRefund_);
  938. }
  939. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  940. size += com.google.protobuf.CodedOutputStream
  941. .computeMessageSize(6, returnRefund_);
  942. }
  943. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  944. size += com.google.protobuf.CodedOutputStream
  945. .computeMessageSize(7, provideContract_);
  946. }
  947. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  948. size += com.google.protobuf.CodedOutputStream
  949. .computeMessageSize(8, updatePayment_);
  950. }
  951. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  952. size += com.google.protobuf.CodedOutputStream
  953. .computeMessageSize(9, close_);
  954. }
  955. if (((bitField0_ & 0x00000200) == 0x00000200)) {
  956. size += com.google.protobuf.CodedOutputStream
  957. .computeMessageSize(10, error_);
  958. }
  959. size += getUnknownFields().getSerializedSize();
  960. memoizedSerializedSize = size;
  961. return size;
  962. }
  963. private static final long serialVersionUID = 0L;
  964. @java.lang.Override
  965. protected java.lang.Object writeReplace()
  966. throws java.io.ObjectStreamException {
  967. return super.writeReplace();
  968. }
  969. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  970. com.google.protobuf.ByteString data)
  971. throws com.google.protobuf.InvalidProtocolBufferException {
  972. return PARSER.parseFrom(data);
  973. }
  974. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  975. com.google.protobuf.ByteString data,
  976. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  977. throws com.google.protobuf.InvalidProtocolBufferException {
  978. return PARSER.parseFrom(data, extensionRegistry);
  979. }
  980. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(byte[] data)
  981. throws com.google.protobuf.InvalidProtocolBufferException {
  982. return PARSER.parseFrom(data);
  983. }
  984. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  985. byte[] data,
  986. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  987. throws com.google.protobuf.InvalidProtocolBufferException {
  988. return PARSER.parseFrom(data, extensionRegistry);
  989. }
  990. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(java.io.InputStream input)
  991. throws java.io.IOException {
  992. return PARSER.parseFrom(input);
  993. }
  994. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  995. java.io.InputStream input,
  996. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  997. throws java.io.IOException {
  998. return PARSER.parseFrom(input, extensionRegistry);
  999. }
  1000. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom(java.io.InputStream input)
  1001. throws java.io.IOException {
  1002. return PARSER.parseDelimitedFrom(input);
  1003. }
  1004. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom(
  1005. java.io.InputStream input,
  1006. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1007. throws java.io.IOException {
  1008. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  1009. }
  1010. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  1011. com.google.protobuf.CodedInputStream input)
  1012. throws java.io.IOException {
  1013. return PARSER.parseFrom(input);
  1014. }
  1015. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  1016. com.google.protobuf.CodedInputStream input,
  1017. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1018. throws java.io.IOException {
  1019. return PARSER.parseFrom(input, extensionRegistry);
  1020. }
  1021. public static Builder newBuilder() { return Builder.create(); }
  1022. public Builder newBuilderForType() { return newBuilder(); }
  1023. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage prototype) {
  1024. return newBuilder().mergeFrom(prototype);
  1025. }
  1026. public Builder toBuilder() { return newBuilder(this); }
  1027. @java.lang.Override
  1028. protected Builder newBuilderForType(
  1029. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1030. Builder builder = new Builder(parent);
  1031. return builder;
  1032. }
  1033. /**
  1034. * Protobuf type {@code paymentchannels.TwoWayChannelMessage}
  1035. *
  1036. * <pre>
  1037. * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
  1038. * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
  1039. * and "secondary" as "server".
  1040. * </pre>
  1041. */
  1042. public static final class Builder extends
  1043. com.google.protobuf.GeneratedMessage.Builder<Builder>
  1044. implements org.bitcoin.paymentchannel.Protos.TwoWayChannelMessageOrBuilder {
  1045. public static final com.google.protobuf.Descriptors.Descriptor
  1046. getDescriptor() {
  1047. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  1048. }
  1049. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  1050. internalGetFieldAccessorTable() {
  1051. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable
  1052. .ensureFieldAccessorsInitialized(
  1053. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class);
  1054. }
  1055. // Construct using org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.newBuilder()
  1056. private Builder() {
  1057. maybeForceBuilderInitialization();
  1058. }
  1059. private Builder(
  1060. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1061. super(parent);
  1062. maybeForceBuilderInitialization();
  1063. }
  1064. private void maybeForceBuilderInitialization() {
  1065. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  1066. getClientVersionFieldBuilder();
  1067. getServerVersionFieldBuilder();
  1068. getInitiateFieldBuilder();
  1069. getProvideRefundFieldBuilder();
  1070. getReturnRefundFieldBuilder();
  1071. getProvideContractFieldBuilder();
  1072. getUpdatePaymentFieldBuilder();
  1073. getCloseFieldBuilder();
  1074. getErrorFieldBuilder();
  1075. }
  1076. }
  1077. private static Builder create() {
  1078. return new Builder();
  1079. }
  1080. public Builder clear() {
  1081. super.clear();
  1082. type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION;
  1083. bitField0_ = (bitField0_ & ~0x00000001);
  1084. if (clientVersionBuilder_ == null) {
  1085. clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  1086. } else {
  1087. clientVersionBuilder_.clear();
  1088. }
  1089. bitField0_ = (bitField0_ & ~0x00000002);
  1090. if (serverVersionBuilder_ == null) {
  1091. serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  1092. } else {
  1093. serverVersionBuilder_.clear();
  1094. }
  1095. bitField0_ = (bitField0_ & ~0x00000004);
  1096. if (initiateBuilder_ == null) {
  1097. initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  1098. } else {
  1099. initiateBuilder_.clear();
  1100. }
  1101. bitField0_ = (bitField0_ & ~0x00000008);
  1102. if (provideRefundBuilder_ == null) {
  1103. provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  1104. } else {
  1105. provideRefundBuilder_.clear();
  1106. }
  1107. bitField0_ = (bitField0_ & ~0x00000010);
  1108. if (returnRefundBuilder_ == null) {
  1109. returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  1110. } else {
  1111. returnRefundBuilder_.clear();
  1112. }
  1113. bitField0_ = (bitField0_ & ~0x00000020);
  1114. if (provideContractBuilder_ == null) {
  1115. provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  1116. } else {
  1117. provideContractBuilder_.clear();
  1118. }
  1119. bitField0_ = (bitField0_ & ~0x00000040);
  1120. if (updatePaymentBuilder_ == null) {
  1121. updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  1122. } else {
  1123. updatePaymentBuilder_.clear();
  1124. }
  1125. bitField0_ = (bitField0_ & ~0x00000080);
  1126. if (closeBuilder_ == null) {
  1127. close_ = org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  1128. } else {
  1129. closeBuilder_.clear();
  1130. }
  1131. bitField0_ = (bitField0_ & ~0x00000100);
  1132. if (errorBuilder_ == null) {
  1133. error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  1134. } else {
  1135. errorBuilder_.clear();
  1136. }
  1137. bitField0_ = (bitField0_ & ~0x00000200);
  1138. return this;
  1139. }
  1140. public Builder clone() {
  1141. return create().mergeFrom(buildPartial());
  1142. }
  1143. public com.google.protobuf.Descriptors.Descriptor
  1144. getDescriptorForType() {
  1145. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  1146. }
  1147. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage getDefaultInstanceForType() {
  1148. return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance();
  1149. }
  1150. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage build() {
  1151. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = buildPartial();
  1152. if (!result.isInitialized()) {
  1153. throw newUninitializedMessageException(result);
  1154. }
  1155. return result;
  1156. }
  1157. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage buildPartial() {
  1158. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = new org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage(this);
  1159. int from_bitField0_ = bitField0_;
  1160. int to_bitField0_ = 0;
  1161. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  1162. to_bitField0_ |= 0x00000001;
  1163. }
  1164. result.type_ = type_;
  1165. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  1166. to_bitField0_ |= 0x00000002;
  1167. }
  1168. if (clientVersionBuilder_ == null) {
  1169. result.clientVersion_ = clientVersion_;
  1170. } else {
  1171. result.clientVersion_ = clientVersionBuilder_.build();
  1172. }
  1173. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  1174. to_bitField0_ |= 0x00000004;
  1175. }
  1176. if (serverVersionBuilder_ == null) {
  1177. result.serverVersion_ = serverVersion_;
  1178. } else {
  1179. result.serverVersion_ = serverVersionBuilder_.build();
  1180. }
  1181. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  1182. to_bitField0_ |= 0x00000008;
  1183. }
  1184. if (initiateBuilder_ == null) {
  1185. result.initiate_ = initiate_;
  1186. } else {
  1187. result.initiate_ = initiateBuilder_.build();
  1188. }
  1189. if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
  1190. to_bitField0_ |= 0x00000010;
  1191. }
  1192. if (provideRefundBuilder_ == null) {
  1193. result.provideRefund_ = provideRefund_;
  1194. } else {
  1195. result.provideRefund_ = provideRefundBuilder_.build();
  1196. }
  1197. if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
  1198. to_bitField0_ |= 0x00000020;
  1199. }
  1200. if (returnRefundBuilder_ == null) {
  1201. result.returnRefund_ = returnRefund_;
  1202. } else {
  1203. result.returnRefund_ = returnRefundBuilder_.build();
  1204. }
  1205. if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
  1206. to_bitField0_ |= 0x00000040;
  1207. }
  1208. if (provideContractBuilder_ == null) {
  1209. result.provideContract_ = provideContract_;
  1210. } else {
  1211. result.provideContract_ = provideContractBuilder_.build();
  1212. }
  1213. if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
  1214. to_bitField0_ |= 0x00000080;
  1215. }
  1216. if (updatePaymentBuilder_ == null) {
  1217. result.updatePayment_ = updatePayment_;
  1218. } else {
  1219. result.updatePayment_ = updatePaymentBuilder_.build();
  1220. }
  1221. if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
  1222. to_bitField0_ |= 0x00000100;
  1223. }
  1224. if (closeBuilder_ == null) {
  1225. result.close_ = close_;
  1226. } e

Large files files are truncated, but you can click here to view the full file