PageRenderTime 111ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://code.google.com/
Java | 1623 lines | 1238 code | 97 blank | 288 comment | 184 complexity | 931520b6835a22add24553989aa395e3 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: storedserverpaymentchannel.proto
  3. package com.google.bitcoin.protocols.channels;
  4. public final class ServerState {
  5. private ServerState() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public interface StoredServerPaymentChannelsOrBuilder
  10. extends com.google.protobuf.MessageOrBuilder {
  11. // repeated .paymentchannels.StoredServerPaymentChannel channels = 1;
  12. /**
  13. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  14. */
  15. java.util.List<com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel>
  16. getChannelsList();
  17. /**
  18. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  19. */
  20. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index);
  21. /**
  22. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  23. */
  24. int getChannelsCount();
  25. /**
  26. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  27. */
  28. java.util.List<? extends com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder>
  29. getChannelsOrBuilderList();
  30. /**
  31. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  32. */
  33. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder(
  34. int index);
  35. }
  36. /**
  37. * Protobuf type {@code paymentchannels.StoredServerPaymentChannels}
  38. *
  39. * <pre>
  40. * A set of StoredPaymentChannel's
  41. * </pre>
  42. */
  43. public static final class StoredServerPaymentChannels extends
  44. com.google.protobuf.GeneratedMessage
  45. implements StoredServerPaymentChannelsOrBuilder {
  46. // Use StoredServerPaymentChannels.newBuilder() to construct.
  47. private StoredServerPaymentChannels(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  48. super(builder);
  49. this.unknownFields = builder.getUnknownFields();
  50. }
  51. private StoredServerPaymentChannels(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  52. private static final StoredServerPaymentChannels defaultInstance;
  53. public static StoredServerPaymentChannels getDefaultInstance() {
  54. return defaultInstance;
  55. }
  56. public StoredServerPaymentChannels 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 StoredServerPaymentChannels(
  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.ServerState.StoredServerPaymentChannel>();
  91. mutable_bitField0_ |= 0x00000001;
  92. }
  93. channels_.add(input.readMessage(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.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.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor;
  114. }
  115. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  116. internalGetFieldAccessorTable() {
  117. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable
  118. .ensureFieldAccessorsInitialized(
  119. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class);
  120. }
  121. public static com.google.protobuf.Parser<StoredServerPaymentChannels> PARSER =
  122. new com.google.protobuf.AbstractParser<StoredServerPaymentChannels>() {
  123. public StoredServerPaymentChannels parsePartialFrom(
  124. com.google.protobuf.CodedInputStream input,
  125. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  126. throws com.google.protobuf.InvalidProtocolBufferException {
  127. return new StoredServerPaymentChannels(input, extensionRegistry);
  128. }
  129. };
  130. @java.lang.Override
  131. public com.google.protobuf.Parser<StoredServerPaymentChannels> getParserForType() {
  132. return PARSER;
  133. }
  134. // repeated .paymentchannels.StoredServerPaymentChannel channels = 1;
  135. public static final int CHANNELS_FIELD_NUMBER = 1;
  136. private java.util.List<com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel> channels_;
  137. /**
  138. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  139. */
  140. public java.util.List<com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel> getChannelsList() {
  141. return channels_;
  142. }
  143. /**
  144. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  145. */
  146. public java.util.List<? extends com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder>
  147. getChannelsOrBuilderList() {
  148. return channels_;
  149. }
  150. /**
  151. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  152. */
  153. public int getChannelsCount() {
  154. return channels_.size();
  155. }
  156. /**
  157. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  158. */
  159. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index) {
  160. return channels_.get(index);
  161. }
  162. /**
  163. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  164. */
  165. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder 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.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels parseFrom(byte[] data)
  224. throws com.google.protobuf.InvalidProtocolBufferException {
  225. return PARSER.parseFrom(data);
  226. }
  227. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels parseFrom(java.io.InputStream input)
  234. throws java.io.IOException {
  235. return PARSER.parseFrom(input);
  236. }
  237. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels parseDelimitedFrom(java.io.InputStream input)
  244. throws java.io.IOException {
  245. return PARSER.parseDelimitedFrom(input);
  246. }
  247. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels 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.ServerState.StoredServerPaymentChannels 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.StoredServerPaymentChannels}
  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.ServerState.StoredServerPaymentChannelsOrBuilder {
  286. public static final com.google.protobuf.Descriptors.Descriptor
  287. getDescriptor() {
  288. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor;
  289. }
  290. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  291. internalGetFieldAccessorTable() {
  292. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable
  293. .ensureFieldAccessorsInitialized(
  294. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class);
  295. }
  296. // Construct using com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.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.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor;
  329. }
  330. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels getDefaultInstanceForType() {
  331. return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.getDefaultInstance();
  332. }
  333. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels build() {
  334. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels result = buildPartial();
  335. if (!result.isInitialized()) {
  336. throw newUninitializedMessageException(result);
  337. }
  338. return result;
  339. }
  340. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels buildPartial() {
  341. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels result = new com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels(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.ServerState.StoredServerPaymentChannels) {
  357. return mergeFrom((com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels)other);
  358. } else {
  359. super.mergeFrom(other);
  360. return this;
  361. }
  362. }
  363. public Builder mergeFrom(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels other) {
  364. if (other == com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.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.ServerState.StoredServerPaymentChannels parsedMessage = null;
  407. try {
  408. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  409. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  410. parsedMessage = (com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels) 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.StoredServerPaymentChannel channels = 1;
  421. private java.util.List<com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel> 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.ServerState.StoredServerPaymentChannel>(channels_);
  426. bitField0_ |= 0x00000001;
  427. }
  428. }
  429. private com.google.protobuf.RepeatedFieldBuilder<
  430. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder> channelsBuilder_;
  431. /**
  432. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  433. */
  434. public java.util.List<com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel> 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.StoredServerPaymentChannel 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.StoredServerPaymentChannel channels = 1;</code>
  453. */
  454. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel 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.StoredServerPaymentChannel channels = 1;</code>
  463. */
  464. public Builder setChannels(
  465. int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel 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.StoredServerPaymentChannel channels = 1;</code>
  480. */
  481. public Builder setChannels(
  482. int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.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.StoredServerPaymentChannel channels = 1;</code>
  494. */
  495. public Builder addChannels(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel 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.StoredServerPaymentChannel channels = 1;</code>
  510. */
  511. public Builder addChannels(
  512. int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel 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.StoredServerPaymentChannel channels = 1;</code>
  527. */
  528. public Builder addChannels(
  529. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.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.StoredServerPaymentChannel channels = 1;</code>
  541. */
  542. public Builder addChannels(
  543. int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.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.StoredServerPaymentChannel channels = 1;</code>
  555. */
  556. public Builder addAllChannels(
  557. java.lang.Iterable<? extends com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel> 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.StoredServerPaymentChannel 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.StoredServerPaymentChannel 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.StoredServerPaymentChannel channels = 1;</code>
  595. */
  596. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder getChannelsBuilder(
  597. int index) {
  598. return getChannelsFieldBuilder().getBuilder(index);
  599. }
  600. /**
  601. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  602. */
  603. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder 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.StoredServerPaymentChannel channels = 1;</code>
  612. */
  613. public java.util.List<? extends com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder>
  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.StoredServerPaymentChannel channels = 1;</code>
  623. */
  624. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder addChannelsBuilder() {
  625. return getChannelsFieldBuilder().addBuilder(
  626. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance());
  627. }
  628. /**
  629. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  630. */
  631. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder addChannelsBuilder(
  632. int index) {
  633. return getChannelsFieldBuilder().addBuilder(
  634. index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance());
  635. }
  636. /**
  637. * <code>repeated .paymentchannels.StoredServerPaymentChannel channels = 1;</code>
  638. */
  639. public java.util.List<com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder>
  640. getChannelsBuilderList() {
  641. return getChannelsFieldBuilder().getBuilderList();
  642. }
  643. private com.google.protobuf.RepeatedFieldBuilder<
  644. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder>
  645. getChannelsFieldBuilder() {
  646. if (channelsBuilder_ == null) {
  647. channelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  648. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder>(
  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.StoredServerPaymentChannels)
  658. }
  659. static {
  660. defaultInstance = new StoredServerPaymentChannels(true);
  661. defaultInstance.initFields();
  662. }
  663. // @@protoc_insertion_point(class_scope:paymentchannels.StoredServerPaymentChannels)
  664. }
  665. public interface StoredServerPaymentChannelOrBuilder
  666. extends com.google.protobuf.MessageOrBuilder {
  667. // required uint64 bestValueToMe = 1;
  668. /**
  669. * <code>required uint64 bestValueToMe = 1;</code>
  670. */
  671. boolean hasBestValueToMe();
  672. /**
  673. * <code>required uint64 bestValueToMe = 1;</code>
  674. */
  675. long getBestValueToMe();
  676. // optional bytes bestValueSignature = 2;
  677. /**
  678. * <code>optional bytes bestValueSignature = 2;</code>
  679. */
  680. boolean hasBestValueSignature();
  681. /**
  682. * <code>optional bytes bestValueSignature = 2;</code>
  683. */
  684. com.google.protobuf.ByteString getBestValueSignature();
  685. // required uint64 refundTransactionUnlockTimeSecs = 3;
  686. /**
  687. * <code>required uint64 refundTransactionUnlockTimeSecs = 3;</code>
  688. */
  689. boolean hasRefundTransactionUnlockTimeSecs();
  690. /**
  691. * <code>required uint64 refundTransactionUnlockTimeSecs = 3;</code>
  692. */
  693. long getRefundTransactionUnlockTimeSecs();
  694. // required bytes contractTransaction = 4;
  695. /**
  696. * <code>required bytes contractTransaction = 4;</code>
  697. */
  698. boolean hasContractTransaction();
  699. /**
  700. * <code>required bytes contractTransaction = 4;</code>
  701. */
  702. com.google.protobuf.ByteString getContractTransaction();
  703. // required bytes clientOutput = 5;
  704. /**
  705. * <code>required bytes clientOutput = 5;</code>
  706. */
  707. boolean hasClientOutput();
  708. /**
  709. * <code>required bytes clientOutput = 5;</code>
  710. */
  711. com.google.protobuf.ByteString getClientOutput();
  712. // required bytes myKey = 6;
  713. /**
  714. * <code>required bytes myKey = 6;</code>
  715. */
  716. boolean hasMyKey();
  717. /**
  718. * <code>required bytes myKey = 6;</code>
  719. */
  720. com.google.protobuf.ByteString getMyKey();
  721. }
  722. /**
  723. * Protobuf type {@code paymentchannels.StoredServerPaymentChannel}
  724. *
  725. * <pre>
  726. * A server-side payment channel in serialized form, which can be reloaded later if the server restarts
  727. * </pre>
  728. */
  729. public static final class StoredServerPaymentChannel extends
  730. com.google.protobuf.GeneratedMessage
  731. implements StoredServerPaymentChannelOrBuilder {
  732. // Use StoredServerPaymentChannel.newBuilder() to construct.
  733. private StoredServerPaymentChannel(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  734. super(builder);
  735. this.unknownFields = builder.getUnknownFields();
  736. }
  737. private StoredServerPaymentChannel(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  738. private static final StoredServerPaymentChannel defaultInstance;
  739. public static StoredServerPaymentChannel getDefaultInstance() {
  740. return defaultInstance;
  741. }
  742. public StoredServerPaymentChannel getDefaultInstanceForType() {
  743. return defaultInstance;
  744. }
  745. private final com.google.protobuf.UnknownFieldSet unknownFields;
  746. @java.lang.Override
  747. public final com.google.protobuf.UnknownFieldSet
  748. getUnknownFields() {
  749. return this.unknownFields;
  750. }
  751. private StoredServerPaymentChannel(
  752. com.google.protobuf.CodedInputStream input,
  753. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  754. throws com.google.protobuf.InvalidProtocolBufferException {
  755. initFields();
  756. int mutable_bitField0_ = 0;
  757. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  758. com.google.protobuf.UnknownFieldSet.newBuilder();
  759. try {
  760. boolean done = false;
  761. while (!done) {
  762. int tag = input.readTag();
  763. switch (tag) {
  764. case 0:
  765. done = true;
  766. break;
  767. default: {
  768. if (!parseUnknownField(input, unknownFields,
  769. extensionRegistry, tag)) {
  770. done = true;
  771. }
  772. break;
  773. }
  774. case 8: {
  775. bitField0_ |= 0x00000001;
  776. bestValueToMe_ = input.readUInt64();
  777. break;
  778. }
  779. case 18: {
  780. bitField0_ |= 0x00000002;
  781. bestValueSignature_ = input.readBytes();
  782. break;
  783. }
  784. case 24: {
  785. bitField0_ |= 0x00000004;
  786. refundTransactionUnlockTimeSecs_ = input.readUInt64();
  787. break;
  788. }
  789. case 34: {
  790. bitField0_ |= 0x00000008;
  791. contractTransaction_ = input.readBytes();
  792. break;
  793. }
  794. case 42: {
  795. bitField0_ |= 0x00000010;
  796. clientOutput_ = input.readBytes();
  797. break;
  798. }
  799. case 50: {
  800. bitField0_ |= 0x00000020;
  801. myKey_ = input.readBytes();
  802. break;
  803. }
  804. }
  805. }
  806. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  807. throw e.setUnfinishedMessage(this);
  808. } catch (java.io.IOException e) {
  809. throw new com.google.protobuf.InvalidProtocolBufferException(
  810. e.getMessage()).setUnfinishedMessage(this);
  811. } finally {
  812. this.unknownFields = unknownFields.build();
  813. makeExtensionsImmutable();
  814. }
  815. }
  816. public static final com.google.protobuf.Descriptors.Descriptor
  817. getDescriptor() {
  818. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor;
  819. }
  820. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  821. internalGetFieldAccessorTable() {
  822. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable
  823. .ensureFieldAccessorsInitialized(
  824. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class);
  825. }
  826. public static com.google.protobuf.Parser<StoredServerPaymentChannel> PARSER =
  827. new com.google.protobuf.AbstractParser<StoredServerPaymentChannel>() {
  828. public StoredServerPaymentChannel parsePartialFrom(
  829. com.google.protobuf.CodedInputStream input,
  830. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  831. throws com.google.protobuf.InvalidProtocolBufferException {
  832. return new StoredServerPaymentChannel(input, extensionRegistry);
  833. }
  834. };
  835. @java.lang.Override
  836. public com.google.protobuf.Parser<StoredServerPaymentChannel> getParserForType() {
  837. return PARSER;
  838. }
  839. private int bitField0_;
  840. // required uint64 bestValueToMe = 1;
  841. public static final int BESTVALUETOME_FIELD_NUMBER = 1;
  842. private long bestValueToMe_;
  843. /**
  844. * <code>required uint64 bestValueToMe = 1;</code>
  845. */
  846. public boolean hasBestValueToMe() {
  847. return ((bitField0_ & 0x00000001) == 0x00000001);
  848. }
  849. /**
  850. * <code>required uint64 bestValueToMe = 1;</code>
  851. */
  852. public long getBestValueToMe() {
  853. return bestValueToMe_;
  854. }
  855. // optional bytes bestValueSignature = 2;
  856. public static final int BESTVALUESIGNATURE_FIELD_NUMBER = 2;
  857. private com.google.protobuf.ByteString bestValueSignature_;
  858. /**
  859. * <code>optional bytes bestValueSignature = 2;</code>
  860. */
  861. public boolean hasBestValueSignature() {
  862. return ((bitField0_ & 0x00000002) == 0x00000002);
  863. }
  864. /**
  865. * <code>optional bytes bestValueSignature = 2;</code>
  866. */
  867. public com.google.protobuf.ByteString getBestValueSignature() {
  868. return bestValueSignature_;
  869. }
  870. // required uint64 refundTransactionUnlockTimeSecs = 3;
  871. public static final int REFUNDTRANSACTIONUNLOCKTIMESECS_FIELD_NUMBER = 3;
  872. private long refundTransactionUnlockTimeSecs_;
  873. /**
  874. * <code>required uint64 refundTransactionUnlockTimeSecs = 3;</code>
  875. */
  876. public boolean hasRefundTransactionUnlockTimeSecs() {
  877. return ((bitField0_ & 0x00000004) == 0x00000004);
  878. }
  879. /**
  880. * <code>required uint64 refundTransactionUnlockTimeSecs = 3;</code>
  881. */
  882. public long getRefundTransactionUnlockTimeSecs() {
  883. return refundTransactionUnlockTimeSecs_;
  884. }
  885. // required bytes contractTransaction = 4;
  886. public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 4;
  887. private com.google.protobuf.ByteString contractTransaction_;
  888. /**
  889. * <code>required bytes contractTransaction = 4;</code>
  890. */
  891. public boolean hasContractTransaction() {
  892. return ((bitField0_ & 0x00000008) == 0x00000008);
  893. }
  894. /**
  895. * <code>required bytes contractTransaction = 4;</code>
  896. */
  897. public com.google.protobuf.ByteString getContractTransaction() {
  898. return contractTransaction_;
  899. }
  900. // required bytes clientOutput = 5;
  901. public static final int CLIENTOUTPUT_FIELD_NUMBER = 5;
  902. private com.google.protobuf.ByteString clientOutput_;
  903. /**
  904. * <code>required bytes clientOutput = 5;</code>
  905. */
  906. public boolean hasClientOutput() {
  907. return ((bitField0_ & 0x00000010) == 0x00000010);
  908. }
  909. /**
  910. * <code>required bytes clientOutput = 5;</code>
  911. */
  912. public com.google.protobuf.ByteString getClientOutput() {
  913. return clientOutput_;
  914. }
  915. // required bytes myKey = 6;
  916. public static final int MYKEY_FIELD_NUMBER = 6;
  917. private com.google.protobuf.ByteString myKey_;
  918. /**
  919. * <code>required bytes myKey = 6;</code>
  920. */
  921. public boolean hasMyKey() {
  922. return ((bitField0_ & 0x00000020) == 0x00000020);
  923. }
  924. /**
  925. * <code>required bytes myKey = 6;</code>
  926. */
  927. public com.google.protobuf.ByteString getMyKey() {
  928. return myKey_;
  929. }
  930. private void initFields() {
  931. bestValueToMe_ = 0L;
  932. bestValueSignature_ = com.google.protobuf.ByteString.EMPTY;
  933. refundTransactionUnlockTimeSecs_ = 0L;
  934. contractTransaction_ = com.google.protobuf.ByteString.EMPTY;
  935. clientOutput_ = com.google.protobuf.ByteString.EMPTY;
  936. myKey_ = com.google.protobuf.ByteString.EMPTY;
  937. }
  938. private byte memoizedIsInitialized = -1;
  939. public final boolean isInitialized() {
  940. byte isInitialized = memoizedIsInitialized;
  941. if (isInitialized != -1) return isInitialized == 1;
  942. if (!hasBestValueToMe()) {
  943. memoizedIsInitialized = 0;
  944. return false;
  945. }
  946. if (!hasRefundTransactionUnlockTimeSecs()) {
  947. memoizedIsInitialized = 0;
  948. return false;
  949. }
  950. if (!hasContractTransaction()) {
  951. memoizedIsInitialized = 0;
  952. return false;
  953. }
  954. if (!hasClientOutput()) {
  955. memoizedIsInitialized = 0;
  956. return false;
  957. }
  958. if (!hasMyKey()) {
  959. memoizedIsInitialized = 0;
  960. return false;
  961. }
  962. memoizedIsInitialized = 1;
  963. return true;
  964. }
  965. public void writeTo(com.google.protobuf.CodedOutputStream output)
  966. throws java.io.IOException {
  967. getSerializedSize();
  968. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  969. output.writeUInt64(1, bestValueToMe_);
  970. }
  971. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  972. output.writeBytes(2, bestValueSignature_);
  973. }
  974. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  975. output.writeUInt64(3, refundTransactionUnlockTimeSecs_);
  976. }
  977. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  978. output.writeBytes(4, contractTransaction_);
  979. }
  980. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  981. output.writeBytes(5, clientOutput_);
  982. }
  983. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  984. output.writeBytes(6, myKey_);
  985. }
  986. getUnknownFields().writeTo(output);
  987. }
  988. private int memoizedSerializedSize = -1;
  989. public int getSerializedSize() {
  990. int size = memoizedSerializedSize;
  991. if (size != -1) return size;
  992. size = 0;
  993. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  994. size += com.google.protobuf.CodedOutputStream
  995. .computeUInt64Size(1, bestValueToMe_);
  996. }
  997. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  998. size += com.google.protobuf.CodedOutputStream
  999. .computeBytesSize(2, bestValueSignature_);
  1000. }
  1001. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  1002. size += com.google.protobuf.CodedOutputStream
  1003. .computeUInt64Size(3, refundTransactionUnlockTimeSecs_);
  1004. }
  1005. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  1006. size += com.google.protobuf.CodedOutputStream
  1007. .computeBytesSize(4, contractTransaction_);
  1008. }
  1009. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  1010. size += com.google.protobuf.CodedOutputStream
  1011. .computeBytesSize(5, clientOutput_);
  1012. }
  1013. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  1014. size += com.google.protobuf.CodedOutputStream
  1015. .computeBytesSize(6, myKey_);
  1016. }
  1017. size += getUnknownFields().getSerializedSize();
  1018. memoizedSerializedSize = size;
  1019. return size;
  1020. }
  1021. private static final long serialVersionUID = 0L;
  1022. @java.lang.Override
  1023. protected java.lang.Object writeReplace()
  1024. throws java.io.ObjectStreamException {
  1025. return super.writeReplace();
  1026. }
  1027. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(
  1028. com.google.protobuf.ByteString data)
  1029. throws com.google.protobuf.InvalidProtocolBufferException {
  1030. return PARSER.parseFrom(data);
  1031. }
  1032. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(
  1033. com.google.protobuf.ByteString data,
  1034. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1035. throws com.google.protobuf.InvalidProtocolBufferException {
  1036. return PARSER.parseFrom(data, extensionRegistry);
  1037. }
  1038. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(byte[] data)
  1039. throws com.google.protobuf.InvalidProtocolBufferException {
  1040. return PARSER.parseFrom(data);
  1041. }
  1042. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(
  1043. byte[] data,
  1044. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1045. throws com.google.protobuf.InvalidProtocolBufferException {
  1046. return PARSER.parseFrom(data, extensionRegistry);
  1047. }
  1048. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(java.io.InputStream input)
  1049. throws java.io.IOException {
  1050. return PARSER.parseFrom(input);
  1051. }
  1052. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(
  1053. java.io.InputStream input,
  1054. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1055. throws java.io.IOException {
  1056. return PARSER.parseFrom(input, extensionRegistry);
  1057. }
  1058. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom(java.io.InputStream input)
  1059. throws java.io.IOException {
  1060. return PARSER.parseDelimitedFrom(input);
  1061. }
  1062. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom(
  1063. java.io.InputStream input,
  1064. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1065. throws java.io.IOException {
  1066. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  1067. }
  1068. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(
  1069. com.google.protobuf.CodedInputStream input)
  1070. throws java.io.IOException {
  1071. return PARSER.parseFrom(input);
  1072. }
  1073. public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(
  1074. com.google.protobuf.CodedInputStream input,
  1075. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1076. throws java.io.IOException {
  1077. return PARSER.parseFrom(input, extensionRegistry);
  1078. }
  1079. public static Builder newBuilder() { return Builder.create(); }
  1080. public Builder newBuilderForType() { return newBuilder(); }
  1081. public static Builder newBuilder(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel prototype) {
  1082. return newBuilder().mergeFrom(prototype);
  1083. }
  1084. public Builder toBuilder() { return newBuilder(this); }
  1085. @java.lang.Override
  1086. protected Builder newBuilderForType(
  1087. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1088. Builder builder = new Builder(parent);
  1089. return builder;
  1090. }
  1091. /**
  1092. * Protobuf type {@code paymentchannels.StoredServerPaymentChannel}
  1093. *
  1094. * <pre>
  1095. * A server-side payment channel in serialized form, which can be reloaded later if the server restarts
  1096. * </pre>
  1097. */
  1098. public static final class Builder extends
  1099. com.google.protobuf.GeneratedMessage.Builder<Builder>
  1100. implements com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder {
  1101. public static final com.google.protobuf.Descriptors.Descriptor
  1102. getDescriptor() {
  1103. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor;
  1104. }
  1105. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  1106. internalGetFieldAccessorTable() {
  1107. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable
  1108. .ensureFieldAccessorsInitialized(
  1109. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class);
  1110. }
  1111. // Construct using com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.newBuilder()
  1112. private Builder() {
  1113. maybeForceBuilderInitialization();
  1114. }
  1115. private Builder(
  1116. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1117. super(parent);
  1118. maybeForceBuilderInitialization();
  1119. }
  1120. private void maybeForceBuilderInitialization() {
  1121. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  1122. }
  1123. }
  1124. private static Builder create() {
  1125. return new Builder();
  1126. }
  1127. public Builder clear() {
  1128. super.clear();
  1129. bestValueToMe_ = 0L;
  1130. bitField0_ = (bitField0_ & ~0x00000001);
  1131. bestValueSignature_ = com.google.protobuf.ByteString.EMPTY;
  1132. bitField0_ = (bitField0_ & ~0x00000002);
  1133. refundTransactionUnlockTimeSecs_ = 0L;
  1134. bitField0_ = (bitField0_ & ~0x00000004);
  1135. contractTransaction_ = com.google.protobuf.ByteString.EMPTY;
  1136. bitField0_ = (bitField0_ & ~0x00000008);
  1137. clientOutput_ = com.google.protobuf.ByteString.EMPTY;
  1138. bitField0_ = (bitField0_ & ~0x00000010);
  1139. myKey_ = com.google.protobuf.ByteString.EMPTY;
  1140. bitField0_ = (bitField0_ & ~0x00000020);
  1141. return this;
  1142. }
  1143. public Builder clone() {
  1144. return create().mergeFrom(buildPartial());
  1145. }
  1146. public com.google.protobuf.Descriptors.Descriptor
  1147. getDescriptorForType() {
  1148. return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor;
  1149. }
  1150. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getDefaultInstanceForType() {
  1151. return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance();
  1152. }
  1153. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel build() {
  1154. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = buildPartial();
  1155. if (!result.isInitialized()) {
  1156. throw newUninitializedMessageException(result);
  1157. }
  1158. return result;
  1159. }
  1160. public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel buildPartial() {
  1161. com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = new com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel(this);
  1162. int from_bitField0_ = bitField0_;
  1163. int to_bitField0_ = 0;
  1164. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  1165. to_bitField0_ |= 0x00000001;
  1166. }
  1167. result.bestValueToMe_ = bestValueToMe_;
  1168. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  1169. to_bitField0_ |= 0x00000002;
  1170. }
  1171. result.bestValueSignature_ = bestValueSignature_;
  1172. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  1173. to_bitField0_ |= 0x0000000

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