PageRenderTime 64ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/core/src/main/java/com/google/bitcoin/protocols/channels/ClientState.java

https://code.google.com/
Java | 1765 lines | 1299 code | 101 blank | 365 comment | 197 complexity | 2d1690192657bbdca8f55b06eabeccea 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: storedclientpaymentchannel.proto
  3. package com.google.bitcoin.protocols.channels;
  4. public final class ClientState {
  5. private ClientState() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public interface StoredClientPaymentChannelsOrBuilder
  10. extends com.google.protobuf.MessageOrBuilder {
  11. // repeated .paymentchannels.StoredClientPaymentChannel channels = 1;
  12. /**
  13. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  14. */
  15. java.util.List<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel>
  16. getChannelsList();
  17. /**
  18. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  19. */
  20. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index);
  21. /**
  22. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  23. */
  24. int getChannelsCount();
  25. /**
  26. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  27. */
  28. java.util.List<? extends com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder>
  29. getChannelsOrBuilderList();
  30. /**
  31. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  32. */
  33. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder(
  34. int index);
  35. }
  36. /**
  37. * Protobuf type {@code paymentchannels.StoredClientPaymentChannels}
  38. *
  39. * <pre>
  40. * A set of StoredPaymentChannel's
  41. * </pre>
  42. */
  43. public static final class StoredClientPaymentChannels extends
  44. com.google.protobuf.GeneratedMessage
  45. implements StoredClientPaymentChannelsOrBuilder {
  46. // Use StoredClientPaymentChannels.newBuilder() to construct.
  47. private StoredClientPaymentChannels(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  48. super(builder);
  49. this.unknownFields = builder.getUnknownFields();
  50. }
  51. private StoredClientPaymentChannels(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  52. private static final StoredClientPaymentChannels defaultInstance;
  53. public static StoredClientPaymentChannels getDefaultInstance() {
  54. return defaultInstance;
  55. }
  56. public StoredClientPaymentChannels getDefaultInstanceForType() {
  57. return defaultInstance;
  58. }
  59. private final com.google.protobuf.UnknownFieldSet unknownFields;
  60. @java.lang.Override
  61. public final com.google.protobuf.UnknownFieldSet
  62. getUnknownFields() {
  63. return this.unknownFields;
  64. }
  65. private StoredClientPaymentChannels(
  66. com.google.protobuf.CodedInputStream input,
  67. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  68. throws com.google.protobuf.InvalidProtocolBufferException {
  69. initFields();
  70. int mutable_bitField0_ = 0;
  71. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  72. com.google.protobuf.UnknownFieldSet.newBuilder();
  73. try {
  74. boolean done = false;
  75. while (!done) {
  76. int tag = input.readTag();
  77. switch (tag) {
  78. case 0:
  79. done = true;
  80. break;
  81. default: {
  82. if (!parseUnknownField(input, unknownFields,
  83. extensionRegistry, tag)) {
  84. done = true;
  85. }
  86. break;
  87. }
  88. case 10: {
  89. if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
  90. channels_ = new java.util.ArrayList<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel>();
  91. mutable_bitField0_ |= 0x00000001;
  92. }
  93. channels_.add(input.readMessage(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.PARSER, extensionRegistry));
  94. break;
  95. }
  96. }
  97. }
  98. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  99. throw e.setUnfinishedMessage(this);
  100. } catch (java.io.IOException e) {
  101. throw new com.google.protobuf.InvalidProtocolBufferException(
  102. e.getMessage()).setUnfinishedMessage(this);
  103. } finally {
  104. if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
  105. channels_ = java.util.Collections.unmodifiableList(channels_);
  106. }
  107. this.unknownFields = unknownFields.build();
  108. makeExtensionsImmutable();
  109. }
  110. }
  111. public static final com.google.protobuf.Descriptors.Descriptor
  112. getDescriptor() {
  113. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor;
  114. }
  115. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  116. internalGetFieldAccessorTable() {
  117. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable
  118. .ensureFieldAccessorsInitialized(
  119. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class);
  120. }
  121. public static com.google.protobuf.Parser<StoredClientPaymentChannels> PARSER =
  122. new com.google.protobuf.AbstractParser<StoredClientPaymentChannels>() {
  123. public StoredClientPaymentChannels parsePartialFrom(
  124. com.google.protobuf.CodedInputStream input,
  125. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  126. throws com.google.protobuf.InvalidProtocolBufferException {
  127. return new StoredClientPaymentChannels(input, extensionRegistry);
  128. }
  129. };
  130. @java.lang.Override
  131. public com.google.protobuf.Parser<StoredClientPaymentChannels> getParserForType() {
  132. return PARSER;
  133. }
  134. // repeated .paymentchannels.StoredClientPaymentChannel channels = 1;
  135. public static final int CHANNELS_FIELD_NUMBER = 1;
  136. private java.util.List<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel> channels_;
  137. /**
  138. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  139. */
  140. public java.util.List<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel> getChannelsList() {
  141. return channels_;
  142. }
  143. /**
  144. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  145. */
  146. public java.util.List<? extends com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder>
  147. getChannelsOrBuilderList() {
  148. return channels_;
  149. }
  150. /**
  151. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  152. */
  153. public int getChannelsCount() {
  154. return channels_.size();
  155. }
  156. /**
  157. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  158. */
  159. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index) {
  160. return channels_.get(index);
  161. }
  162. /**
  163. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  164. */
  165. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder(
  166. int index) {
  167. return channels_.get(index);
  168. }
  169. private void initFields() {
  170. channels_ = java.util.Collections.emptyList();
  171. }
  172. private byte memoizedIsInitialized = -1;
  173. public final boolean isInitialized() {
  174. byte isInitialized = memoizedIsInitialized;
  175. if (isInitialized != -1) return isInitialized == 1;
  176. for (int i = 0; i < getChannelsCount(); i++) {
  177. if (!getChannels(i).isInitialized()) {
  178. memoizedIsInitialized = 0;
  179. return false;
  180. }
  181. }
  182. memoizedIsInitialized = 1;
  183. return true;
  184. }
  185. public void writeTo(com.google.protobuf.CodedOutputStream output)
  186. throws java.io.IOException {
  187. getSerializedSize();
  188. for (int i = 0; i < channels_.size(); i++) {
  189. output.writeMessage(1, channels_.get(i));
  190. }
  191. getUnknownFields().writeTo(output);
  192. }
  193. private int memoizedSerializedSize = -1;
  194. public int getSerializedSize() {
  195. int size = memoizedSerializedSize;
  196. if (size != -1) return size;
  197. size = 0;
  198. for (int i = 0; i < channels_.size(); i++) {
  199. size += com.google.protobuf.CodedOutputStream
  200. .computeMessageSize(1, channels_.get(i));
  201. }
  202. size += getUnknownFields().getSerializedSize();
  203. memoizedSerializedSize = size;
  204. return size;
  205. }
  206. private static final long serialVersionUID = 0L;
  207. @java.lang.Override
  208. protected java.lang.Object writeReplace()
  209. throws java.io.ObjectStreamException {
  210. return super.writeReplace();
  211. }
  212. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(
  213. com.google.protobuf.ByteString data)
  214. throws com.google.protobuf.InvalidProtocolBufferException {
  215. return PARSER.parseFrom(data);
  216. }
  217. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(
  218. com.google.protobuf.ByteString data,
  219. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  220. throws com.google.protobuf.InvalidProtocolBufferException {
  221. return PARSER.parseFrom(data, extensionRegistry);
  222. }
  223. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(byte[] data)
  224. throws com.google.protobuf.InvalidProtocolBufferException {
  225. return PARSER.parseFrom(data);
  226. }
  227. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(
  228. byte[] data,
  229. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  230. throws com.google.protobuf.InvalidProtocolBufferException {
  231. return PARSER.parseFrom(data, extensionRegistry);
  232. }
  233. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(java.io.InputStream input)
  234. throws java.io.IOException {
  235. return PARSER.parseFrom(input);
  236. }
  237. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(
  238. java.io.InputStream input,
  239. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  240. throws java.io.IOException {
  241. return PARSER.parseFrom(input, extensionRegistry);
  242. }
  243. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseDelimitedFrom(java.io.InputStream input)
  244. throws java.io.IOException {
  245. return PARSER.parseDelimitedFrom(input);
  246. }
  247. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseDelimitedFrom(
  248. java.io.InputStream input,
  249. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  250. throws java.io.IOException {
  251. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  252. }
  253. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(
  254. com.google.protobuf.CodedInputStream input)
  255. throws java.io.IOException {
  256. return PARSER.parseFrom(input);
  257. }
  258. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(
  259. com.google.protobuf.CodedInputStream input,
  260. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  261. throws java.io.IOException {
  262. return PARSER.parseFrom(input, extensionRegistry);
  263. }
  264. public static Builder newBuilder() { return Builder.create(); }
  265. public Builder newBuilderForType() { return newBuilder(); }
  266. public static Builder newBuilder(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels prototype) {
  267. return newBuilder().mergeFrom(prototype);
  268. }
  269. public Builder toBuilder() { return newBuilder(this); }
  270. @java.lang.Override
  271. protected Builder newBuilderForType(
  272. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  273. Builder builder = new Builder(parent);
  274. return builder;
  275. }
  276. /**
  277. * Protobuf type {@code paymentchannels.StoredClientPaymentChannels}
  278. *
  279. * <pre>
  280. * A set of StoredPaymentChannel's
  281. * </pre>
  282. */
  283. public static final class Builder extends
  284. com.google.protobuf.GeneratedMessage.Builder<Builder>
  285. implements com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelsOrBuilder {
  286. public static final com.google.protobuf.Descriptors.Descriptor
  287. getDescriptor() {
  288. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor;
  289. }
  290. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  291. internalGetFieldAccessorTable() {
  292. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable
  293. .ensureFieldAccessorsInitialized(
  294. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class);
  295. }
  296. // Construct using com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.newBuilder()
  297. private Builder() {
  298. maybeForceBuilderInitialization();
  299. }
  300. private Builder(
  301. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  302. super(parent);
  303. maybeForceBuilderInitialization();
  304. }
  305. private void maybeForceBuilderInitialization() {
  306. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  307. getChannelsFieldBuilder();
  308. }
  309. }
  310. private static Builder create() {
  311. return new Builder();
  312. }
  313. public Builder clear() {
  314. super.clear();
  315. if (channelsBuilder_ == null) {
  316. channels_ = java.util.Collections.emptyList();
  317. bitField0_ = (bitField0_ & ~0x00000001);
  318. } else {
  319. channelsBuilder_.clear();
  320. }
  321. return this;
  322. }
  323. public Builder clone() {
  324. return create().mergeFrom(buildPartial());
  325. }
  326. public com.google.protobuf.Descriptors.Descriptor
  327. getDescriptorForType() {
  328. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor;
  329. }
  330. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels getDefaultInstanceForType() {
  331. return com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.getDefaultInstance();
  332. }
  333. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels build() {
  334. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels result = buildPartial();
  335. if (!result.isInitialized()) {
  336. throw newUninitializedMessageException(result);
  337. }
  338. return result;
  339. }
  340. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels buildPartial() {
  341. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels result = new com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels(this);
  342. int from_bitField0_ = bitField0_;
  343. if (channelsBuilder_ == null) {
  344. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  345. channels_ = java.util.Collections.unmodifiableList(channels_);
  346. bitField0_ = (bitField0_ & ~0x00000001);
  347. }
  348. result.channels_ = channels_;
  349. } else {
  350. result.channels_ = channelsBuilder_.build();
  351. }
  352. onBuilt();
  353. return result;
  354. }
  355. public Builder mergeFrom(com.google.protobuf.Message other) {
  356. if (other instanceof com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels) {
  357. return mergeFrom((com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels)other);
  358. } else {
  359. super.mergeFrom(other);
  360. return this;
  361. }
  362. }
  363. public Builder mergeFrom(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels other) {
  364. if (other == com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.getDefaultInstance()) return this;
  365. if (channelsBuilder_ == null) {
  366. if (!other.channels_.isEmpty()) {
  367. if (channels_.isEmpty()) {
  368. channels_ = other.channels_;
  369. bitField0_ = (bitField0_ & ~0x00000001);
  370. } else {
  371. ensureChannelsIsMutable();
  372. channels_.addAll(other.channels_);
  373. }
  374. onChanged();
  375. }
  376. } else {
  377. if (!other.channels_.isEmpty()) {
  378. if (channelsBuilder_.isEmpty()) {
  379. channelsBuilder_.dispose();
  380. channelsBuilder_ = null;
  381. channels_ = other.channels_;
  382. bitField0_ = (bitField0_ & ~0x00000001);
  383. channelsBuilder_ =
  384. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  385. getChannelsFieldBuilder() : null;
  386. } else {
  387. channelsBuilder_.addAllMessages(other.channels_);
  388. }
  389. }
  390. }
  391. this.mergeUnknownFields(other.getUnknownFields());
  392. return this;
  393. }
  394. public final boolean isInitialized() {
  395. for (int i = 0; i < getChannelsCount(); i++) {
  396. if (!getChannels(i).isInitialized()) {
  397. return false;
  398. }
  399. }
  400. return true;
  401. }
  402. public Builder mergeFrom(
  403. com.google.protobuf.CodedInputStream input,
  404. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  405. throws java.io.IOException {
  406. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parsedMessage = null;
  407. try {
  408. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  409. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  410. parsedMessage = (com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels) e.getUnfinishedMessage();
  411. throw e;
  412. } finally {
  413. if (parsedMessage != null) {
  414. mergeFrom(parsedMessage);
  415. }
  416. }
  417. return this;
  418. }
  419. private int bitField0_;
  420. // repeated .paymentchannels.StoredClientPaymentChannel channels = 1;
  421. private java.util.List<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel> channels_ =
  422. java.util.Collections.emptyList();
  423. private void ensureChannelsIsMutable() {
  424. if (!((bitField0_ & 0x00000001) == 0x00000001)) {
  425. channels_ = new java.util.ArrayList<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel>(channels_);
  426. bitField0_ |= 0x00000001;
  427. }
  428. }
  429. private com.google.protobuf.RepeatedFieldBuilder<
  430. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder> channelsBuilder_;
  431. /**
  432. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  433. */
  434. public java.util.List<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel> getChannelsList() {
  435. if (channelsBuilder_ == null) {
  436. return java.util.Collections.unmodifiableList(channels_);
  437. } else {
  438. return channelsBuilder_.getMessageList();
  439. }
  440. }
  441. /**
  442. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  443. */
  444. public int getChannelsCount() {
  445. if (channelsBuilder_ == null) {
  446. return channels_.size();
  447. } else {
  448. return channelsBuilder_.getCount();
  449. }
  450. }
  451. /**
  452. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  453. */
  454. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index) {
  455. if (channelsBuilder_ == null) {
  456. return channels_.get(index);
  457. } else {
  458. return channelsBuilder_.getMessage(index);
  459. }
  460. }
  461. /**
  462. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  463. */
  464. public Builder setChannels(
  465. int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel value) {
  466. if (channelsBuilder_ == null) {
  467. if (value == null) {
  468. throw new NullPointerException();
  469. }
  470. ensureChannelsIsMutable();
  471. channels_.set(index, value);
  472. onChanged();
  473. } else {
  474. channelsBuilder_.setMessage(index, value);
  475. }
  476. return this;
  477. }
  478. /**
  479. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  480. */
  481. public Builder setChannels(
  482. int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) {
  483. if (channelsBuilder_ == null) {
  484. ensureChannelsIsMutable();
  485. channels_.set(index, builderForValue.build());
  486. onChanged();
  487. } else {
  488. channelsBuilder_.setMessage(index, builderForValue.build());
  489. }
  490. return this;
  491. }
  492. /**
  493. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  494. */
  495. public Builder addChannels(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel value) {
  496. if (channelsBuilder_ == null) {
  497. if (value == null) {
  498. throw new NullPointerException();
  499. }
  500. ensureChannelsIsMutable();
  501. channels_.add(value);
  502. onChanged();
  503. } else {
  504. channelsBuilder_.addMessage(value);
  505. }
  506. return this;
  507. }
  508. /**
  509. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  510. */
  511. public Builder addChannels(
  512. int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel value) {
  513. if (channelsBuilder_ == null) {
  514. if (value == null) {
  515. throw new NullPointerException();
  516. }
  517. ensureChannelsIsMutable();
  518. channels_.add(index, value);
  519. onChanged();
  520. } else {
  521. channelsBuilder_.addMessage(index, value);
  522. }
  523. return this;
  524. }
  525. /**
  526. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  527. */
  528. public Builder addChannels(
  529. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) {
  530. if (channelsBuilder_ == null) {
  531. ensureChannelsIsMutable();
  532. channels_.add(builderForValue.build());
  533. onChanged();
  534. } else {
  535. channelsBuilder_.addMessage(builderForValue.build());
  536. }
  537. return this;
  538. }
  539. /**
  540. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  541. */
  542. public Builder addChannels(
  543. int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) {
  544. if (channelsBuilder_ == null) {
  545. ensureChannelsIsMutable();
  546. channels_.add(index, builderForValue.build());
  547. onChanged();
  548. } else {
  549. channelsBuilder_.addMessage(index, builderForValue.build());
  550. }
  551. return this;
  552. }
  553. /**
  554. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  555. */
  556. public Builder addAllChannels(
  557. java.lang.Iterable<? extends com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel> values) {
  558. if (channelsBuilder_ == null) {
  559. ensureChannelsIsMutable();
  560. super.addAll(values, channels_);
  561. onChanged();
  562. } else {
  563. channelsBuilder_.addAllMessages(values);
  564. }
  565. return this;
  566. }
  567. /**
  568. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  569. */
  570. public Builder clearChannels() {
  571. if (channelsBuilder_ == null) {
  572. channels_ = java.util.Collections.emptyList();
  573. bitField0_ = (bitField0_ & ~0x00000001);
  574. onChanged();
  575. } else {
  576. channelsBuilder_.clear();
  577. }
  578. return this;
  579. }
  580. /**
  581. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  582. */
  583. public Builder removeChannels(int index) {
  584. if (channelsBuilder_ == null) {
  585. ensureChannelsIsMutable();
  586. channels_.remove(index);
  587. onChanged();
  588. } else {
  589. channelsBuilder_.remove(index);
  590. }
  591. return this;
  592. }
  593. /**
  594. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  595. */
  596. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder getChannelsBuilder(
  597. int index) {
  598. return getChannelsFieldBuilder().getBuilder(index);
  599. }
  600. /**
  601. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  602. */
  603. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder(
  604. int index) {
  605. if (channelsBuilder_ == null) {
  606. return channels_.get(index); } else {
  607. return channelsBuilder_.getMessageOrBuilder(index);
  608. }
  609. }
  610. /**
  611. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  612. */
  613. public java.util.List<? extends com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder>
  614. getChannelsOrBuilderList() {
  615. if (channelsBuilder_ != null) {
  616. return channelsBuilder_.getMessageOrBuilderList();
  617. } else {
  618. return java.util.Collections.unmodifiableList(channels_);
  619. }
  620. }
  621. /**
  622. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  623. */
  624. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder addChannelsBuilder() {
  625. return getChannelsFieldBuilder().addBuilder(
  626. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance());
  627. }
  628. /**
  629. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  630. */
  631. public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder addChannelsBuilder(
  632. int index) {
  633. return getChannelsFieldBuilder().addBuilder(
  634. index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance());
  635. }
  636. /**
  637. * <code>repeated .paymentchannels.StoredClientPaymentChannel channels = 1;</code>
  638. */
  639. public java.util.List<com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder>
  640. getChannelsBuilderList() {
  641. return getChannelsFieldBuilder().getBuilderList();
  642. }
  643. private com.google.protobuf.RepeatedFieldBuilder<
  644. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder>
  645. getChannelsFieldBuilder() {
  646. if (channelsBuilder_ == null) {
  647. channelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  648. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder>(
  649. channels_,
  650. ((bitField0_ & 0x00000001) == 0x00000001),
  651. getParentForChildren(),
  652. isClean());
  653. channels_ = null;
  654. }
  655. return channelsBuilder_;
  656. }
  657. // @@protoc_insertion_point(builder_scope:paymentchannels.StoredClientPaymentChannels)
  658. }
  659. static {
  660. defaultInstance = new StoredClientPaymentChannels(true);
  661. defaultInstance.initFields();
  662. }
  663. // @@protoc_insertion_point(class_scope:paymentchannels.StoredClientPaymentChannels)
  664. }
  665. public interface StoredClientPaymentChannelOrBuilder
  666. extends com.google.protobuf.MessageOrBuilder {
  667. // required bytes id = 1;
  668. /**
  669. * <code>required bytes id = 1;</code>
  670. */
  671. boolean hasId();
  672. /**
  673. * <code>required bytes id = 1;</code>
  674. */
  675. com.google.protobuf.ByteString getId();
  676. // required bytes contractTransaction = 2;
  677. /**
  678. * <code>required bytes contractTransaction = 2;</code>
  679. */
  680. boolean hasContractTransaction();
  681. /**
  682. * <code>required bytes contractTransaction = 2;</code>
  683. */
  684. com.google.protobuf.ByteString getContractTransaction();
  685. // required bytes refundTransaction = 3;
  686. /**
  687. * <code>required bytes refundTransaction = 3;</code>
  688. */
  689. boolean hasRefundTransaction();
  690. /**
  691. * <code>required bytes refundTransaction = 3;</code>
  692. */
  693. com.google.protobuf.ByteString getRefundTransaction();
  694. // required bytes myKey = 4;
  695. /**
  696. * <code>required bytes myKey = 4;</code>
  697. */
  698. boolean hasMyKey();
  699. /**
  700. * <code>required bytes myKey = 4;</code>
  701. */
  702. com.google.protobuf.ByteString getMyKey();
  703. // required uint64 valueToMe = 5;
  704. /**
  705. * <code>required uint64 valueToMe = 5;</code>
  706. */
  707. boolean hasValueToMe();
  708. /**
  709. * <code>required uint64 valueToMe = 5;</code>
  710. */
  711. long getValueToMe();
  712. // required uint64 refundFees = 6;
  713. /**
  714. * <code>required uint64 refundFees = 6;</code>
  715. */
  716. boolean hasRefundFees();
  717. /**
  718. * <code>required uint64 refundFees = 6;</code>
  719. */
  720. long getRefundFees();
  721. // optional bytes closeTransactionHash = 7;
  722. /**
  723. * <code>optional bytes closeTransactionHash = 7;</code>
  724. *
  725. * <pre>
  726. * When set, the hash of the transaction that was presented by the server for closure of the channel.
  727. * It spends the contractTransaction and is expected to be broadcast to the network by the server.
  728. * It's supposed to be in the wallet already.
  729. * </pre>
  730. */
  731. boolean hasCloseTransactionHash();
  732. /**
  733. * <code>optional bytes closeTransactionHash = 7;</code>
  734. *
  735. * <pre>
  736. * When set, the hash of the transaction that was presented by the server for closure of the channel.
  737. * It spends the contractTransaction and is expected to be broadcast to the network by the server.
  738. * It's supposed to be in the wallet already.
  739. * </pre>
  740. */
  741. com.google.protobuf.ByteString getCloseTransactionHash();
  742. }
  743. /**
  744. * Protobuf type {@code paymentchannels.StoredClientPaymentChannel}
  745. *
  746. * <pre>
  747. * A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to
  748. * reopen an existing channel
  749. * </pre>
  750. */
  751. public static final class StoredClientPaymentChannel extends
  752. com.google.protobuf.GeneratedMessage
  753. implements StoredClientPaymentChannelOrBuilder {
  754. // Use StoredClientPaymentChannel.newBuilder() to construct.
  755. private StoredClientPaymentChannel(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  756. super(builder);
  757. this.unknownFields = builder.getUnknownFields();
  758. }
  759. private StoredClientPaymentChannel(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  760. private static final StoredClientPaymentChannel defaultInstance;
  761. public static StoredClientPaymentChannel getDefaultInstance() {
  762. return defaultInstance;
  763. }
  764. public StoredClientPaymentChannel getDefaultInstanceForType() {
  765. return defaultInstance;
  766. }
  767. private final com.google.protobuf.UnknownFieldSet unknownFields;
  768. @java.lang.Override
  769. public final com.google.protobuf.UnknownFieldSet
  770. getUnknownFields() {
  771. return this.unknownFields;
  772. }
  773. private StoredClientPaymentChannel(
  774. com.google.protobuf.CodedInputStream input,
  775. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  776. throws com.google.protobuf.InvalidProtocolBufferException {
  777. initFields();
  778. int mutable_bitField0_ = 0;
  779. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  780. com.google.protobuf.UnknownFieldSet.newBuilder();
  781. try {
  782. boolean done = false;
  783. while (!done) {
  784. int tag = input.readTag();
  785. switch (tag) {
  786. case 0:
  787. done = true;
  788. break;
  789. default: {
  790. if (!parseUnknownField(input, unknownFields,
  791. extensionRegistry, tag)) {
  792. done = true;
  793. }
  794. break;
  795. }
  796. case 10: {
  797. bitField0_ |= 0x00000001;
  798. id_ = input.readBytes();
  799. break;
  800. }
  801. case 18: {
  802. bitField0_ |= 0x00000002;
  803. contractTransaction_ = input.readBytes();
  804. break;
  805. }
  806. case 26: {
  807. bitField0_ |= 0x00000004;
  808. refundTransaction_ = input.readBytes();
  809. break;
  810. }
  811. case 34: {
  812. bitField0_ |= 0x00000008;
  813. myKey_ = input.readBytes();
  814. break;
  815. }
  816. case 40: {
  817. bitField0_ |= 0x00000010;
  818. valueToMe_ = input.readUInt64();
  819. break;
  820. }
  821. case 48: {
  822. bitField0_ |= 0x00000020;
  823. refundFees_ = input.readUInt64();
  824. break;
  825. }
  826. case 58: {
  827. bitField0_ |= 0x00000040;
  828. closeTransactionHash_ = input.readBytes();
  829. break;
  830. }
  831. }
  832. }
  833. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  834. throw e.setUnfinishedMessage(this);
  835. } catch (java.io.IOException e) {
  836. throw new com.google.protobuf.InvalidProtocolBufferException(
  837. e.getMessage()).setUnfinishedMessage(this);
  838. } finally {
  839. this.unknownFields = unknownFields.build();
  840. makeExtensionsImmutable();
  841. }
  842. }
  843. public static final com.google.protobuf.Descriptors.Descriptor
  844. getDescriptor() {
  845. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor;
  846. }
  847. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  848. internalGetFieldAccessorTable() {
  849. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable
  850. .ensureFieldAccessorsInitialized(
  851. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class);
  852. }
  853. public static com.google.protobuf.Parser<StoredClientPaymentChannel> PARSER =
  854. new com.google.protobuf.AbstractParser<StoredClientPaymentChannel>() {
  855. public StoredClientPaymentChannel parsePartialFrom(
  856. com.google.protobuf.CodedInputStream input,
  857. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  858. throws com.google.protobuf.InvalidProtocolBufferException {
  859. return new StoredClientPaymentChannel(input, extensionRegistry);
  860. }
  861. };
  862. @java.lang.Override
  863. public com.google.protobuf.Parser<StoredClientPaymentChannel> getParserForType() {
  864. return PARSER;
  865. }
  866. private int bitField0_;
  867. // required bytes id = 1;
  868. public static final int ID_FIELD_NUMBER = 1;
  869. private com.google.protobuf.ByteString id_;
  870. /**
  871. * <code>required bytes id = 1;</code>
  872. */
  873. public boolean hasId() {
  874. return ((bitField0_ & 0x00000001) == 0x00000001);
  875. }
  876. /**
  877. * <code>required bytes id = 1;</code>
  878. */
  879. public com.google.protobuf.ByteString getId() {
  880. return id_;
  881. }
  882. // required bytes contractTransaction = 2;
  883. public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 2;
  884. private com.google.protobuf.ByteString contractTransaction_;
  885. /**
  886. * <code>required bytes contractTransaction = 2;</code>
  887. */
  888. public boolean hasContractTransaction() {
  889. return ((bitField0_ & 0x00000002) == 0x00000002);
  890. }
  891. /**
  892. * <code>required bytes contractTransaction = 2;</code>
  893. */
  894. public com.google.protobuf.ByteString getContractTransaction() {
  895. return contractTransaction_;
  896. }
  897. // required bytes refundTransaction = 3;
  898. public static final int REFUNDTRANSACTION_FIELD_NUMBER = 3;
  899. private com.google.protobuf.ByteString refundTransaction_;
  900. /**
  901. * <code>required bytes refundTransaction = 3;</code>
  902. */
  903. public boolean hasRefundTransaction() {
  904. return ((bitField0_ & 0x00000004) == 0x00000004);
  905. }
  906. /**
  907. * <code>required bytes refundTransaction = 3;</code>
  908. */
  909. public com.google.protobuf.ByteString getRefundTransaction() {
  910. return refundTransaction_;
  911. }
  912. // required bytes myKey = 4;
  913. public static final int MYKEY_FIELD_NUMBER = 4;
  914. private com.google.protobuf.ByteString myKey_;
  915. /**
  916. * <code>required bytes myKey = 4;</code>
  917. */
  918. public boolean hasMyKey() {
  919. return ((bitField0_ & 0x00000008) == 0x00000008);
  920. }
  921. /**
  922. * <code>required bytes myKey = 4;</code>
  923. */
  924. public com.google.protobuf.ByteString getMyKey() {
  925. return myKey_;
  926. }
  927. // required uint64 valueToMe = 5;
  928. public static final int VALUETOME_FIELD_NUMBER = 5;
  929. private long valueToMe_;
  930. /**
  931. * <code>required uint64 valueToMe = 5;</code>
  932. */
  933. public boolean hasValueToMe() {
  934. return ((bitField0_ & 0x00000010) == 0x00000010);
  935. }
  936. /**
  937. * <code>required uint64 valueToMe = 5;</code>
  938. */
  939. public long getValueToMe() {
  940. return valueToMe_;
  941. }
  942. // required uint64 refundFees = 6;
  943. public static final int REFUNDFEES_FIELD_NUMBER = 6;
  944. private long refundFees_;
  945. /**
  946. * <code>required uint64 refundFees = 6;</code>
  947. */
  948. public boolean hasRefundFees() {
  949. return ((bitField0_ & 0x00000020) == 0x00000020);
  950. }
  951. /**
  952. * <code>required uint64 refundFees = 6;</code>
  953. */
  954. public long getRefundFees() {
  955. return refundFees_;
  956. }
  957. // optional bytes closeTransactionHash = 7;
  958. public static final int CLOSETRANSACTIONHASH_FIELD_NUMBER = 7;
  959. private com.google.protobuf.ByteString closeTransactionHash_;
  960. /**
  961. * <code>optional bytes closeTransactionHash = 7;</code>
  962. *
  963. * <pre>
  964. * When set, the hash of the transaction that was presented by the server for closure of the channel.
  965. * It spends the contractTransaction and is expected to be broadcast to the network by the server.
  966. * It's supposed to be in the wallet already.
  967. * </pre>
  968. */
  969. public boolean hasCloseTransactionHash() {
  970. return ((bitField0_ & 0x00000040) == 0x00000040);
  971. }
  972. /**
  973. * <code>optional bytes closeTransactionHash = 7;</code>
  974. *
  975. * <pre>
  976. * When set, the hash of the transaction that was presented by the server for closure of the channel.
  977. * It spends the contractTransaction and is expected to be broadcast to the network by the server.
  978. * It's supposed to be in the wallet already.
  979. * </pre>
  980. */
  981. public com.google.protobuf.ByteString getCloseTransactionHash() {
  982. return closeTransactionHash_;
  983. }
  984. private void initFields() {
  985. id_ = com.google.protobuf.ByteString.EMPTY;
  986. contractTransaction_ = com.google.protobuf.ByteString.EMPTY;
  987. refundTransaction_ = com.google.protobuf.ByteString.EMPTY;
  988. myKey_ = com.google.protobuf.ByteString.EMPTY;
  989. valueToMe_ = 0L;
  990. refundFees_ = 0L;
  991. closeTransactionHash_ = com.google.protobuf.ByteString.EMPTY;
  992. }
  993. private byte memoizedIsInitialized = -1;
  994. public final boolean isInitialized() {
  995. byte isInitialized = memoizedIsInitialized;
  996. if (isInitialized != -1) return isInitialized == 1;
  997. if (!hasId()) {
  998. memoizedIsInitialized = 0;
  999. return false;
  1000. }
  1001. if (!hasContractTransaction()) {
  1002. memoizedIsInitialized = 0;
  1003. return false;
  1004. }
  1005. if (!hasRefundTransaction()) {
  1006. memoizedIsInitialized = 0;
  1007. return false;
  1008. }
  1009. if (!hasMyKey()) {
  1010. memoizedIsInitialized = 0;
  1011. return false;
  1012. }
  1013. if (!hasValueToMe()) {
  1014. memoizedIsInitialized = 0;
  1015. return false;
  1016. }
  1017. if (!hasRefundFees()) {
  1018. memoizedIsInitialized = 0;
  1019. return false;
  1020. }
  1021. memoizedIsInitialized = 1;
  1022. return true;
  1023. }
  1024. public void writeTo(com.google.protobuf.CodedOutputStream output)
  1025. throws java.io.IOException {
  1026. getSerializedSize();
  1027. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  1028. output.writeBytes(1, id_);
  1029. }
  1030. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  1031. output.writeBytes(2, contractTransaction_);
  1032. }
  1033. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  1034. output.writeBytes(3, refundTransaction_);
  1035. }
  1036. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  1037. output.writeBytes(4, myKey_);
  1038. }
  1039. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  1040. output.writeUInt64(5, valueToMe_);
  1041. }
  1042. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  1043. output.writeUInt64(6, refundFees_);
  1044. }
  1045. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  1046. output.writeBytes(7, closeTransactionHash_);
  1047. }
  1048. getUnknownFields().writeTo(output);
  1049. }
  1050. private int memoizedSerializedSize = -1;
  1051. public int getSerializedSize() {
  1052. int size = memoizedSerializedSize;
  1053. if (size != -1) return size;
  1054. size = 0;
  1055. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  1056. size += com.google.protobuf.CodedOutputStream
  1057. .computeBytesSize(1, id_);
  1058. }
  1059. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  1060. size += com.google.protobuf.CodedOutputStream
  1061. .computeBytesSize(2, contractTransaction_);
  1062. }
  1063. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  1064. size += com.google.protobuf.CodedOutputStream
  1065. .computeBytesSize(3, refundTransaction_);
  1066. }
  1067. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  1068. size += com.google.protobuf.CodedOutputStream
  1069. .computeBytesSize(4, myKey_);
  1070. }
  1071. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  1072. size += com.google.protobuf.CodedOutputStream
  1073. .computeUInt64Size(5, valueToMe_);
  1074. }
  1075. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  1076. size += com.google.protobuf.CodedOutputStream
  1077. .computeUInt64Size(6, refundFees_);
  1078. }
  1079. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  1080. size += com.google.protobuf.CodedOutputStream
  1081. .computeBytesSize(7, closeTransactionHash_);
  1082. }
  1083. size += getUnknownFields().getSerializedSize();
  1084. memoizedSerializedSize = size;
  1085. return size;
  1086. }
  1087. private static final long serialVersionUID = 0L;
  1088. @java.lang.Override
  1089. protected java.lang.Object writeReplace()
  1090. throws java.io.ObjectStreamException {
  1091. return super.writeReplace();
  1092. }
  1093. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(
  1094. com.google.protobuf.ByteString data)
  1095. throws com.google.protobuf.InvalidProtocolBufferException {
  1096. return PARSER.parseFrom(data);
  1097. }
  1098. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(
  1099. com.google.protobuf.ByteString data,
  1100. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1101. throws com.google.protobuf.InvalidProtocolBufferException {
  1102. return PARSER.parseFrom(data, extensionRegistry);
  1103. }
  1104. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(byte[] data)
  1105. throws com.google.protobuf.InvalidProtocolBufferException {
  1106. return PARSER.parseFrom(data);
  1107. }
  1108. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(
  1109. byte[] data,
  1110. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1111. throws com.google.protobuf.InvalidProtocolBufferException {
  1112. return PARSER.parseFrom(data, extensionRegistry);
  1113. }
  1114. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(java.io.InputStream input)
  1115. throws java.io.IOException {
  1116. return PARSER.parseFrom(input);
  1117. }
  1118. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(
  1119. java.io.InputStream input,
  1120. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1121. throws java.io.IOException {
  1122. return PARSER.parseFrom(input, extensionRegistry);
  1123. }
  1124. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom(java.io.InputStream input)
  1125. throws java.io.IOException {
  1126. return PARSER.parseDelimitedFrom(input);
  1127. }
  1128. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom(
  1129. java.io.InputStream input,
  1130. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1131. throws java.io.IOException {
  1132. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  1133. }
  1134. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(
  1135. com.google.protobuf.CodedInputStream input)
  1136. throws java.io.IOException {
  1137. return PARSER.parseFrom(input);
  1138. }
  1139. public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(
  1140. com.google.protobuf.CodedInputStream input,
  1141. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1142. throws java.io.IOException {
  1143. return PARSER.parseFrom(input, extensionRegistry);
  1144. }
  1145. public static Builder newBuilder() { return Builder.create(); }
  1146. public Builder newBuilderForType() { return newBuilder(); }
  1147. public static Builder newBuilder(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel prototype) {
  1148. return newBuilder().mergeFrom(prototype);
  1149. }
  1150. public Builder toBuilder() { return newBuilder(this); }
  1151. @java.lang.Override
  1152. protected Builder newBuilderForType(
  1153. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1154. Builder builder = new Builder(parent);
  1155. return builder;
  1156. }
  1157. /**
  1158. * Protobuf type {@code paymentchannels.StoredClientPaymentChannel}
  1159. *
  1160. * <pre>
  1161. * A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to
  1162. * reopen an existing channel
  1163. * </pre>
  1164. */
  1165. public static final class Builder extends
  1166. com.google.protobuf.GeneratedMessage.Builder<Builder>
  1167. implements com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder {
  1168. public static final com.google.protobuf.Descriptors.Descriptor
  1169. getDescriptor() {
  1170. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor;
  1171. }
  1172. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  1173. internalGetFieldAccessorTable() {
  1174. return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable
  1175. .ensureFieldAccessorsInitialized(
  1176. com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class);
  1177. }
  1178. // Construct using com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.newBuilder()
  1179. private Builder() {
  1180. maybeForceBuilderInitialization();
  1181. }
  1182. private Builder(
  1183. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1184. super(parent);
  1185. maybeForceBuilderInitialization();
  1186. }
  1187. private void maybeForceBuilderInitialization() {
  1188. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  1189. }
  1190. }
  1191. private static Builder create() {
  1192. return new Builder();
  1193. }
  1194. public Builder clear() {
  1195. super.clear();
  1196. id_ = com.google.protobuf.ByteString.EMPTY;
  1197. bitField0_ = (bitField0_ & ~0x00000001);
  1198. contractTransaction_ = com.google.protobuf.ByteString.EMPTY;
  1199. bitField0_ = (bitField0_ & ~0x00000002);
  1200. refundTransaction_ = com.google.protobuf.B

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