diff --git a/core/build.gradle b/core/build.gradle index 26c51555..0aadf569 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -24,6 +24,10 @@ dependencies { sourceCompatibility = 1.7 +protobuf { + generatedFilesBaseDir = new File(projectDir, '/src') // workaround for '$projectDir/src' +} + test { exclude 'org/bitcoinj/net/NetworkAbstractionTests*' } diff --git a/core/src/main/java/org/bitcoin/crawler/PeerSeedProtos.java b/core/src/main/java/org/bitcoin/crawler/PeerSeedProtos.java new file mode 100644 index 00000000..4124add6 --- /dev/null +++ b/core/src/main/java/org/bitcoin/crawler/PeerSeedProtos.java @@ -0,0 +1,2548 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: peerseeds.proto + +package org.bitcoin.crawler; + +public final class PeerSeedProtos { + private PeerSeedProtos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PeerSeedDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.bitcoin.crawler.PeerSeedData) + com.google.protobuf.MessageOrBuilder { + + /** + * required string ip_address = 1; + */ + boolean hasIpAddress(); + /** + * required string ip_address = 1; + */ + java.lang.String getIpAddress(); + /** + * required string ip_address = 1; + */ + com.google.protobuf.ByteString + getIpAddressBytes(); + + /** + * required uint32 port = 2; + */ + boolean hasPort(); + /** + * required uint32 port = 2; + */ + int getPort(); + + /** + * required uint32 services = 3; + */ + boolean hasServices(); + /** + * required uint32 services = 3; + */ + int getServices(); + } + /** + * Protobuf type {@code org.bitcoin.crawler.PeerSeedData} + */ + public static final class PeerSeedData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.bitcoin.crawler.PeerSeedData) + PeerSeedDataOrBuilder { + // Use PeerSeedData.newBuilder() to construct. + private PeerSeedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PeerSeedData() { + ipAddress_ = ""; + port_ = 0; + services_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PeerSeedData( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + ipAddress_ = bs; + break; + } + case 16: { + bitField0_ |= 0x00000002; + port_ = input.readUInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + services_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeedData_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.class, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder.class); + } + + private int bitField0_; + public static final int IP_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object ipAddress_; + /** + * required string ip_address = 1; + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string ip_address = 1; + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + ipAddress_ = s; + } + return s; + } + } + /** + * required string ip_address = 1; + */ + public com.google.protobuf.ByteString + getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + /** + * required uint32 port = 2; + */ + public boolean hasPort() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint32 port = 2; + */ + public int getPort() { + return port_; + } + + public static final int SERVICES_FIELD_NUMBER = 3; + private int services_; + /** + * required uint32 services = 3; + */ + public boolean hasServices() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint32 services = 3; + */ + public int getServices() { + return services_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasIpAddress()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPort()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasServices()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipAddress_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt32(2, port_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt32(3, services_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ipAddress_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, port_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, services_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.crawler.PeerSeedProtos.PeerSeedData)) { + return super.equals(obj); + } + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData other = (org.bitcoin.crawler.PeerSeedProtos.PeerSeedData) obj; + + boolean result = true; + result = result && (hasIpAddress() == other.hasIpAddress()); + if (hasIpAddress()) { + result = result && getIpAddress() + .equals(other.getIpAddress()); + } + result = result && (hasPort() == other.hasPort()); + if (hasPort()) { + result = result && (getPort() + == other.getPort()); + } + result = result && (hasServices() == other.hasServices()); + if (hasServices()) { + result = result && (getServices() + == other.getServices()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasIpAddress()) { + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + } + if (hasPort()) { + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + } + if (hasServices()) { + hash = (37 * hash) + SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getServices(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.crawler.PeerSeedProtos.PeerSeedData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.bitcoin.crawler.PeerSeedData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.bitcoin.crawler.PeerSeedData) + org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeedData_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.class, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder.class); + } + + // Construct using org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + ipAddress_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + port_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + services_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeedData_descriptor; + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData getDefaultInstanceForType() { + return org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.getDefaultInstance(); + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData build() { + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData buildPartial() { + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData result = new org.bitcoin.crawler.PeerSeedProtos.PeerSeedData(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.ipAddress_ = ipAddress_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.port_ = port_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.services_ = services_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.crawler.PeerSeedProtos.PeerSeedData) { + return mergeFrom((org.bitcoin.crawler.PeerSeedProtos.PeerSeedData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.crawler.PeerSeedProtos.PeerSeedData other) { + if (other == org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.getDefaultInstance()) return this; + if (other.hasIpAddress()) { + bitField0_ |= 0x00000001; + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (other.hasPort()) { + setPort(other.getPort()); + } + if (other.hasServices()) { + setServices(other.getServices()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasIpAddress()) { + return false; + } + if (!hasPort()) { + return false; + } + if (!hasServices()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.crawler.PeerSeedProtos.PeerSeedData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object ipAddress_ = ""; + /** + * required string ip_address = 1; + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string ip_address = 1; + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + ipAddress_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string ip_address = 1; + */ + public com.google.protobuf.ByteString + getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string ip_address = 1; + */ + public Builder setIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + ipAddress_ = value; + onChanged(); + return this; + } + /** + * required string ip_address = 1; + */ + public Builder clearIpAddress() { + bitField0_ = (bitField0_ & ~0x00000001); + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * required string ip_address = 1; + */ + public Builder setIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + ipAddress_ = value; + onChanged(); + return this; + } + + private int port_ ; + /** + * required uint32 port = 2; + */ + public boolean hasPort() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint32 port = 2; + */ + public int getPort() { + return port_; + } + /** + * required uint32 port = 2; + */ + public Builder setPort(int value) { + bitField0_ |= 0x00000002; + port_ = value; + onChanged(); + return this; + } + /** + * required uint32 port = 2; + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + + private int services_ ; + /** + * required uint32 services = 3; + */ + public boolean hasServices() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint32 services = 3; + */ + public int getServices() { + return services_; + } + /** + * required uint32 services = 3; + */ + public Builder setServices(int value) { + bitField0_ |= 0x00000004; + services_ = value; + onChanged(); + return this; + } + /** + * required uint32 services = 3; + */ + public Builder clearServices() { + bitField0_ = (bitField0_ & ~0x00000004); + services_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.bitcoin.crawler.PeerSeedData) + } + + // @@protoc_insertion_point(class_scope:org.bitcoin.crawler.PeerSeedData) + private static final org.bitcoin.crawler.PeerSeedProtos.PeerSeedData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.crawler.PeerSeedProtos.PeerSeedData(); + } + + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeedData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PeerSeedData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PeerSeedData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PeerSeedsOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.bitcoin.crawler.PeerSeeds) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + java.util.List + getSeedList(); + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData getSeed(int index); + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + int getSeedCount(); + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + java.util.List + getSeedOrBuilderList(); + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder getSeedOrBuilder( + int index); + + /** + *
+     * seconds since UNIX epoch
+     * 
+ * + * required uint64 timestamp = 2; + */ + boolean hasTimestamp(); + /** + *
+     * seconds since UNIX epoch
+     * 
+ * + * required uint64 timestamp = 2; + */ + long getTimestamp(); + + /** + * required string net = 3; + */ + boolean hasNet(); + /** + * required string net = 3; + */ + java.lang.String getNet(); + /** + * required string net = 3; + */ + com.google.protobuf.ByteString + getNetBytes(); + } + /** + * Protobuf type {@code org.bitcoin.crawler.PeerSeeds} + */ + public static final class PeerSeeds extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.bitcoin.crawler.PeerSeeds) + PeerSeedsOrBuilder { + // Use PeerSeeds.newBuilder() to construct. + private PeerSeeds(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PeerSeeds() { + seed_ = java.util.Collections.emptyList(); + timestamp_ = 0L; + net_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PeerSeeds( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + seed_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + seed_.add( + input.readMessage(org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.PARSER, extensionRegistry)); + break; + } + case 16: { + bitField0_ |= 0x00000001; + timestamp_ = input.readUInt64(); + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + net_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + seed_ = java.util.Collections.unmodifiableList(seed_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeeds_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeeds_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.class, org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.Builder.class); + } + + private int bitField0_; + public static final int SEED_FIELD_NUMBER = 1; + private java.util.List seed_; + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public java.util.List getSeedList() { + return seed_; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public java.util.List + getSeedOrBuilderList() { + return seed_; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public int getSeedCount() { + return seed_.size(); + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData getSeed(int index) { + return seed_.get(index); + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder getSeedOrBuilder( + int index) { + return seed_.get(index); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + *
+     * seconds since UNIX epoch
+     * 
+ * + * required uint64 timestamp = 2; + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * seconds since UNIX epoch
+     * 
+ * + * required uint64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int NET_FIELD_NUMBER = 3; + private volatile java.lang.Object net_; + /** + * required string net = 3; + */ + public boolean hasNet() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string net = 3; + */ + public java.lang.String getNet() { + java.lang.Object ref = net_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + net_ = s; + } + return s; + } + } + /** + * required string net = 3; + */ + public com.google.protobuf.ByteString + getNetBytes() { + java.lang.Object ref = net_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + net_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasTimestamp()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasNet()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getSeedCount(); i++) { + if (!getSeed(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < seed_.size(); i++) { + output.writeMessage(1, seed_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt64(2, timestamp_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, net_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < seed_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, seed_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, timestamp_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, net_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.crawler.PeerSeedProtos.PeerSeeds)) { + return super.equals(obj); + } + org.bitcoin.crawler.PeerSeedProtos.PeerSeeds other = (org.bitcoin.crawler.PeerSeedProtos.PeerSeeds) obj; + + boolean result = true; + result = result && getSeedList() + .equals(other.getSeedList()); + result = result && (hasTimestamp() == other.hasTimestamp()); + if (hasTimestamp()) { + result = result && (getTimestamp() + == other.getTimestamp()); + } + result = result && (hasNet() == other.hasNet()); + if (hasNet()) { + result = result && getNet() + .equals(other.getNet()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getSeedCount() > 0) { + hash = (37 * hash) + SEED_FIELD_NUMBER; + hash = (53 * hash) + getSeedList().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + } + if (hasNet()) { + hash = (37 * hash) + NET_FIELD_NUMBER; + hash = (53 * hash) + getNet().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.crawler.PeerSeedProtos.PeerSeeds prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.bitcoin.crawler.PeerSeeds} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.bitcoin.crawler.PeerSeeds) + org.bitcoin.crawler.PeerSeedProtos.PeerSeedsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeeds_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeeds_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.class, org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.Builder.class); + } + + // Construct using org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSeedFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (seedBuilder_ == null) { + seed_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + seedBuilder_.clear(); + } + timestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + net_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_PeerSeeds_descriptor; + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeeds getDefaultInstanceForType() { + return org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.getDefaultInstance(); + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeeds build() { + org.bitcoin.crawler.PeerSeedProtos.PeerSeeds result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeeds buildPartial() { + org.bitcoin.crawler.PeerSeedProtos.PeerSeeds result = new org.bitcoin.crawler.PeerSeedProtos.PeerSeeds(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (seedBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + seed_ = java.util.Collections.unmodifiableList(seed_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.seed_ = seed_; + } else { + result.seed_ = seedBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000001; + } + result.timestamp_ = timestamp_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.net_ = net_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.crawler.PeerSeedProtos.PeerSeeds) { + return mergeFrom((org.bitcoin.crawler.PeerSeedProtos.PeerSeeds)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.crawler.PeerSeedProtos.PeerSeeds other) { + if (other == org.bitcoin.crawler.PeerSeedProtos.PeerSeeds.getDefaultInstance()) return this; + if (seedBuilder_ == null) { + if (!other.seed_.isEmpty()) { + if (seed_.isEmpty()) { + seed_ = other.seed_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSeedIsMutable(); + seed_.addAll(other.seed_); + } + onChanged(); + } + } else { + if (!other.seed_.isEmpty()) { + if (seedBuilder_.isEmpty()) { + seedBuilder_.dispose(); + seedBuilder_ = null; + seed_ = other.seed_; + bitField0_ = (bitField0_ & ~0x00000001); + seedBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSeedFieldBuilder() : null; + } else { + seedBuilder_.addAllMessages(other.seed_); + } + } + } + if (other.hasTimestamp()) { + setTimestamp(other.getTimestamp()); + } + if (other.hasNet()) { + bitField0_ |= 0x00000004; + net_ = other.net_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasTimestamp()) { + return false; + } + if (!hasNet()) { + return false; + } + for (int i = 0; i < getSeedCount(); i++) { + if (!getSeed(i).isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.crawler.PeerSeedProtos.PeerSeeds parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.crawler.PeerSeedProtos.PeerSeeds) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List seed_ = + java.util.Collections.emptyList(); + private void ensureSeedIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + seed_ = new java.util.ArrayList(seed_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder, org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder> seedBuilder_; + + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public java.util.List getSeedList() { + if (seedBuilder_ == null) { + return java.util.Collections.unmodifiableList(seed_); + } else { + return seedBuilder_.getMessageList(); + } + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public int getSeedCount() { + if (seedBuilder_ == null) { + return seed_.size(); + } else { + return seedBuilder_.getCount(); + } + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData getSeed(int index) { + if (seedBuilder_ == null) { + return seed_.get(index); + } else { + return seedBuilder_.getMessage(index); + } + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder setSeed( + int index, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData value) { + if (seedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSeedIsMutable(); + seed_.set(index, value); + onChanged(); + } else { + seedBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder setSeed( + int index, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder builderForValue) { + if (seedBuilder_ == null) { + ensureSeedIsMutable(); + seed_.set(index, builderForValue.build()); + onChanged(); + } else { + seedBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder addSeed(org.bitcoin.crawler.PeerSeedProtos.PeerSeedData value) { + if (seedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSeedIsMutable(); + seed_.add(value); + onChanged(); + } else { + seedBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder addSeed( + int index, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData value) { + if (seedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSeedIsMutable(); + seed_.add(index, value); + onChanged(); + } else { + seedBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder addSeed( + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder builderForValue) { + if (seedBuilder_ == null) { + ensureSeedIsMutable(); + seed_.add(builderForValue.build()); + onChanged(); + } else { + seedBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder addSeed( + int index, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder builderForValue) { + if (seedBuilder_ == null) { + ensureSeedIsMutable(); + seed_.add(index, builderForValue.build()); + onChanged(); + } else { + seedBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder addAllSeed( + java.lang.Iterable values) { + if (seedBuilder_ == null) { + ensureSeedIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, seed_); + onChanged(); + } else { + seedBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder clearSeed() { + if (seedBuilder_ == null) { + seed_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + seedBuilder_.clear(); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public Builder removeSeed(int index) { + if (seedBuilder_ == null) { + ensureSeedIsMutable(); + seed_.remove(index); + onChanged(); + } else { + seedBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder getSeedBuilder( + int index) { + return getSeedFieldBuilder().getBuilder(index); + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder getSeedOrBuilder( + int index) { + if (seedBuilder_ == null) { + return seed_.get(index); } else { + return seedBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public java.util.List + getSeedOrBuilderList() { + if (seedBuilder_ != null) { + return seedBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(seed_); + } + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder addSeedBuilder() { + return getSeedFieldBuilder().addBuilder( + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.getDefaultInstance()); + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder addSeedBuilder( + int index) { + return getSeedFieldBuilder().addBuilder( + index, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.getDefaultInstance()); + } + /** + * repeated .org.bitcoin.crawler.PeerSeedData seed = 1; + */ + public java.util.List + getSeedBuilderList() { + return getSeedFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder, org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder> + getSeedFieldBuilder() { + if (seedBuilder_ == null) { + seedBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.crawler.PeerSeedProtos.PeerSeedData, org.bitcoin.crawler.PeerSeedProtos.PeerSeedData.Builder, org.bitcoin.crawler.PeerSeedProtos.PeerSeedDataOrBuilder>( + seed_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + seed_ = null; + } + return seedBuilder_; + } + + private long timestamp_ ; + /** + *
+       * seconds since UNIX epoch
+       * 
+ * + * required uint64 timestamp = 2; + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * seconds since UNIX epoch
+       * 
+ * + * required uint64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + *
+       * seconds since UNIX epoch
+       * 
+ * + * required uint64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + bitField0_ |= 0x00000002; + timestamp_ = value; + onChanged(); + return this; + } + /** + *
+       * seconds since UNIX epoch
+       * 
+ * + * required uint64 timestamp = 2; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + timestamp_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object net_ = ""; + /** + * required string net = 3; + */ + public boolean hasNet() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required string net = 3; + */ + public java.lang.String getNet() { + java.lang.Object ref = net_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + net_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string net = 3; + */ + public com.google.protobuf.ByteString + getNetBytes() { + java.lang.Object ref = net_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + net_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string net = 3; + */ + public Builder setNet( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + net_ = value; + onChanged(); + return this; + } + /** + * required string net = 3; + */ + public Builder clearNet() { + bitField0_ = (bitField0_ & ~0x00000004); + net_ = getDefaultInstance().getNet(); + onChanged(); + return this; + } + /** + * required string net = 3; + */ + public Builder setNetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + net_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.bitcoin.crawler.PeerSeeds) + } + + // @@protoc_insertion_point(class_scope:org.bitcoin.crawler.PeerSeeds) + private static final org.bitcoin.crawler.PeerSeedProtos.PeerSeeds DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.crawler.PeerSeedProtos.PeerSeeds(); + } + + public static org.bitcoin.crawler.PeerSeedProtos.PeerSeeds getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PeerSeeds parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PeerSeeds(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.crawler.PeerSeedProtos.PeerSeeds getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SignedPeerSeedsOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.bitcoin.crawler.SignedPeerSeeds) + com.google.protobuf.MessageOrBuilder { + + /** + * required bytes peer_seeds = 1; + */ + boolean hasPeerSeeds(); + /** + * required bytes peer_seeds = 1; + */ + com.google.protobuf.ByteString getPeerSeeds(); + + /** + * required bytes signature = 2; + */ + boolean hasSignature(); + /** + * required bytes signature = 2; + */ + com.google.protobuf.ByteString getSignature(); + + /** + * required bytes pubkey = 3; + */ + boolean hasPubkey(); + /** + * required bytes pubkey = 3; + */ + com.google.protobuf.ByteString getPubkey(); + } + /** + * Protobuf type {@code org.bitcoin.crawler.SignedPeerSeeds} + */ + public static final class SignedPeerSeeds extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.bitcoin.crawler.SignedPeerSeeds) + SignedPeerSeedsOrBuilder { + // Use SignedPeerSeeds.newBuilder() to construct. + private SignedPeerSeeds(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SignedPeerSeeds() { + peerSeeds_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + pubkey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SignedPeerSeeds( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + peerSeeds_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + signature_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + pubkey_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_SignedPeerSeeds_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_SignedPeerSeeds_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.class, org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.Builder.class); + } + + private int bitField0_; + public static final int PEER_SEEDS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString peerSeeds_; + /** + * required bytes peer_seeds = 1; + */ + public boolean hasPeerSeeds() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes peer_seeds = 1; + */ + public com.google.protobuf.ByteString getPeerSeeds() { + return peerSeeds_; + } + + public static final int SIGNATURE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString signature_; + /** + * required bytes signature = 2; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes signature = 2; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + public static final int PUBKEY_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString pubkey_; + /** + * required bytes pubkey = 3; + */ + public boolean hasPubkey() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes pubkey = 3; + */ + public com.google.protobuf.ByteString getPubkey() { + return pubkey_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasPeerSeeds()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasSignature()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPubkey()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, peerSeeds_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, signature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, pubkey_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, peerSeeds_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, signature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, pubkey_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds)) { + return super.equals(obj); + } + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds other = (org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds) obj; + + boolean result = true; + result = result && (hasPeerSeeds() == other.hasPeerSeeds()); + if (hasPeerSeeds()) { + result = result && getPeerSeeds() + .equals(other.getPeerSeeds()); + } + result = result && (hasSignature() == other.hasSignature()); + if (hasSignature()) { + result = result && getSignature() + .equals(other.getSignature()); + } + result = result && (hasPubkey() == other.hasPubkey()); + if (hasPubkey()) { + result = result && getPubkey() + .equals(other.getPubkey()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasPeerSeeds()) { + hash = (37 * hash) + PEER_SEEDS_FIELD_NUMBER; + hash = (53 * hash) + getPeerSeeds().hashCode(); + } + if (hasSignature()) { + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + } + if (hasPubkey()) { + hash = (37 * hash) + PUBKEY_FIELD_NUMBER; + hash = (53 * hash) + getPubkey().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.bitcoin.crawler.SignedPeerSeeds} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.bitcoin.crawler.SignedPeerSeeds) + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeedsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_SignedPeerSeeds_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_SignedPeerSeeds_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.class, org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.Builder.class); + } + + // Construct using org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + peerSeeds_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + signature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + pubkey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.crawler.PeerSeedProtos.internal_static_org_bitcoin_crawler_SignedPeerSeeds_descriptor; + } + + public org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds getDefaultInstanceForType() { + return org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.getDefaultInstance(); + } + + public org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds build() { + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds buildPartial() { + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds result = new org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.peerSeeds_ = peerSeeds_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.signature_ = signature_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.pubkey_ = pubkey_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds) { + return mergeFrom((org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds other) { + if (other == org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds.getDefaultInstance()) return this; + if (other.hasPeerSeeds()) { + setPeerSeeds(other.getPeerSeeds()); + } + if (other.hasSignature()) { + setSignature(other.getSignature()); + } + if (other.hasPubkey()) { + setPubkey(other.getPubkey()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasPeerSeeds()) { + return false; + } + if (!hasSignature()) { + return false; + } + if (!hasPubkey()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString peerSeeds_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes peer_seeds = 1; + */ + public boolean hasPeerSeeds() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes peer_seeds = 1; + */ + public com.google.protobuf.ByteString getPeerSeeds() { + return peerSeeds_; + } + /** + * required bytes peer_seeds = 1; + */ + public Builder setPeerSeeds(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + peerSeeds_ = value; + onChanged(); + return this; + } + /** + * required bytes peer_seeds = 1; + */ + public Builder clearPeerSeeds() { + bitField0_ = (bitField0_ & ~0x00000001); + peerSeeds_ = getDefaultInstance().getPeerSeeds(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes signature = 2; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes signature = 2; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * required bytes signature = 2; + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + signature_ = value; + onChanged(); + return this; + } + /** + * required bytes signature = 2; + */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000002); + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString pubkey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes pubkey = 3; + */ + public boolean hasPubkey() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes pubkey = 3; + */ + public com.google.protobuf.ByteString getPubkey() { + return pubkey_; + } + /** + * required bytes pubkey = 3; + */ + public Builder setPubkey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + pubkey_ = value; + onChanged(); + return this; + } + /** + * required bytes pubkey = 3; + */ + public Builder clearPubkey() { + bitField0_ = (bitField0_ & ~0x00000004); + pubkey_ = getDefaultInstance().getPubkey(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.bitcoin.crawler.SignedPeerSeeds) + } + + // @@protoc_insertion_point(class_scope:org.bitcoin.crawler.SignedPeerSeeds) + private static final org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds(); + } + + public static org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SignedPeerSeeds parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SignedPeerSeeds(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.crawler.PeerSeedProtos.SignedPeerSeeds getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_bitcoin_crawler_PeerSeedData_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_bitcoin_crawler_PeerSeedData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_bitcoin_crawler_PeerSeeds_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_bitcoin_crawler_PeerSeeds_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_bitcoin_crawler_SignedPeerSeeds_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_bitcoin_crawler_SignedPeerSeeds_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017peerseeds.proto\022\023org.bitcoin.crawler\"B" + + "\n\014PeerSeedData\022\022\n\nip_address\030\001 \002(\t\022\014\n\004po" + + "rt\030\002 \002(\r\022\020\n\010services\030\003 \002(\r\"\\\n\tPeerSeeds\022" + + "/\n\004seed\030\001 \003(\0132!.org.bitcoin.crawler.Peer" + + "SeedData\022\021\n\ttimestamp\030\002 \002(\004\022\013\n\003net\030\003 \002(\t" + + "\"H\n\017SignedPeerSeeds\022\022\n\npeer_seeds\030\001 \002(\014\022" + + "\021\n\tsignature\030\002 \002(\014\022\016\n\006pubkey\030\003 \002(\014B%\n\023or" + + "g.bitcoin.crawlerB\016PeerSeedProtos" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_org_bitcoin_crawler_PeerSeedData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_bitcoin_crawler_PeerSeedData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_bitcoin_crawler_PeerSeedData_descriptor, + new java.lang.String[] { "IpAddress", "Port", "Services", }); + internal_static_org_bitcoin_crawler_PeerSeeds_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_bitcoin_crawler_PeerSeeds_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_bitcoin_crawler_PeerSeeds_descriptor, + new java.lang.String[] { "Seed", "Timestamp", "Net", }); + internal_static_org_bitcoin_crawler_SignedPeerSeeds_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_bitcoin_crawler_SignedPeerSeeds_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_bitcoin_crawler_SignedPeerSeeds_descriptor, + new java.lang.String[] { "PeerSeeds", "Signature", "Pubkey", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/core/src/main/java/org/bitcoin/paymentchannel/Protos.java b/core/src/main/java/org/bitcoin/paymentchannel/Protos.java new file mode 100644 index 00000000..c2b5afcc --- /dev/null +++ b/core/src/main/java/org/bitcoin/paymentchannel/Protos.java @@ -0,0 +1,10716 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: paymentchannel.proto + +package org.bitcoin.paymentchannel; + +public final class Protos { + private Protos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TwoWayChannelMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.TwoWayChannelMessage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + boolean hasType(); + /** + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType(); + + /** + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + boolean hasClientVersion(); + /** + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion(); + /** + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder(); + + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + boolean hasServerVersion(); + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion(); + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder(); + + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + boolean hasInitiate(); + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + org.bitcoin.paymentchannel.Protos.Initiate getInitiate(); + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder(); + + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + boolean hasProvideRefund(); + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund(); + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder(); + + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + boolean hasReturnRefund(); + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund(); + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder(); + + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + boolean hasProvideContract(); + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract(); + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder(); + + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + boolean hasUpdatePayment(); + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment(); + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder(); + + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + boolean hasPaymentAck(); + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + org.bitcoin.paymentchannel.Protos.PaymentAck getPaymentAck(); + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder getPaymentAckOrBuilder(); + + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + boolean hasSettlement(); + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + org.bitcoin.paymentchannel.Protos.Settlement getSettlement(); + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + org.bitcoin.paymentchannel.Protos.SettlementOrBuilder getSettlementOrBuilder(); + + /** + * optional .paymentchannels.Error error = 10; + */ + boolean hasError(); + /** + * optional .paymentchannels.Error error = 10; + */ + org.bitcoin.paymentchannel.Protos.Error getError(); + /** + * optional .paymentchannels.Error error = 10; + */ + org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder(); + } + /** + *
+   * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
+   * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
+   * and "secondary" as "server".
+   * 
+ * + * Protobuf type {@code paymentchannels.TwoWayChannelMessage} + */ + public static final class TwoWayChannelMessage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.TwoWayChannelMessage) + TwoWayChannelMessageOrBuilder { + // Use TwoWayChannelMessage.newBuilder() to construct. + private TwoWayChannelMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TwoWayChannelMessage() { + type_ = 1; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TwoWayChannelMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = rawValue; + } + break; + } + case 18: { + org.bitcoin.paymentchannel.Protos.ClientVersion.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = clientVersion_.toBuilder(); + } + clientVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ClientVersion.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientVersion_); + clientVersion_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + org.bitcoin.paymentchannel.Protos.ServerVersion.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = serverVersion_.toBuilder(); + } + serverVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ServerVersion.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serverVersion_); + serverVersion_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 34: { + org.bitcoin.paymentchannel.Protos.Initiate.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = initiate_.toBuilder(); + } + initiate_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Initiate.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(initiate_); + initiate_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 42: { + org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = provideRefund_.toBuilder(); + } + provideRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideRefund.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provideRefund_); + provideRefund_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 50: { + org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = returnRefund_.toBuilder(); + } + returnRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ReturnRefund.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(returnRefund_); + returnRefund_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 58: { + org.bitcoin.paymentchannel.Protos.ProvideContract.Builder subBuilder = null; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + subBuilder = provideContract_.toBuilder(); + } + provideContract_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideContract.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provideContract_); + provideContract_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000040; + break; + } + case 66: { + org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = updatePayment_.toBuilder(); + } + updatePayment_ = input.readMessage(org.bitcoin.paymentchannel.Protos.UpdatePayment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updatePayment_); + updatePayment_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 74: { + org.bitcoin.paymentchannel.Protos.Settlement.Builder subBuilder = null; + if (((bitField0_ & 0x00000200) == 0x00000200)) { + subBuilder = settlement_.toBuilder(); + } + settlement_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Settlement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(settlement_); + settlement_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000200; + break; + } + case 82: { + org.bitcoin.paymentchannel.Protos.Error.Builder subBuilder = null; + if (((bitField0_ & 0x00000400) == 0x00000400)) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Error.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000400; + break; + } + case 90: { + org.bitcoin.paymentchannel.Protos.PaymentAck.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = paymentAck_.toBuilder(); + } + paymentAck_ = input.readMessage(org.bitcoin.paymentchannel.Protos.PaymentAck.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(paymentAck_); + paymentAck_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class); + } + + /** + * Protobuf enum {@code paymentchannels.TwoWayChannelMessage.MessageType} + */ + public enum MessageType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CLIENT_VERSION = 1; + */ + CLIENT_VERSION(1), + /** + * SERVER_VERSION = 2; + */ + SERVER_VERSION(2), + /** + * INITIATE = 3; + */ + INITIATE(3), + /** + * PROVIDE_REFUND = 4; + */ + PROVIDE_REFUND(4), + /** + * RETURN_REFUND = 5; + */ + RETURN_REFUND(5), + /** + * PROVIDE_CONTRACT = 6; + */ + PROVIDE_CONTRACT(6), + /** + *
+       * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
+       * secondary to the primary to indicate that the provided contract was received,
+       * verified, and broadcast successfully and the primary can now provide UPDATE messages
+       * at will to begin paying secondary. If the channel is interrupted after the
+       * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
+       * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
+       * message.
+       * 
+ * + * CHANNEL_OPEN = 7; + */ + CHANNEL_OPEN(7), + /** + * UPDATE_PAYMENT = 8; + */ + UPDATE_PAYMENT(8), + /** + *
+       * Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
+       * 
+ * + * PAYMENT_ACK = 11; + */ + PAYMENT_ACK(11), + /** + *
+       * Either side can send this message. If the client sends it to the server, then the server
+       * takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a
+       * valid transaction, which it then broadcasts on the network.
+       * Once broadcast is complete, it sends back another CLOSE message with the settlement field set, containing
+       * the final state of the contract.
+       * The server is allowed to initiate settlement whenever it wants, in which case the client will
+       * asynchronously receive a CLOSE message with the settlement field set. The server is also allowed
+       * to send a CLOSE to mark the end of a connection without any settlement taking place, in which
+       * case this is just an equivalent to a TCP FIN packet. An explicit end-of-protocol markers can be
+       * useful when this protocol is embedded inside another.
+       * 
+ * + * CLOSE = 9; + */ + CLOSE(9), + /** + *
+       * Used to indicate an error condition.
+       * Both parties should make an effort to send either an ERROR or a CLOSE immediately
+       * before closing the socket (unless they just received an ERROR or a CLOSE). This is important
+       * because the protocol may not run over TCP.
+       * 
+ * + * ERROR = 10; + */ + ERROR(10), + ; + + /** + * CLIENT_VERSION = 1; + */ + public static final int CLIENT_VERSION_VALUE = 1; + /** + * SERVER_VERSION = 2; + */ + public static final int SERVER_VERSION_VALUE = 2; + /** + * INITIATE = 3; + */ + public static final int INITIATE_VALUE = 3; + /** + * PROVIDE_REFUND = 4; + */ + public static final int PROVIDE_REFUND_VALUE = 4; + /** + * RETURN_REFUND = 5; + */ + public static final int RETURN_REFUND_VALUE = 5; + /** + * PROVIDE_CONTRACT = 6; + */ + public static final int PROVIDE_CONTRACT_VALUE = 6; + /** + *
+       * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
+       * secondary to the primary to indicate that the provided contract was received,
+       * verified, and broadcast successfully and the primary can now provide UPDATE messages
+       * at will to begin paying secondary. If the channel is interrupted after the
+       * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
+       * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
+       * message.
+       * 
+ * + * CHANNEL_OPEN = 7; + */ + public static final int CHANNEL_OPEN_VALUE = 7; + /** + * UPDATE_PAYMENT = 8; + */ + public static final int UPDATE_PAYMENT_VALUE = 8; + /** + *
+       * Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
+       * 
+ * + * PAYMENT_ACK = 11; + */ + public static final int PAYMENT_ACK_VALUE = 11; + /** + *
+       * Either side can send this message. If the client sends it to the server, then the server
+       * takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a
+       * valid transaction, which it then broadcasts on the network.
+       * Once broadcast is complete, it sends back another CLOSE message with the settlement field set, containing
+       * the final state of the contract.
+       * The server is allowed to initiate settlement whenever it wants, in which case the client will
+       * asynchronously receive a CLOSE message with the settlement field set. The server is also allowed
+       * to send a CLOSE to mark the end of a connection without any settlement taking place, in which
+       * case this is just an equivalent to a TCP FIN packet. An explicit end-of-protocol markers can be
+       * useful when this protocol is embedded inside another.
+       * 
+ * + * CLOSE = 9; + */ + public static final int CLOSE_VALUE = 9; + /** + *
+       * Used to indicate an error condition.
+       * Both parties should make an effort to send either an ERROR or a CLOSE immediately
+       * before closing the socket (unless they just received an ERROR or a CLOSE). This is important
+       * because the protocol may not run over TCP.
+       * 
+ * + * ERROR = 10; + */ + public static final int ERROR_VALUE = 10; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MessageType valueOf(int value) { + return forNumber(value); + } + + public static MessageType forNumber(int value) { + switch (value) { + case 1: return CLIENT_VERSION; + case 2: return SERVER_VERSION; + case 3: return INITIATE; + case 4: return PROVIDE_REFUND; + case 5: return RETURN_REFUND; + case 6: return PROVIDE_CONTRACT; + case 7: return CHANNEL_OPEN; + case 8: return UPDATE_PAYMENT; + case 11: return PAYMENT_ACK; + case 9: return CLOSE; + case 10: return ERROR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MessageType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MessageType findValueByNumber(int number) { + return MessageType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final MessageType[] VALUES = values(); + + public static MessageType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MessageType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:paymentchannels.TwoWayChannelMessage.MessageType) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() { + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType result = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(type_); + return result == null ? org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION : result; + } + + public static final int CLIENT_VERSION_FIELD_NUMBER = 2; + private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_; + /** + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public boolean hasClientVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() { + return clientVersion_ == null ? org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance() : clientVersion_; + } + /** + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() { + return clientVersion_ == null ? org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance() : clientVersion_; + } + + public static final int SERVER_VERSION_FIELD_NUMBER = 3; + private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_; + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public boolean hasServerVersion() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() { + return serverVersion_ == null ? org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance() : serverVersion_; + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() { + return serverVersion_ == null ? org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance() : serverVersion_; + } + + public static final int INITIATE_FIELD_NUMBER = 4; + private org.bitcoin.paymentchannel.Protos.Initiate initiate_; + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public boolean hasInitiate() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() { + return initiate_ == null ? org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance() : initiate_; + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() { + return initiate_ == null ? org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance() : initiate_; + } + + public static final int PROVIDE_REFUND_FIELD_NUMBER = 5; + private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_; + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public boolean hasProvideRefund() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() { + return provideRefund_ == null ? org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance() : provideRefund_; + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() { + return provideRefund_ == null ? org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance() : provideRefund_; + } + + public static final int RETURN_REFUND_FIELD_NUMBER = 6; + private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_; + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public boolean hasReturnRefund() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() { + return returnRefund_ == null ? org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance() : returnRefund_; + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() { + return returnRefund_ == null ? org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance() : returnRefund_; + } + + public static final int PROVIDE_CONTRACT_FIELD_NUMBER = 7; + private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_; + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public boolean hasProvideContract() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() { + return provideContract_ == null ? org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance() : provideContract_; + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() { + return provideContract_ == null ? org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance() : provideContract_; + } + + public static final int UPDATE_PAYMENT_FIELD_NUMBER = 8; + private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_; + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public boolean hasUpdatePayment() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() { + return updatePayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : updatePayment_; + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() { + return updatePayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : updatePayment_; + } + + public static final int PAYMENT_ACK_FIELD_NUMBER = 11; + private org.bitcoin.paymentchannel.Protos.PaymentAck paymentAck_; + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public boolean hasPaymentAck() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public org.bitcoin.paymentchannel.Protos.PaymentAck getPaymentAck() { + return paymentAck_ == null ? org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance() : paymentAck_; + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder getPaymentAckOrBuilder() { + return paymentAck_ == null ? org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance() : paymentAck_; + } + + public static final int SETTLEMENT_FIELD_NUMBER = 9; + private org.bitcoin.paymentchannel.Protos.Settlement settlement_; + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public boolean hasSettlement() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public org.bitcoin.paymentchannel.Protos.Settlement getSettlement() { + return settlement_ == null ? org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance() : settlement_; + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public org.bitcoin.paymentchannel.Protos.SettlementOrBuilder getSettlementOrBuilder() { + return settlement_ == null ? org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance() : settlement_; + } + + public static final int ERROR_FIELD_NUMBER = 10; + private org.bitcoin.paymentchannel.Protos.Error error_; + /** + * optional .paymentchannels.Error error = 10; + */ + public boolean hasError() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .paymentchannels.Error error = 10; + */ + public org.bitcoin.paymentchannel.Protos.Error getError() { + return error_ == null ? org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance() : error_; + } + /** + * optional .paymentchannels.Error error = 10; + */ + public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() { + return error_ == null ? org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance() : error_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasType()) { + memoizedIsInitialized = 0; + return false; + } + if (hasClientVersion()) { + if (!getClientVersion().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasServerVersion()) { + if (!getServerVersion().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasInitiate()) { + if (!getInitiate().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasProvideRefund()) { + if (!getProvideRefund().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasReturnRefund()) { + if (!getReturnRefund().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasProvideContract()) { + if (!getProvideContract().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasUpdatePayment()) { + if (!getUpdatePayment().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSettlement()) { + if (!getSettlement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getClientVersion()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, getServerVersion()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(4, getInitiate()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(5, getProvideRefund()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(6, getReturnRefund()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeMessage(7, getProvideContract()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeMessage(8, getUpdatePayment()); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeMessage(9, getSettlement()); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeMessage(10, getError()); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeMessage(11, getPaymentAck()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getClientVersion()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getServerVersion()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getInitiate()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getProvideRefund()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getReturnRefund()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getProvideContract()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getUpdatePayment()); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getSettlement()); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getError()); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getPaymentAck()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage other = (org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) obj; + + boolean result = true; + result = result && (hasType() == other.hasType()); + if (hasType()) { + result = result && type_ == other.type_; + } + result = result && (hasClientVersion() == other.hasClientVersion()); + if (hasClientVersion()) { + result = result && getClientVersion() + .equals(other.getClientVersion()); + } + result = result && (hasServerVersion() == other.hasServerVersion()); + if (hasServerVersion()) { + result = result && getServerVersion() + .equals(other.getServerVersion()); + } + result = result && (hasInitiate() == other.hasInitiate()); + if (hasInitiate()) { + result = result && getInitiate() + .equals(other.getInitiate()); + } + result = result && (hasProvideRefund() == other.hasProvideRefund()); + if (hasProvideRefund()) { + result = result && getProvideRefund() + .equals(other.getProvideRefund()); + } + result = result && (hasReturnRefund() == other.hasReturnRefund()); + if (hasReturnRefund()) { + result = result && getReturnRefund() + .equals(other.getReturnRefund()); + } + result = result && (hasProvideContract() == other.hasProvideContract()); + if (hasProvideContract()) { + result = result && getProvideContract() + .equals(other.getProvideContract()); + } + result = result && (hasUpdatePayment() == other.hasUpdatePayment()); + if (hasUpdatePayment()) { + result = result && getUpdatePayment() + .equals(other.getUpdatePayment()); + } + result = result && (hasPaymentAck() == other.hasPaymentAck()); + if (hasPaymentAck()) { + result = result && getPaymentAck() + .equals(other.getPaymentAck()); + } + result = result && (hasSettlement() == other.hasSettlement()); + if (hasSettlement()) { + result = result && getSettlement() + .equals(other.getSettlement()); + } + result = result && (hasError() == other.hasError()); + if (hasError()) { + result = result && getError() + .equals(other.getError()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (hasClientVersion()) { + hash = (37 * hash) + CLIENT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getClientVersion().hashCode(); + } + if (hasServerVersion()) { + hash = (37 * hash) + SERVER_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getServerVersion().hashCode(); + } + if (hasInitiate()) { + hash = (37 * hash) + INITIATE_FIELD_NUMBER; + hash = (53 * hash) + getInitiate().hashCode(); + } + if (hasProvideRefund()) { + hash = (37 * hash) + PROVIDE_REFUND_FIELD_NUMBER; + hash = (53 * hash) + getProvideRefund().hashCode(); + } + if (hasReturnRefund()) { + hash = (37 * hash) + RETURN_REFUND_FIELD_NUMBER; + hash = (53 * hash) + getReturnRefund().hashCode(); + } + if (hasProvideContract()) { + hash = (37 * hash) + PROVIDE_CONTRACT_FIELD_NUMBER; + hash = (53 * hash) + getProvideContract().hashCode(); + } + if (hasUpdatePayment()) { + hash = (37 * hash) + UPDATE_PAYMENT_FIELD_NUMBER; + hash = (53 * hash) + getUpdatePayment().hashCode(); + } + if (hasPaymentAck()) { + hash = (37 * hash) + PAYMENT_ACK_FIELD_NUMBER; + hash = (53 * hash) + getPaymentAck().hashCode(); + } + if (hasSettlement()) { + hash = (37 * hash) + SETTLEMENT_FIELD_NUMBER; + hash = (53 * hash) + getSettlement().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
+     * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
+     * and "secondary" as "server".
+     * 
+ * + * Protobuf type {@code paymentchannels.TwoWayChannelMessage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.TwoWayChannelMessage) + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getClientVersionFieldBuilder(); + getServerVersionFieldBuilder(); + getInitiateFieldBuilder(); + getProvideRefundFieldBuilder(); + getReturnRefundFieldBuilder(); + getProvideContractFieldBuilder(); + getUpdatePaymentFieldBuilder(); + getPaymentAckFieldBuilder(); + getSettlementFieldBuilder(); + getErrorFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + type_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + if (clientVersionBuilder_ == null) { + clientVersion_ = null; + } else { + clientVersionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (serverVersionBuilder_ == null) { + serverVersion_ = null; + } else { + serverVersionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (initiateBuilder_ == null) { + initiate_ = null; + } else { + initiateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (provideRefundBuilder_ == null) { + provideRefund_ = null; + } else { + provideRefundBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (returnRefundBuilder_ == null) { + returnRefund_ = null; + } else { + returnRefundBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (provideContractBuilder_ == null) { + provideContract_ = null; + } else { + provideContractBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + if (updatePaymentBuilder_ == null) { + updatePayment_ = null; + } else { + updatePaymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + if (paymentAckBuilder_ == null) { + paymentAck_ = null; + } else { + paymentAckBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + if (settlementBuilder_ == null) { + settlement_ = null; + } else { + settlementBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (errorBuilder_ == null) { + error_ = null; + } else { + errorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage build() { + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage buildPartial() { + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = new org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (clientVersionBuilder_ == null) { + result.clientVersion_ = clientVersion_; + } else { + result.clientVersion_ = clientVersionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (serverVersionBuilder_ == null) { + result.serverVersion_ = serverVersion_; + } else { + result.serverVersion_ = serverVersionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + if (initiateBuilder_ == null) { + result.initiate_ = initiate_; + } else { + result.initiate_ = initiateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + if (provideRefundBuilder_ == null) { + result.provideRefund_ = provideRefund_; + } else { + result.provideRefund_ = provideRefundBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + if (returnRefundBuilder_ == null) { + result.returnRefund_ = returnRefund_; + } else { + result.returnRefund_ = returnRefundBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + if (provideContractBuilder_ == null) { + result.provideContract_ = provideContract_; + } else { + result.provideContract_ = provideContractBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + if (updatePaymentBuilder_ == null) { + result.updatePayment_ = updatePayment_; + } else { + result.updatePayment_ = updatePaymentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + if (paymentAckBuilder_ == null) { + result.paymentAck_ = paymentAck_; + } else { + result.paymentAck_ = paymentAckBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + if (settlementBuilder_ == null) { + result.settlement_ = settlement_; + } else { + result.settlement_ = settlementBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage other) { + if (other == org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasClientVersion()) { + mergeClientVersion(other.getClientVersion()); + } + if (other.hasServerVersion()) { + mergeServerVersion(other.getServerVersion()); + } + if (other.hasInitiate()) { + mergeInitiate(other.getInitiate()); + } + if (other.hasProvideRefund()) { + mergeProvideRefund(other.getProvideRefund()); + } + if (other.hasReturnRefund()) { + mergeReturnRefund(other.getReturnRefund()); + } + if (other.hasProvideContract()) { + mergeProvideContract(other.getProvideContract()); + } + if (other.hasUpdatePayment()) { + mergeUpdatePayment(other.getUpdatePayment()); + } + if (other.hasPaymentAck()) { + mergePaymentAck(other.getPaymentAck()); + } + if (other.hasSettlement()) { + mergeSettlement(other.getSettlement()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasType()) { + return false; + } + if (hasClientVersion()) { + if (!getClientVersion().isInitialized()) { + return false; + } + } + if (hasServerVersion()) { + if (!getServerVersion().isInitialized()) { + return false; + } + } + if (hasInitiate()) { + if (!getInitiate().isInitialized()) { + return false; + } + } + if (hasProvideRefund()) { + if (!getProvideRefund().isInitialized()) { + return false; + } + } + if (hasReturnRefund()) { + if (!getReturnRefund().isInitialized()) { + return false; + } + } + if (hasProvideContract()) { + if (!getProvideContract().isInitialized()) { + return false; + } + } + if (hasUpdatePayment()) { + if (!getUpdatePayment().isInitialized()) { + return false; + } + } + if (hasSettlement()) { + if (!getSettlement().isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int type_ = 1; + /** + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() { + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType result = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(type_); + return result == null ? org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION : result; + } + /** + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + public Builder setType(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ * + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 1; + onChanged(); + return this; + } + + private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder> clientVersionBuilder_; + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public boolean hasClientVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() { + if (clientVersionBuilder_ == null) { + return clientVersion_ == null ? org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance() : clientVersion_; + } else { + return clientVersionBuilder_.getMessage(); + } + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public Builder setClientVersion(org.bitcoin.paymentchannel.Protos.ClientVersion value) { + if (clientVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientVersion_ = value; + onChanged(); + } else { + clientVersionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public Builder setClientVersion( + org.bitcoin.paymentchannel.Protos.ClientVersion.Builder builderForValue) { + if (clientVersionBuilder_ == null) { + clientVersion_ = builderForValue.build(); + onChanged(); + } else { + clientVersionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public Builder mergeClientVersion(org.bitcoin.paymentchannel.Protos.ClientVersion value) { + if (clientVersionBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + clientVersion_ != null && + clientVersion_ != org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance()) { + clientVersion_ = + org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder(clientVersion_).mergeFrom(value).buildPartial(); + } else { + clientVersion_ = value; + } + onChanged(); + } else { + clientVersionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public Builder clearClientVersion() { + if (clientVersionBuilder_ == null) { + clientVersion_ = null; + onChanged(); + } else { + clientVersionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public org.bitcoin.paymentchannel.Protos.ClientVersion.Builder getClientVersionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClientVersionFieldBuilder().getBuilder(); + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() { + if (clientVersionBuilder_ != null) { + return clientVersionBuilder_.getMessageOrBuilder(); + } else { + return clientVersion_ == null ? + org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance() : clientVersion_; + } + } + /** + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ * + * optional .paymentchannels.ClientVersion client_version = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder> + getClientVersionFieldBuilder() { + if (clientVersionBuilder_ == null) { + clientVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder>( + getClientVersion(), + getParentForChildren(), + isClean()); + clientVersion_ = null; + } + return clientVersionBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder> serverVersionBuilder_; + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public boolean hasServerVersion() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() { + if (serverVersionBuilder_ == null) { + return serverVersion_ == null ? org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance() : serverVersion_; + } else { + return serverVersionBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public Builder setServerVersion(org.bitcoin.paymentchannel.Protos.ServerVersion value) { + if (serverVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverVersion_ = value; + onChanged(); + } else { + serverVersionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public Builder setServerVersion( + org.bitcoin.paymentchannel.Protos.ServerVersion.Builder builderForValue) { + if (serverVersionBuilder_ == null) { + serverVersion_ = builderForValue.build(); + onChanged(); + } else { + serverVersionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public Builder mergeServerVersion(org.bitcoin.paymentchannel.Protos.ServerVersion value) { + if (serverVersionBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + serverVersion_ != null && + serverVersion_ != org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance()) { + serverVersion_ = + org.bitcoin.paymentchannel.Protos.ServerVersion.newBuilder(serverVersion_).mergeFrom(value).buildPartial(); + } else { + serverVersion_ = value; + } + onChanged(); + } else { + serverVersionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public Builder clearServerVersion() { + if (serverVersionBuilder_ == null) { + serverVersion_ = null; + onChanged(); + } else { + serverVersionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public org.bitcoin.paymentchannel.Protos.ServerVersion.Builder getServerVersionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getServerVersionFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() { + if (serverVersionBuilder_ != null) { + return serverVersionBuilder_.getMessageOrBuilder(); + } else { + return serverVersion_ == null ? + org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance() : serverVersion_; + } + } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder> + getServerVersionFieldBuilder() { + if (serverVersionBuilder_ == null) { + serverVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder>( + getServerVersion(), + getParentForChildren(), + isClean()); + serverVersion_ = null; + } + return serverVersionBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.Initiate initiate_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder> initiateBuilder_; + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public boolean hasInitiate() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() { + if (initiateBuilder_ == null) { + return initiate_ == null ? org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance() : initiate_; + } else { + return initiateBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public Builder setInitiate(org.bitcoin.paymentchannel.Protos.Initiate value) { + if (initiateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initiate_ = value; + onChanged(); + } else { + initiateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public Builder setInitiate( + org.bitcoin.paymentchannel.Protos.Initiate.Builder builderForValue) { + if (initiateBuilder_ == null) { + initiate_ = builderForValue.build(); + onChanged(); + } else { + initiateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public Builder mergeInitiate(org.bitcoin.paymentchannel.Protos.Initiate value) { + if (initiateBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + initiate_ != null && + initiate_ != org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) { + initiate_ = + org.bitcoin.paymentchannel.Protos.Initiate.newBuilder(initiate_).mergeFrom(value).buildPartial(); + } else { + initiate_ = value; + } + onChanged(); + } else { + initiateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public Builder clearInitiate() { + if (initiateBuilder_ == null) { + initiate_ = null; + onChanged(); + } else { + initiateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public org.bitcoin.paymentchannel.Protos.Initiate.Builder getInitiateBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getInitiateFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() { + if (initiateBuilder_ != null) { + return initiateBuilder_.getMessageOrBuilder(); + } else { + return initiate_ == null ? + org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance() : initiate_; + } + } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder> + getInitiateFieldBuilder() { + if (initiateBuilder_ == null) { + initiateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder>( + getInitiate(), + getParentForChildren(), + isClean()); + initiate_ = null; + } + return initiateBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder> provideRefundBuilder_; + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public boolean hasProvideRefund() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() { + if (provideRefundBuilder_ == null) { + return provideRefund_ == null ? org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance() : provideRefund_; + } else { + return provideRefundBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public Builder setProvideRefund(org.bitcoin.paymentchannel.Protos.ProvideRefund value) { + if (provideRefundBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + provideRefund_ = value; + onChanged(); + } else { + provideRefundBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public Builder setProvideRefund( + org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder builderForValue) { + if (provideRefundBuilder_ == null) { + provideRefund_ = builderForValue.build(); + onChanged(); + } else { + provideRefundBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public Builder mergeProvideRefund(org.bitcoin.paymentchannel.Protos.ProvideRefund value) { + if (provideRefundBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + provideRefund_ != null && + provideRefund_ != org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance()) { + provideRefund_ = + org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder(provideRefund_).mergeFrom(value).buildPartial(); + } else { + provideRefund_ = value; + } + onChanged(); + } else { + provideRefundBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public Builder clearProvideRefund() { + if (provideRefundBuilder_ == null) { + provideRefund_ = null; + onChanged(); + } else { + provideRefundBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder getProvideRefundBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getProvideRefundFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() { + if (provideRefundBuilder_ != null) { + return provideRefundBuilder_.getMessageOrBuilder(); + } else { + return provideRefund_ == null ? + org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance() : provideRefund_; + } + } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder> + getProvideRefundFieldBuilder() { + if (provideRefundBuilder_ == null) { + provideRefundBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder>( + getProvideRefund(), + getParentForChildren(), + isClean()); + provideRefund_ = null; + } + return provideRefundBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder> returnRefundBuilder_; + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public boolean hasReturnRefund() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() { + if (returnRefundBuilder_ == null) { + return returnRefund_ == null ? org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance() : returnRefund_; + } else { + return returnRefundBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public Builder setReturnRefund(org.bitcoin.paymentchannel.Protos.ReturnRefund value) { + if (returnRefundBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + returnRefund_ = value; + onChanged(); + } else { + returnRefundBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public Builder setReturnRefund( + org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder builderForValue) { + if (returnRefundBuilder_ == null) { + returnRefund_ = builderForValue.build(); + onChanged(); + } else { + returnRefundBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public Builder mergeReturnRefund(org.bitcoin.paymentchannel.Protos.ReturnRefund value) { + if (returnRefundBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020) && + returnRefund_ != null && + returnRefund_ != org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance()) { + returnRefund_ = + org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder(returnRefund_).mergeFrom(value).buildPartial(); + } else { + returnRefund_ = value; + } + onChanged(); + } else { + returnRefundBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public Builder clearReturnRefund() { + if (returnRefundBuilder_ == null) { + returnRefund_ = null; + onChanged(); + } else { + returnRefundBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder getReturnRefundBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getReturnRefundFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() { + if (returnRefundBuilder_ != null) { + return returnRefundBuilder_.getMessageOrBuilder(); + } else { + return returnRefund_ == null ? + org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance() : returnRefund_; + } + } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder> + getReturnRefundFieldBuilder() { + if (returnRefundBuilder_ == null) { + returnRefundBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder>( + getReturnRefund(), + getParentForChildren(), + isClean()); + returnRefund_ = null; + } + return returnRefundBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder> provideContractBuilder_; + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public boolean hasProvideContract() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() { + if (provideContractBuilder_ == null) { + return provideContract_ == null ? org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance() : provideContract_; + } else { + return provideContractBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public Builder setProvideContract(org.bitcoin.paymentchannel.Protos.ProvideContract value) { + if (provideContractBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + provideContract_ = value; + onChanged(); + } else { + provideContractBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public Builder setProvideContract( + org.bitcoin.paymentchannel.Protos.ProvideContract.Builder builderForValue) { + if (provideContractBuilder_ == null) { + provideContract_ = builderForValue.build(); + onChanged(); + } else { + provideContractBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public Builder mergeProvideContract(org.bitcoin.paymentchannel.Protos.ProvideContract value) { + if (provideContractBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040) && + provideContract_ != null && + provideContract_ != org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance()) { + provideContract_ = + org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder(provideContract_).mergeFrom(value).buildPartial(); + } else { + provideContract_ = value; + } + onChanged(); + } else { + provideContractBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public Builder clearProvideContract() { + if (provideContractBuilder_ == null) { + provideContract_ = null; + onChanged(); + } else { + provideContractBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public org.bitcoin.paymentchannel.Protos.ProvideContract.Builder getProvideContractBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getProvideContractFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() { + if (provideContractBuilder_ != null) { + return provideContractBuilder_.getMessageOrBuilder(); + } else { + return provideContract_ == null ? + org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance() : provideContract_; + } + } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder> + getProvideContractFieldBuilder() { + if (provideContractBuilder_ == null) { + provideContractBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder>( + getProvideContract(), + getParentForChildren(), + isClean()); + provideContract_ = null; + } + return provideContractBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> updatePaymentBuilder_; + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public boolean hasUpdatePayment() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() { + if (updatePaymentBuilder_ == null) { + return updatePayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : updatePayment_; + } else { + return updatePaymentBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public Builder setUpdatePayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) { + if (updatePaymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updatePayment_ = value; + onChanged(); + } else { + updatePaymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public Builder setUpdatePayment( + org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder builderForValue) { + if (updatePaymentBuilder_ == null) { + updatePayment_ = builderForValue.build(); + onChanged(); + } else { + updatePaymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public Builder mergeUpdatePayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) { + if (updatePaymentBuilder_ == null) { + if (((bitField0_ & 0x00000080) == 0x00000080) && + updatePayment_ != null && + updatePayment_ != org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) { + updatePayment_ = + org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder(updatePayment_).mergeFrom(value).buildPartial(); + } else { + updatePayment_ = value; + } + onChanged(); + } else { + updatePaymentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public Builder clearUpdatePayment() { + if (updatePaymentBuilder_ == null) { + updatePayment_ = null; + onChanged(); + } else { + updatePaymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder getUpdatePaymentBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdatePaymentFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() { + if (updatePaymentBuilder_ != null) { + return updatePaymentBuilder_.getMessageOrBuilder(); + } else { + return updatePayment_ == null ? + org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : updatePayment_; + } + } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> + getUpdatePaymentFieldBuilder() { + if (updatePaymentBuilder_ == null) { + updatePaymentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder>( + getUpdatePayment(), + getParentForChildren(), + isClean()); + updatePayment_ = null; + } + return updatePaymentBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.PaymentAck paymentAck_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.PaymentAck, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder, org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder> paymentAckBuilder_; + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public boolean hasPaymentAck() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public org.bitcoin.paymentchannel.Protos.PaymentAck getPaymentAck() { + if (paymentAckBuilder_ == null) { + return paymentAck_ == null ? org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance() : paymentAck_; + } else { + return paymentAckBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public Builder setPaymentAck(org.bitcoin.paymentchannel.Protos.PaymentAck value) { + if (paymentAckBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + paymentAck_ = value; + onChanged(); + } else { + paymentAckBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public Builder setPaymentAck( + org.bitcoin.paymentchannel.Protos.PaymentAck.Builder builderForValue) { + if (paymentAckBuilder_ == null) { + paymentAck_ = builderForValue.build(); + onChanged(); + } else { + paymentAckBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public Builder mergePaymentAck(org.bitcoin.paymentchannel.Protos.PaymentAck value) { + if (paymentAckBuilder_ == null) { + if (((bitField0_ & 0x00000100) == 0x00000100) && + paymentAck_ != null && + paymentAck_ != org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance()) { + paymentAck_ = + org.bitcoin.paymentchannel.Protos.PaymentAck.newBuilder(paymentAck_).mergeFrom(value).buildPartial(); + } else { + paymentAck_ = value; + } + onChanged(); + } else { + paymentAckBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public Builder clearPaymentAck() { + if (paymentAckBuilder_ == null) { + paymentAck_ = null; + onChanged(); + } else { + paymentAckBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public org.bitcoin.paymentchannel.Protos.PaymentAck.Builder getPaymentAckBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getPaymentAckFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + public org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder getPaymentAckOrBuilder() { + if (paymentAckBuilder_ != null) { + return paymentAckBuilder_.getMessageOrBuilder(); + } else { + return paymentAck_ == null ? + org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance() : paymentAck_; + } + } + /** + * optional .paymentchannels.PaymentAck payment_ack = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.PaymentAck, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder, org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder> + getPaymentAckFieldBuilder() { + if (paymentAckBuilder_ == null) { + paymentAckBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.PaymentAck, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder, org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder>( + getPaymentAck(), + getParentForChildren(), + isClean()); + paymentAck_ = null; + } + return paymentAckBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.Settlement settlement_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Settlement, org.bitcoin.paymentchannel.Protos.Settlement.Builder, org.bitcoin.paymentchannel.Protos.SettlementOrBuilder> settlementBuilder_; + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public boolean hasSettlement() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public org.bitcoin.paymentchannel.Protos.Settlement getSettlement() { + if (settlementBuilder_ == null) { + return settlement_ == null ? org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance() : settlement_; + } else { + return settlementBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public Builder setSettlement(org.bitcoin.paymentchannel.Protos.Settlement value) { + if (settlementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settlement_ = value; + onChanged(); + } else { + settlementBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public Builder setSettlement( + org.bitcoin.paymentchannel.Protos.Settlement.Builder builderForValue) { + if (settlementBuilder_ == null) { + settlement_ = builderForValue.build(); + onChanged(); + } else { + settlementBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public Builder mergeSettlement(org.bitcoin.paymentchannel.Protos.Settlement value) { + if (settlementBuilder_ == null) { + if (((bitField0_ & 0x00000200) == 0x00000200) && + settlement_ != null && + settlement_ != org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance()) { + settlement_ = + org.bitcoin.paymentchannel.Protos.Settlement.newBuilder(settlement_).mergeFrom(value).buildPartial(); + } else { + settlement_ = value; + } + onChanged(); + } else { + settlementBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public Builder clearSettlement() { + if (settlementBuilder_ == null) { + settlement_ = null; + onChanged(); + } else { + settlementBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public org.bitcoin.paymentchannel.Protos.Settlement.Builder getSettlementBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getSettlementFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + public org.bitcoin.paymentchannel.Protos.SettlementOrBuilder getSettlementOrBuilder() { + if (settlementBuilder_ != null) { + return settlementBuilder_.getMessageOrBuilder(); + } else { + return settlement_ == null ? + org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance() : settlement_; + } + } + /** + * optional .paymentchannels.Settlement settlement = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Settlement, org.bitcoin.paymentchannel.Protos.Settlement.Builder, org.bitcoin.paymentchannel.Protos.SettlementOrBuilder> + getSettlementFieldBuilder() { + if (settlementBuilder_ == null) { + settlementBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Settlement, org.bitcoin.paymentchannel.Protos.Settlement.Builder, org.bitcoin.paymentchannel.Protos.SettlementOrBuilder>( + getSettlement(), + getParentForChildren(), + isClean()); + settlement_ = null; + } + return settlementBuilder_; + } + + private org.bitcoin.paymentchannel.Protos.Error error_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder> errorBuilder_; + /** + * optional .paymentchannels.Error error = 10; + */ + public boolean hasError() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .paymentchannels.Error error = 10; + */ + public org.bitcoin.paymentchannel.Protos.Error getError() { + if (errorBuilder_ == null) { + return error_ == null ? org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * optional .paymentchannels.Error error = 10; + */ + public Builder setError(org.bitcoin.paymentchannel.Protos.Error value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .paymentchannels.Error error = 10; + */ + public Builder setError( + org.bitcoin.paymentchannel.Protos.Error.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .paymentchannels.Error error = 10; + */ + public Builder mergeError(org.bitcoin.paymentchannel.Protos.Error value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000400) == 0x00000400) && + error_ != null && + error_ != org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) { + error_ = + org.bitcoin.paymentchannel.Protos.Error.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .paymentchannels.Error error = 10; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + errorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + /** + * optional .paymentchannels.Error error = 10; + */ + public org.bitcoin.paymentchannel.Protos.Error.Builder getErrorBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * optional .paymentchannels.Error error = 10; + */ + public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? + org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance() : error_; + } + } + /** + * optional .paymentchannels.Error error = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder>( + getError(), + getParentForChildren(), + isClean()); + error_ = null; + } + return errorBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.TwoWayChannelMessage) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.TwoWayChannelMessage) + private static final org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage(); + } + + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TwoWayChannelMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TwoWayChannelMessage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ClientVersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.ClientVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 major = 1; + */ + boolean hasMajor(); + /** + * required int32 major = 1; + */ + int getMajor(); + + /** + * optional int32 minor = 2 [default = 0]; + */ + boolean hasMinor(); + /** + * optional int32 minor = 2 [default = 0]; + */ + int getMinor(); + + /** + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + boolean hasPreviousChannelContractHash(); + /** + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + com.google.protobuf.ByteString getPreviousChannelContractHash(); + + /** + *
+     * How many seconds should the channel be open, only used when a new channel is created.
+     * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+     * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + boolean hasTimeWindowSecs(); + /** + *
+     * How many seconds should the channel be open, only used when a new channel is created.
+     * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+     * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + long getTimeWindowSecs(); + } + /** + *
+   * Sent by primary to secondary on opening the connection. If anything is received before this is
+   * sent, the socket is closed.
+   * 
+ * + * Protobuf type {@code paymentchannels.ClientVersion} + */ + public static final class ClientVersion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.ClientVersion) + ClientVersionOrBuilder { + // Use ClientVersion.newBuilder() to construct. + private ClientVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClientVersion() { + major_ = 0; + minor_ = 0; + previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; + timeWindowSecs_ = 86340L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClientVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + major_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + minor_ = input.readInt32(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + previousChannelContractHash_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + timeWindowSecs_ = input.readUInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ClientVersion.class, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class); + } + + private int bitField0_; + public static final int MAJOR_FIELD_NUMBER = 1; + private int major_; + /** + * required int32 major = 1; + */ + public boolean hasMajor() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 major = 1; + */ + public int getMajor() { + return major_; + } + + public static final int MINOR_FIELD_NUMBER = 2; + private int minor_; + /** + * optional int32 minor = 2 [default = 0]; + */ + public boolean hasMinor() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public int getMinor() { + return minor_; + } + + public static final int PREVIOUS_CHANNEL_CONTRACT_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString previousChannelContractHash_; + /** + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + public boolean hasPreviousChannelContractHash() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + public com.google.protobuf.ByteString getPreviousChannelContractHash() { + return previousChannelContractHash_; + } + + public static final int TIME_WINDOW_SECS_FIELD_NUMBER = 4; + private long timeWindowSecs_; + /** + *
+     * How many seconds should the channel be open, only used when a new channel is created.
+     * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+     * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + public boolean hasTimeWindowSecs() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * How many seconds should the channel be open, only used when a new channel is created.
+     * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+     * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + public long getTimeWindowSecs() { + return timeWindowSecs_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMajor()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, major_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, minor_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, previousChannelContractHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeUInt64(4, timeWindowSecs_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, major_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minor_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, previousChannelContractHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, timeWindowSecs_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ClientVersion)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.ClientVersion other = (org.bitcoin.paymentchannel.Protos.ClientVersion) obj; + + boolean result = true; + result = result && (hasMajor() == other.hasMajor()); + if (hasMajor()) { + result = result && (getMajor() + == other.getMajor()); + } + result = result && (hasMinor() == other.hasMinor()); + if (hasMinor()) { + result = result && (getMinor() + == other.getMinor()); + } + result = result && (hasPreviousChannelContractHash() == other.hasPreviousChannelContractHash()); + if (hasPreviousChannelContractHash()) { + result = result && getPreviousChannelContractHash() + .equals(other.getPreviousChannelContractHash()); + } + result = result && (hasTimeWindowSecs() == other.hasTimeWindowSecs()); + if (hasTimeWindowSecs()) { + result = result && (getTimeWindowSecs() + == other.getTimeWindowSecs()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasMajor()) { + hash = (37 * hash) + MAJOR_FIELD_NUMBER; + hash = (53 * hash) + getMajor(); + } + if (hasMinor()) { + hash = (37 * hash) + MINOR_FIELD_NUMBER; + hash = (53 * hash) + getMinor(); + } + if (hasPreviousChannelContractHash()) { + hash = (37 * hash) + PREVIOUS_CHANNEL_CONTRACT_HASH_FIELD_NUMBER; + hash = (53 * hash) + getPreviousChannelContractHash().hashCode(); + } + if (hasTimeWindowSecs()) { + hash = (37 * hash) + TIME_WINDOW_SECS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimeWindowSecs()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ClientVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Sent by primary to secondary on opening the connection. If anything is received before this is
+     * sent, the socket is closed.
+     * 
+ * + * Protobuf type {@code paymentchannels.ClientVersion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.ClientVersion) + org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ClientVersion.class, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + major_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + minor_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + timeWindowSecs_ = 86340L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion build() { + org.bitcoin.paymentchannel.Protos.ClientVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion buildPartial() { + org.bitcoin.paymentchannel.Protos.ClientVersion result = new org.bitcoin.paymentchannel.Protos.ClientVersion(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.major_ = major_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.minor_ = minor_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.previousChannelContractHash_ = previousChannelContractHash_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.timeWindowSecs_ = timeWindowSecs_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.ClientVersion) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.ClientVersion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ClientVersion other) { + if (other == org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance()) return this; + if (other.hasMajor()) { + setMajor(other.getMajor()); + } + if (other.hasMinor()) { + setMinor(other.getMinor()); + } + if (other.hasPreviousChannelContractHash()) { + setPreviousChannelContractHash(other.getPreviousChannelContractHash()); + } + if (other.hasTimeWindowSecs()) { + setTimeWindowSecs(other.getTimeWindowSecs()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMajor()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.ClientVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ClientVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int major_ ; + /** + * required int32 major = 1; + */ + public boolean hasMajor() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 major = 1; + */ + public int getMajor() { + return major_; + } + /** + * required int32 major = 1; + */ + public Builder setMajor(int value) { + bitField0_ |= 0x00000001; + major_ = value; + onChanged(); + return this; + } + /** + * required int32 major = 1; + */ + public Builder clearMajor() { + bitField0_ = (bitField0_ & ~0x00000001); + major_ = 0; + onChanged(); + return this; + } + + private int minor_ ; + /** + * optional int32 minor = 2 [default = 0]; + */ + public boolean hasMinor() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public int getMinor() { + return minor_; + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public Builder setMinor(int value) { + bitField0_ |= 0x00000002; + minor_ = value; + onChanged(); + return this; + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public Builder clearMinor() { + bitField0_ = (bitField0_ & ~0x00000002); + minor_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + public boolean hasPreviousChannelContractHash() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + public com.google.protobuf.ByteString getPreviousChannelContractHash() { + return previousChannelContractHash_; + } + /** + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + public Builder setPreviousChannelContractHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + previousChannelContractHash_ = value; + onChanged(); + return this; + } + /** + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ * + * optional bytes previous_channel_contract_hash = 3; + */ + public Builder clearPreviousChannelContractHash() { + bitField0_ = (bitField0_ & ~0x00000004); + previousChannelContractHash_ = getDefaultInstance().getPreviousChannelContractHash(); + onChanged(); + return this; + } + + private long timeWindowSecs_ = 86340L; + /** + *
+       * How many seconds should the channel be open, only used when a new channel is created.
+       * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+       * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + public boolean hasTimeWindowSecs() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * How many seconds should the channel be open, only used when a new channel is created.
+       * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+       * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + public long getTimeWindowSecs() { + return timeWindowSecs_; + } + /** + *
+       * How many seconds should the channel be open, only used when a new channel is created.
+       * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+       * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + public Builder setTimeWindowSecs(long value) { + bitField0_ |= 0x00000008; + timeWindowSecs_ = value; + onChanged(); + return this; + } + /** + *
+       * How many seconds should the channel be open, only used when a new channel is created.
+       * Defaults to 24 h minus 60 seconds, 24*60*60 - 60
+       * 
+ * + * optional uint64 time_window_secs = 4 [default = 86340]; + */ + public Builder clearTimeWindowSecs() { + bitField0_ = (bitField0_ & ~0x00000008); + timeWindowSecs_ = 86340L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.ClientVersion) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.ClientVersion) + private static final org.bitcoin.paymentchannel.Protos.ClientVersion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ClientVersion(); + } + + public static org.bitcoin.paymentchannel.Protos.ClientVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ClientVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServerVersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.ServerVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 major = 1; + */ + boolean hasMajor(); + /** + * required int32 major = 1; + */ + int getMajor(); + + /** + * optional int32 minor = 2 [default = 0]; + */ + boolean hasMinor(); + /** + * optional int32 minor = 2 [default = 0]; + */ + int getMinor(); + } + /** + *
+   * Send by secondary to primary upon receiving the ClientVersion message. If it is willing to
+   * speak the given major version, it sends back the same major version and the minor version it
+   * speaks. If it is not, it may send back a lower major version representing the highest version
+   * it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a
+   * lower major version, the secondary should either expect to continue with that version, or
+   * should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards
+   * incompatible changes to the protocol bump the major version. Extensions bump the minor version
+   * 
+ * + * Protobuf type {@code paymentchannels.ServerVersion} + */ + public static final class ServerVersion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.ServerVersion) + ServerVersionOrBuilder { + // Use ServerVersion.newBuilder() to construct. + private ServerVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServerVersion() { + major_ = 0; + minor_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServerVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + major_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + minor_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ServerVersion.class, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class); + } + + private int bitField0_; + public static final int MAJOR_FIELD_NUMBER = 1; + private int major_; + /** + * required int32 major = 1; + */ + public boolean hasMajor() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 major = 1; + */ + public int getMajor() { + return major_; + } + + public static final int MINOR_FIELD_NUMBER = 2; + private int minor_; + /** + * optional int32 minor = 2 [default = 0]; + */ + public boolean hasMinor() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public int getMinor() { + return minor_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMajor()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, major_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, minor_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, major_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minor_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ServerVersion)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.ServerVersion other = (org.bitcoin.paymentchannel.Protos.ServerVersion) obj; + + boolean result = true; + result = result && (hasMajor() == other.hasMajor()); + if (hasMajor()) { + result = result && (getMajor() + == other.getMajor()); + } + result = result && (hasMinor() == other.hasMinor()); + if (hasMinor()) { + result = result && (getMinor() + == other.getMinor()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasMajor()) { + hash = (37 * hash) + MAJOR_FIELD_NUMBER; + hash = (53 * hash) + getMajor(); + } + if (hasMinor()) { + hash = (37 * hash) + MINOR_FIELD_NUMBER; + hash = (53 * hash) + getMinor(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ServerVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Send by secondary to primary upon receiving the ClientVersion message. If it is willing to
+     * speak the given major version, it sends back the same major version and the minor version it
+     * speaks. If it is not, it may send back a lower major version representing the highest version
+     * it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a
+     * lower major version, the secondary should either expect to continue with that version, or
+     * should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards
+     * incompatible changes to the protocol bump the major version. Extensions bump the minor version
+     * 
+ * + * Protobuf type {@code paymentchannels.ServerVersion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.ServerVersion) + org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ServerVersion.class, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.ServerVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + major_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + minor_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.ServerVersion getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.ServerVersion build() { + org.bitcoin.paymentchannel.Protos.ServerVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.ServerVersion buildPartial() { + org.bitcoin.paymentchannel.Protos.ServerVersion result = new org.bitcoin.paymentchannel.Protos.ServerVersion(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.major_ = major_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.minor_ = minor_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.ServerVersion) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.ServerVersion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ServerVersion other) { + if (other == org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance()) return this; + if (other.hasMajor()) { + setMajor(other.getMajor()); + } + if (other.hasMinor()) { + setMinor(other.getMinor()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMajor()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.ServerVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ServerVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int major_ ; + /** + * required int32 major = 1; + */ + public boolean hasMajor() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 major = 1; + */ + public int getMajor() { + return major_; + } + /** + * required int32 major = 1; + */ + public Builder setMajor(int value) { + bitField0_ |= 0x00000001; + major_ = value; + onChanged(); + return this; + } + /** + * required int32 major = 1; + */ + public Builder clearMajor() { + bitField0_ = (bitField0_ & ~0x00000001); + major_ = 0; + onChanged(); + return this; + } + + private int minor_ ; + /** + * optional int32 minor = 2 [default = 0]; + */ + public boolean hasMinor() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public int getMinor() { + return minor_; + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public Builder setMinor(int value) { + bitField0_ |= 0x00000002; + minor_ = value; + onChanged(); + return this; + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public Builder clearMinor() { + bitField0_ = (bitField0_ & ~0x00000002); + minor_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.ServerVersion) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.ServerVersion) + private static final org.bitcoin.paymentchannel.Protos.ServerVersion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ServerVersion(); + } + + public static org.bitcoin.paymentchannel.Protos.ServerVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ServerVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServerVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.ServerVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InitiateOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.Initiate) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ * + * required bytes multisig_key = 1; + */ + boolean hasMultisigKey(); + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ * + * required bytes multisig_key = 1; + */ + com.google.protobuf.ByteString getMultisigKey(); + + /** + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + boolean hasMinAcceptedChannelSize(); + /** + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + long getMinAcceptedChannelSize(); + + /** + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust the server? Probably opens up
+     * attack vectors. We can assume the client has an independent clock, however. If the client
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ * + * required uint64 expire_time_secs = 3; + */ + boolean hasExpireTimeSecs(); + /** + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust the server? Probably opens up
+     * attack vectors. We can assume the client has an independent clock, however. If the client
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ * + * required uint64 expire_time_secs = 3; + */ + long getExpireTimeSecs(); + + /** + *
+     * The amount of money the server requires for the initial payment. The act of opening a channel
+     * always transfers some quantity of money to the server: it's impossible to have a channel with
+     * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+     * due to having paid under the dust limit. Because the dust limit will float in future, the
+     * server tells the client what it thinks it is, and the client is supposed to sanity check this
+     * value.
+     * 
+ * + * required uint64 min_payment = 4; + */ + boolean hasMinPayment(); + /** + *
+     * The amount of money the server requires for the initial payment. The act of opening a channel
+     * always transfers some quantity of money to the server: it's impossible to have a channel with
+     * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+     * due to having paid under the dust limit. Because the dust limit will float in future, the
+     * server tells the client what it thinks it is, and the client is supposed to sanity check this
+     * value.
+     * 
+ * + * required uint64 min_payment = 4; + */ + long getMinPayment(); + } + /** + *
+   * Sent from server to client once version nego is done.
+   * 
+ * + * Protobuf type {@code paymentchannels.Initiate} + */ + public static final class Initiate extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.Initiate) + InitiateOrBuilder { + // Use Initiate.newBuilder() to construct. + private Initiate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Initiate() { + multisigKey_ = com.google.protobuf.ByteString.EMPTY; + minAcceptedChannelSize_ = 0L; + expireTimeSecs_ = 0L; + minPayment_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Initiate( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + multisigKey_ = input.readBytes(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + minAcceptedChannelSize_ = input.readUInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + expireTimeSecs_ = input.readUInt64(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + minPayment_ = input.readUInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class); + } + + private int bitField0_; + public static final int MULTISIG_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString multisigKey_; + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ * + * required bytes multisig_key = 1; + */ + public boolean hasMultisigKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ * + * required bytes multisig_key = 1; + */ + public com.google.protobuf.ByteString getMultisigKey() { + return multisigKey_; + } + + public static final int MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER = 2; + private long minAcceptedChannelSize_; + /** + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + public boolean hasMinAcceptedChannelSize() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + public long getMinAcceptedChannelSize() { + return minAcceptedChannelSize_; + } + + public static final int EXPIRE_TIME_SECS_FIELD_NUMBER = 3; + private long expireTimeSecs_; + /** + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust the server? Probably opens up
+     * attack vectors. We can assume the client has an independent clock, however. If the client
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ * + * required uint64 expire_time_secs = 3; + */ + public boolean hasExpireTimeSecs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust the server? Probably opens up
+     * attack vectors. We can assume the client has an independent clock, however. If the client
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ * + * required uint64 expire_time_secs = 3; + */ + public long getExpireTimeSecs() { + return expireTimeSecs_; + } + + public static final int MIN_PAYMENT_FIELD_NUMBER = 4; + private long minPayment_; + /** + *
+     * The amount of money the server requires for the initial payment. The act of opening a channel
+     * always transfers some quantity of money to the server: it's impossible to have a channel with
+     * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+     * due to having paid under the dust limit. Because the dust limit will float in future, the
+     * server tells the client what it thinks it is, and the client is supposed to sanity check this
+     * value.
+     * 
+ * + * required uint64 min_payment = 4; + */ + public boolean hasMinPayment() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * The amount of money the server requires for the initial payment. The act of opening a channel
+     * always transfers some quantity of money to the server: it's impossible to have a channel with
+     * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+     * due to having paid under the dust limit. Because the dust limit will float in future, the
+     * server tells the client what it thinks it is, and the client is supposed to sanity check this
+     * value.
+     * 
+ * + * required uint64 min_payment = 4; + */ + public long getMinPayment() { + return minPayment_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMultisigKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMinAcceptedChannelSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasExpireTimeSecs()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMinPayment()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, multisigKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt64(2, minAcceptedChannelSize_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, expireTimeSecs_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeUInt64(4, minPayment_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, multisigKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, minAcceptedChannelSize_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, expireTimeSecs_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, minPayment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.Initiate)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.Initiate other = (org.bitcoin.paymentchannel.Protos.Initiate) obj; + + boolean result = true; + result = result && (hasMultisigKey() == other.hasMultisigKey()); + if (hasMultisigKey()) { + result = result && getMultisigKey() + .equals(other.getMultisigKey()); + } + result = result && (hasMinAcceptedChannelSize() == other.hasMinAcceptedChannelSize()); + if (hasMinAcceptedChannelSize()) { + result = result && (getMinAcceptedChannelSize() + == other.getMinAcceptedChannelSize()); + } + result = result && (hasExpireTimeSecs() == other.hasExpireTimeSecs()); + if (hasExpireTimeSecs()) { + result = result && (getExpireTimeSecs() + == other.getExpireTimeSecs()); + } + result = result && (hasMinPayment() == other.hasMinPayment()); + if (hasMinPayment()) { + result = result && (getMinPayment() + == other.getMinPayment()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasMultisigKey()) { + hash = (37 * hash) + MULTISIG_KEY_FIELD_NUMBER; + hash = (53 * hash) + getMultisigKey().hashCode(); + } + if (hasMinAcceptedChannelSize()) { + hash = (37 * hash) + MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinAcceptedChannelSize()); + } + if (hasExpireTimeSecs()) { + hash = (37 * hash) + EXPIRE_TIME_SECS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExpireTimeSecs()); + } + if (hasMinPayment()) { + hash = (37 * hash) + MIN_PAYMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinPayment()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Initiate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Sent from server to client once version nego is done.
+     * 
+ * + * Protobuf type {@code paymentchannels.Initiate} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.Initiate) + org.bitcoin.paymentchannel.Protos.InitiateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.Initiate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + multisigKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + minAcceptedChannelSize_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + expireTimeSecs_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + minPayment_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.Initiate build() { + org.bitcoin.paymentchannel.Protos.Initiate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.Initiate buildPartial() { + org.bitcoin.paymentchannel.Protos.Initiate result = new org.bitcoin.paymentchannel.Protos.Initiate(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.multisigKey_ = multisigKey_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.minAcceptedChannelSize_ = minAcceptedChannelSize_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.expireTimeSecs_ = expireTimeSecs_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.minPayment_ = minPayment_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.Initiate) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.Initiate)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Initiate other) { + if (other == org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) return this; + if (other.hasMultisigKey()) { + setMultisigKey(other.getMultisigKey()); + } + if (other.hasMinAcceptedChannelSize()) { + setMinAcceptedChannelSize(other.getMinAcceptedChannelSize()); + } + if (other.hasExpireTimeSecs()) { + setExpireTimeSecs(other.getExpireTimeSecs()); + } + if (other.hasMinPayment()) { + setMinPayment(other.getMinPayment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMultisigKey()) { + return false; + } + if (!hasMinAcceptedChannelSize()) { + return false; + } + if (!hasExpireTimeSecs()) { + return false; + } + if (!hasMinPayment()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.Initiate parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.Initiate) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ * + * required bytes multisig_key = 1; + */ + public boolean hasMultisigKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ * + * required bytes multisig_key = 1; + */ + public com.google.protobuf.ByteString getMultisigKey() { + return multisigKey_; + } + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ * + * required bytes multisig_key = 1; + */ + public Builder setMultisigKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + multisigKey_ = value; + onChanged(); + return this; + } + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ * + * required bytes multisig_key = 1; + */ + public Builder clearMultisigKey() { + bitField0_ = (bitField0_ & ~0x00000001); + multisigKey_ = getDefaultInstance().getMultisigKey(); + onChanged(); + return this; + } + + private long minAcceptedChannelSize_ ; + /** + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + public boolean hasMinAcceptedChannelSize() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + public long getMinAcceptedChannelSize() { + return minAcceptedChannelSize_; + } + /** + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + public Builder setMinAcceptedChannelSize(long value) { + bitField0_ |= 0x00000002; + minAcceptedChannelSize_ = value; + onChanged(); + return this; + } + /** + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ * + * required uint64 min_accepted_channel_size = 2; + */ + public Builder clearMinAcceptedChannelSize() { + bitField0_ = (bitField0_ & ~0x00000002); + minAcceptedChannelSize_ = 0L; + onChanged(); + return this; + } + + private long expireTimeSecs_ ; + /** + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust the server? Probably opens up
+       * attack vectors. We can assume the client has an independent clock, however. If the client
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ * + * required uint64 expire_time_secs = 3; + */ + public boolean hasExpireTimeSecs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust the server? Probably opens up
+       * attack vectors. We can assume the client has an independent clock, however. If the client
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ * + * required uint64 expire_time_secs = 3; + */ + public long getExpireTimeSecs() { + return expireTimeSecs_; + } + /** + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust the server? Probably opens up
+       * attack vectors. We can assume the client has an independent clock, however. If the client
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ * + * required uint64 expire_time_secs = 3; + */ + public Builder setExpireTimeSecs(long value) { + bitField0_ |= 0x00000004; + expireTimeSecs_ = value; + onChanged(); + return this; + } + /** + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust the server? Probably opens up
+       * attack vectors. We can assume the client has an independent clock, however. If the client
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ * + * required uint64 expire_time_secs = 3; + */ + public Builder clearExpireTimeSecs() { + bitField0_ = (bitField0_ & ~0x00000004); + expireTimeSecs_ = 0L; + onChanged(); + return this; + } + + private long minPayment_ ; + /** + *
+       * The amount of money the server requires for the initial payment. The act of opening a channel
+       * always transfers some quantity of money to the server: it's impossible to have a channel with
+       * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+       * due to having paid under the dust limit. Because the dust limit will float in future, the
+       * server tells the client what it thinks it is, and the client is supposed to sanity check this
+       * value.
+       * 
+ * + * required uint64 min_payment = 4; + */ + public boolean hasMinPayment() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * The amount of money the server requires for the initial payment. The act of opening a channel
+       * always transfers some quantity of money to the server: it's impossible to have a channel with
+       * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+       * due to having paid under the dust limit. Because the dust limit will float in future, the
+       * server tells the client what it thinks it is, and the client is supposed to sanity check this
+       * value.
+       * 
+ * + * required uint64 min_payment = 4; + */ + public long getMinPayment() { + return minPayment_; + } + /** + *
+       * The amount of money the server requires for the initial payment. The act of opening a channel
+       * always transfers some quantity of money to the server: it's impossible to have a channel with
+       * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+       * due to having paid under the dust limit. Because the dust limit will float in future, the
+       * server tells the client what it thinks it is, and the client is supposed to sanity check this
+       * value.
+       * 
+ * + * required uint64 min_payment = 4; + */ + public Builder setMinPayment(long value) { + bitField0_ |= 0x00000008; + minPayment_ = value; + onChanged(); + return this; + } + /** + *
+       * The amount of money the server requires for the initial payment. The act of opening a channel
+       * always transfers some quantity of money to the server: it's impossible to have a channel with
+       * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+       * due to having paid under the dust limit. Because the dust limit will float in future, the
+       * server tells the client what it thinks it is, and the client is supposed to sanity check this
+       * value.
+       * 
+ * + * required uint64 min_payment = 4; + */ + public Builder clearMinPayment() { + bitField0_ = (bitField0_ & ~0x00000008); + minPayment_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.Initiate) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.Initiate) + private static final org.bitcoin.paymentchannel.Protos.Initiate DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.Initiate(); + } + + public static org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Initiate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Initiate(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ProvideRefundOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.ProvideRefund) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * required bytes multisig_key = 1; + */ + boolean hasMultisigKey(); + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * required bytes multisig_key = 1; + */ + com.google.protobuf.ByteString getMultisigKey(); + + /** + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ * + * required bytes tx = 2; + */ + boolean hasTx(); + /** + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ * + * required bytes tx = 2; + */ + com.google.protobuf.ByteString getTx(); + } + /** + *
+   * Sent from primary to secondary after Initiate to begin the refund transaction signing.
+   * 
+ * + * Protobuf type {@code paymentchannels.ProvideRefund} + */ + public static final class ProvideRefund extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.ProvideRefund) + ProvideRefundOrBuilder { + // Use ProvideRefund.newBuilder() to construct. + private ProvideRefund(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProvideRefund() { + multisigKey_ = com.google.protobuf.ByteString.EMPTY; + tx_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProvideRefund( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + multisigKey_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + tx_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class); + } + + private int bitField0_; + public static final int MULTISIG_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString multisigKey_; + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * required bytes multisig_key = 1; + */ + public boolean hasMultisigKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * required bytes multisig_key = 1; + */ + public com.google.protobuf.ByteString getMultisigKey() { + return multisigKey_; + } + + public static final int TX_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString tx_; + /** + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ * + * required bytes tx = 2; + */ + public boolean hasTx() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ * + * required bytes tx = 2; + */ + public com.google.protobuf.ByteString getTx() { + return tx_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasMultisigKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTx()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, multisigKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, tx_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, multisigKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, tx_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ProvideRefund)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.ProvideRefund other = (org.bitcoin.paymentchannel.Protos.ProvideRefund) obj; + + boolean result = true; + result = result && (hasMultisigKey() == other.hasMultisigKey()); + if (hasMultisigKey()) { + result = result && getMultisigKey() + .equals(other.getMultisigKey()); + } + result = result && (hasTx() == other.hasTx()); + if (hasTx()) { + result = result && getTx() + .equals(other.getTx()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasMultisigKey()) { + hash = (37 * hash) + MULTISIG_KEY_FIELD_NUMBER; + hash = (53 * hash) + getMultisigKey().hashCode(); + } + if (hasTx()) { + hash = (37 * hash) + TX_FIELD_NUMBER; + hash = (53 * hash) + getTx().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideRefund prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Sent from primary to secondary after Initiate to begin the refund transaction signing.
+     * 
+ * + * Protobuf type {@code paymentchannels.ProvideRefund} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.ProvideRefund) + org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + multisigKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + tx_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.ProvideRefund build() { + org.bitcoin.paymentchannel.Protos.ProvideRefund result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.ProvideRefund buildPartial() { + org.bitcoin.paymentchannel.Protos.ProvideRefund result = new org.bitcoin.paymentchannel.Protos.ProvideRefund(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.multisigKey_ = multisigKey_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.tx_ = tx_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideRefund) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideRefund)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideRefund other) { + if (other == org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance()) return this; + if (other.hasMultisigKey()) { + setMultisigKey(other.getMultisigKey()); + } + if (other.hasTx()) { + setTx(other.getTx()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasMultisigKey()) { + return false; + } + if (!hasTx()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.ProvideRefund parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideRefund) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * required bytes multisig_key = 1; + */ + public boolean hasMultisigKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * required bytes multisig_key = 1; + */ + public com.google.protobuf.ByteString getMultisigKey() { + return multisigKey_; + } + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * required bytes multisig_key = 1; + */ + public Builder setMultisigKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + multisigKey_ = value; + onChanged(); + return this; + } + /** + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * required bytes multisig_key = 1; + */ + public Builder clearMultisigKey() { + bitField0_ = (bitField0_ & ~0x00000001); + multisigKey_ = getDefaultInstance().getMultisigKey(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ * + * required bytes tx = 2; + */ + public boolean hasTx() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ * + * required bytes tx = 2; + */ + public com.google.protobuf.ByteString getTx() { + return tx_; + } + /** + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ * + * required bytes tx = 2; + */ + public Builder setTx(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + tx_ = value; + onChanged(); + return this; + } + /** + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ * + * required bytes tx = 2; + */ + public Builder clearTx() { + bitField0_ = (bitField0_ & ~0x00000002); + tx_ = getDefaultInstance().getTx(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideRefund) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.ProvideRefund) + private static final org.bitcoin.paymentchannel.Protos.ProvideRefund DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ProvideRefund(); + } + + public static org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ProvideRefund parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProvideRefund(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ReturnRefundOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.ReturnRefund) + com.google.protobuf.MessageOrBuilder { + + /** + * required bytes signature = 1; + */ + boolean hasSignature(); + /** + * required bytes signature = 1; + */ + com.google.protobuf.ByteString getSignature(); + } + /** + *
+   * Sent from secondary to primary after it has done initial verification of the refund
+   * transaction. Contains the primary's signature which is required to spend the multisig contract
+   * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
+   * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
+   * input's sequence and transaction's nLockTime remain set.
+   * 
+ * + * Protobuf type {@code paymentchannels.ReturnRefund} + */ + public static final class ReturnRefund extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.ReturnRefund) + ReturnRefundOrBuilder { + // Use ReturnRefund.newBuilder() to construct. + private ReturnRefund(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ReturnRefund() { + signature_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReturnRefund( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + signature_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class); + } + + private int bitField0_; + public static final int SIGNATURE_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString signature_; + /** + * required bytes signature = 1; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes signature = 1; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasSignature()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, signature_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, signature_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ReturnRefund)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.ReturnRefund other = (org.bitcoin.paymentchannel.Protos.ReturnRefund) obj; + + boolean result = true; + result = result && (hasSignature() == other.hasSignature()); + if (hasSignature()) { + result = result && getSignature() + .equals(other.getSignature()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasSignature()) { + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ReturnRefund prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Sent from secondary to primary after it has done initial verification of the refund
+     * transaction. Contains the primary's signature which is required to spend the multisig contract
+     * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
+     * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
+     * input's sequence and transaction's nLockTime remain set.
+     * 
+ * + * Protobuf type {@code paymentchannels.ReturnRefund} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.ReturnRefund) + org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + signature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.ReturnRefund build() { + org.bitcoin.paymentchannel.Protos.ReturnRefund result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.ReturnRefund buildPartial() { + org.bitcoin.paymentchannel.Protos.ReturnRefund result = new org.bitcoin.paymentchannel.Protos.ReturnRefund(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.signature_ = signature_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.ReturnRefund) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.ReturnRefund)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ReturnRefund other) { + if (other == org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance()) return this; + if (other.hasSignature()) { + setSignature(other.getSignature()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasSignature()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.ReturnRefund parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ReturnRefund) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes signature = 1; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes signature = 1; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * required bytes signature = 1; + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + signature_ = value; + onChanged(); + return this; + } + /** + * required bytes signature = 1; + */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000001); + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.ReturnRefund) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.ReturnRefund) + private static final org.bitcoin.paymentchannel.Protos.ReturnRefund DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ReturnRefund(); + } + + public static org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ReturnRefund parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReturnRefund(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ProvideContractOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.ProvideContract) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * For version 1:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * For version 2:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+     *   primary's and the second being the secondary's.
+     * 
+ * + * required bytes tx = 1; + */ + boolean hasTx(); + /** + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * For version 1:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * For version 2:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+     *   primary's and the second being the secondary's.
+     * 
+ * + * required bytes tx = 1; + */ + com.google.protobuf.ByteString getTx(); + + /** + *
+     * To open the channel, an initial payment of the server-specified dust limit value must be
+     * provided. This ensures that the channel is never in an un-settleable state due to either
+     * no payment tx having been provided at all, or a payment that is smaller than the dust
+     * limit being provided.
+     * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + boolean hasInitialPayment(); + /** + *
+     * To open the channel, an initial payment of the server-specified dust limit value must be
+     * provided. This ensures that the channel is never in an un-settleable state due to either
+     * no payment tx having been provided at all, or a payment that is smaller than the dust
+     * limit being provided.
+     * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + org.bitcoin.paymentchannel.Protos.UpdatePayment getInitialPayment(); + /** + *
+     * To open the channel, an initial payment of the server-specified dust limit value must be
+     * provided. This ensures that the channel is never in an un-settleable state due to either
+     * no payment tx having been provided at all, or a payment that is smaller than the dust
+     * limit being provided.
+     * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getInitialPaymentOrBuilder(); + + /** + *
+     * This field is added in protocol version 2 to send the client public key to the server.
+     * In version 1 it isn't used.
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * optional bytes client_key = 3; + */ + boolean hasClientKey(); + /** + *
+     * This field is added in protocol version 2 to send the client public key to the server.
+     * In version 1 it isn't used.
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * optional bytes client_key = 3; + */ + com.google.protobuf.ByteString getClientKey(); + } + /** + *
+   * Sent from the primary to the secondary to complete initialization.
+   * 
+ * + * Protobuf type {@code paymentchannels.ProvideContract} + */ + public static final class ProvideContract extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.ProvideContract) + ProvideContractOrBuilder { + // Use ProvideContract.newBuilder() to construct. + private ProvideContract(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProvideContract() { + tx_ = com.google.protobuf.ByteString.EMPTY; + clientKey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProvideContract( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + tx_ = input.readBytes(); + break; + } + case 18: { + org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = initialPayment_.toBuilder(); + } + initialPayment_ = input.readMessage(org.bitcoin.paymentchannel.Protos.UpdatePayment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(initialPayment_); + initialPayment_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + bitField0_ |= 0x00000004; + clientKey_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class); + } + + private int bitField0_; + public static final int TX_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString tx_; + /** + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * For version 1:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * For version 2:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+     *   primary's and the second being the secondary's.
+     * 
+ * + * required bytes tx = 1; + */ + public boolean hasTx() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * For version 1:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * For version 2:
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+     *   primary's and the second being the secondary's.
+     * 
+ * + * required bytes tx = 1; + */ + public com.google.protobuf.ByteString getTx() { + return tx_; + } + + public static final int INITIAL_PAYMENT_FIELD_NUMBER = 2; + private org.bitcoin.paymentchannel.Protos.UpdatePayment initialPayment_; + /** + *
+     * To open the channel, an initial payment of the server-specified dust limit value must be
+     * provided. This ensures that the channel is never in an un-settleable state due to either
+     * no payment tx having been provided at all, or a payment that is smaller than the dust
+     * limit being provided.
+     * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public boolean hasInitialPayment() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * To open the channel, an initial payment of the server-specified dust limit value must be
+     * provided. This ensures that the channel is never in an un-settleable state due to either
+     * no payment tx having been provided at all, or a payment that is smaller than the dust
+     * limit being provided.
+     * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePayment getInitialPayment() { + return initialPayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_; + } + /** + *
+     * To open the channel, an initial payment of the server-specified dust limit value must be
+     * provided. This ensures that the channel is never in an un-settleable state due to either
+     * no payment tx having been provided at all, or a payment that is smaller than the dust
+     * limit being provided.
+     * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getInitialPaymentOrBuilder() { + return initialPayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_; + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString clientKey_; + /** + *
+     * This field is added in protocol version 2 to send the client public key to the server.
+     * In version 1 it isn't used.
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * optional bytes client_key = 3; + */ + public boolean hasClientKey() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * This field is added in protocol version 2 to send the client public key to the server.
+     * In version 1 it isn't used.
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ * + * optional bytes client_key = 3; + */ + public com.google.protobuf.ByteString getClientKey() { + return clientKey_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasTx()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasInitialPayment()) { + memoizedIsInitialized = 0; + return false; + } + if (!getInitialPayment().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, tx_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getInitialPayment()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, clientKey_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, tx_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getInitialPayment()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, clientKey_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ProvideContract)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.ProvideContract other = (org.bitcoin.paymentchannel.Protos.ProvideContract) obj; + + boolean result = true; + result = result && (hasTx() == other.hasTx()); + if (hasTx()) { + result = result && getTx() + .equals(other.getTx()); + } + result = result && (hasInitialPayment() == other.hasInitialPayment()); + if (hasInitialPayment()) { + result = result && getInitialPayment() + .equals(other.getInitialPayment()); + } + result = result && (hasClientKey() == other.hasClientKey()); + if (hasClientKey()) { + result = result && getClientKey() + .equals(other.getClientKey()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasTx()) { + hash = (37 * hash) + TX_FIELD_NUMBER; + hash = (53 * hash) + getTx().hashCode(); + } + if (hasInitialPayment()) { + hash = (37 * hash) + INITIAL_PAYMENT_FIELD_NUMBER; + hash = (53 * hash) + getInitialPayment().hashCode(); + } + if (hasClientKey()) { + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideContract prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Sent from the primary to the secondary to complete initialization.
+     * 
+ * + * Protobuf type {@code paymentchannels.ProvideContract} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.ProvideContract) + org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInitialPaymentFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + tx_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (initialPaymentBuilder_ == null) { + initialPayment_ = null; + } else { + initialPaymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + clientKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.ProvideContract build() { + org.bitcoin.paymentchannel.Protos.ProvideContract result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.ProvideContract buildPartial() { + org.bitcoin.paymentchannel.Protos.ProvideContract result = new org.bitcoin.paymentchannel.Protos.ProvideContract(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.tx_ = tx_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (initialPaymentBuilder_ == null) { + result.initialPayment_ = initialPayment_; + } else { + result.initialPayment_ = initialPaymentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.clientKey_ = clientKey_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideContract) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideContract)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideContract other) { + if (other == org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance()) return this; + if (other.hasTx()) { + setTx(other.getTx()); + } + if (other.hasInitialPayment()) { + mergeInitialPayment(other.getInitialPayment()); + } + if (other.hasClientKey()) { + setClientKey(other.getClientKey()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasTx()) { + return false; + } + if (!hasInitialPayment()) { + return false; + } + if (!getInitialPayment().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.ProvideContract parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideContract) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * For version 1:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * For version 2:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+       *   primary's and the second being the secondary's.
+       * 
+ * + * required bytes tx = 1; + */ + public boolean hasTx() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * For version 1:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * For version 2:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+       *   primary's and the second being the secondary's.
+       * 
+ * + * required bytes tx = 1; + */ + public com.google.protobuf.ByteString getTx() { + return tx_; + } + /** + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * For version 1:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * For version 2:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+       *   primary's and the second being the secondary's.
+       * 
+ * + * required bytes tx = 1; + */ + public Builder setTx(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + tx_ = value; + onChanged(); + return this; + } + /** + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * For version 1:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * For version 2:
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+       *   primary's and the second being the secondary's.
+       * 
+ * + * required bytes tx = 1; + */ + public Builder clearTx() { + bitField0_ = (bitField0_ & ~0x00000001); + tx_ = getDefaultInstance().getTx(); + onChanged(); + return this; + } + + private org.bitcoin.paymentchannel.Protos.UpdatePayment initialPayment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> initialPaymentBuilder_; + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public boolean hasInitialPayment() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePayment getInitialPayment() { + if (initialPaymentBuilder_ == null) { + return initialPayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_; + } else { + return initialPaymentBuilder_.getMessage(); + } + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public Builder setInitialPayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) { + if (initialPaymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initialPayment_ = value; + onChanged(); + } else { + initialPaymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public Builder setInitialPayment( + org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder builderForValue) { + if (initialPaymentBuilder_ == null) { + initialPayment_ = builderForValue.build(); + onChanged(); + } else { + initialPaymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public Builder mergeInitialPayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) { + if (initialPaymentBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + initialPayment_ != null && + initialPayment_ != org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) { + initialPayment_ = + org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder(initialPayment_).mergeFrom(value).buildPartial(); + } else { + initialPayment_ = value; + } + onChanged(); + } else { + initialPaymentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public Builder clearInitialPayment() { + if (initialPaymentBuilder_ == null) { + initialPayment_ = null; + onChanged(); + } else { + initialPaymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder getInitialPaymentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInitialPaymentFieldBuilder().getBuilder(); + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getInitialPaymentOrBuilder() { + if (initialPaymentBuilder_ != null) { + return initialPaymentBuilder_.getMessageOrBuilder(); + } else { + return initialPayment_ == null ? + org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_; + } + } + /** + *
+       * To open the channel, an initial payment of the server-specified dust limit value must be
+       * provided. This ensures that the channel is never in an un-settleable state due to either
+       * no payment tx having been provided at all, or a payment that is smaller than the dust
+       * limit being provided.
+       * 
+ * + * required .paymentchannels.UpdatePayment initial_payment = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> + getInitialPaymentFieldBuilder() { + if (initialPaymentBuilder_ == null) { + initialPaymentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder>( + getInitialPayment(), + getParentForChildren(), + isClean()); + initialPayment_ = null; + } + return initialPaymentBuilder_; + } + + private com.google.protobuf.ByteString clientKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * This field is added in protocol version 2 to send the client public key to the server.
+       * In version 1 it isn't used.
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * optional bytes client_key = 3; + */ + public boolean hasClientKey() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * This field is added in protocol version 2 to send the client public key to the server.
+       * In version 1 it isn't used.
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * optional bytes client_key = 3; + */ + public com.google.protobuf.ByteString getClientKey() { + return clientKey_; + } + /** + *
+       * This field is added in protocol version 2 to send the client public key to the server.
+       * In version 1 it isn't used.
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * optional bytes client_key = 3; + */ + public Builder setClientKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + clientKey_ = value; + onChanged(); + return this; + } + /** + *
+       * This field is added in protocol version 2 to send the client public key to the server.
+       * In version 1 it isn't used.
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ * + * optional bytes client_key = 3; + */ + public Builder clearClientKey() { + bitField0_ = (bitField0_ & ~0x00000004); + clientKey_ = getDefaultInstance().getClientKey(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideContract) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.ProvideContract) + private static final org.bitcoin.paymentchannel.Protos.ProvideContract DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ProvideContract(); + } + + public static org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ProvideContract parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProvideContract(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UpdatePaymentOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.UpdatePayment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ * + * required uint64 client_change_value = 1; + */ + boolean hasClientChangeValue(); + /** + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ * + * required uint64 client_change_value = 1; + */ + long getClientChangeValue(); + + /** + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ * + * required bytes signature = 2; + */ + boolean hasSignature(); + /** + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ * + * required bytes signature = 2; + */ + com.google.protobuf.ByteString getSignature(); + + /** + *
+     * Information about this update. Used to extend this protocol.
+     * 
+ * + * optional bytes info = 3; + */ + boolean hasInfo(); + /** + *
+     * Information about this update. Used to extend this protocol.
+     * 
+ * + * optional bytes info = 3; + */ + com.google.protobuf.ByteString getInfo(); + } + /** + *
+   * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
+   * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
+   * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
+   * * Adding an input which spends the multisig contract
+   * * Setting this input's scriptSig to the given signature and a new signature created by the
+   *   primary (the primary should ensure the signature provided correctly spends the multisig
+   *   contract)
+   * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
+   *   the refund transaction
+   * * Setting this output's value to client_change_value (which must be lower than the most recent
+   *   client_change_value and lower than the multisig contract's output value)
+   * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
+   * * Adding any number of additional inputs as desired (eg to add more fee)
+   * 
+ * + * Protobuf type {@code paymentchannels.UpdatePayment} + */ + public static final class UpdatePayment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.UpdatePayment) + UpdatePaymentOrBuilder { + // Use UpdatePayment.newBuilder() to construct. + private UpdatePayment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdatePayment() { + clientChangeValue_ = 0L; + signature_ = com.google.protobuf.ByteString.EMPTY; + info_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdatePayment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + clientChangeValue_ = input.readUInt64(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + signature_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + info_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class); + } + + private int bitField0_; + public static final int CLIENT_CHANGE_VALUE_FIELD_NUMBER = 1; + private long clientChangeValue_; + /** + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ * + * required uint64 client_change_value = 1; + */ + public boolean hasClientChangeValue() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ * + * required uint64 client_change_value = 1; + */ + public long getClientChangeValue() { + return clientChangeValue_; + } + + public static final int SIGNATURE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString signature_; + /** + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ * + * required bytes signature = 2; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ * + * required bytes signature = 2; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + public static final int INFO_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString info_; + /** + *
+     * Information about this update. Used to extend this protocol.
+     * 
+ * + * optional bytes info = 3; + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * Information about this update. Used to extend this protocol.
+     * 
+ * + * optional bytes info = 3; + */ + public com.google.protobuf.ByteString getInfo() { + return info_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasClientChangeValue()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasSignature()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt64(1, clientChangeValue_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, signature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, info_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, clientChangeValue_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, signature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, info_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.UpdatePayment)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.UpdatePayment other = (org.bitcoin.paymentchannel.Protos.UpdatePayment) obj; + + boolean result = true; + result = result && (hasClientChangeValue() == other.hasClientChangeValue()); + if (hasClientChangeValue()) { + result = result && (getClientChangeValue() + == other.getClientChangeValue()); + } + result = result && (hasSignature() == other.hasSignature()); + if (hasSignature()) { + result = result && getSignature() + .equals(other.getSignature()); + } + result = result && (hasInfo() == other.hasInfo()); + if (hasInfo()) { + result = result && getInfo() + .equals(other.getInfo()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasClientChangeValue()) { + hash = (37 * hash) + CLIENT_CHANGE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getClientChangeValue()); + } + if (hasSignature()) { + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + } + if (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.UpdatePayment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
+     * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
+     * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
+     * * Adding an input which spends the multisig contract
+     * * Setting this input's scriptSig to the given signature and a new signature created by the
+     *   primary (the primary should ensure the signature provided correctly spends the multisig
+     *   contract)
+     * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
+     *   the refund transaction
+     * * Setting this output's value to client_change_value (which must be lower than the most recent
+     *   client_change_value and lower than the multisig contract's output value)
+     * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
+     * * Adding any number of additional inputs as desired (eg to add more fee)
+     * 
+ * + * Protobuf type {@code paymentchannels.UpdatePayment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.UpdatePayment) + org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + clientChangeValue_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + signature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + info_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.UpdatePayment build() { + org.bitcoin.paymentchannel.Protos.UpdatePayment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.UpdatePayment buildPartial() { + org.bitcoin.paymentchannel.Protos.UpdatePayment result = new org.bitcoin.paymentchannel.Protos.UpdatePayment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.clientChangeValue_ = clientChangeValue_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.signature_ = signature_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.info_ = info_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.UpdatePayment) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.UpdatePayment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.UpdatePayment other) { + if (other == org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) return this; + if (other.hasClientChangeValue()) { + setClientChangeValue(other.getClientChangeValue()); + } + if (other.hasSignature()) { + setSignature(other.getSignature()); + } + if (other.hasInfo()) { + setInfo(other.getInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasClientChangeValue()) { + return false; + } + if (!hasSignature()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.UpdatePayment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.UpdatePayment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long clientChangeValue_ ; + /** + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ * + * required uint64 client_change_value = 1; + */ + public boolean hasClientChangeValue() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ * + * required uint64 client_change_value = 1; + */ + public long getClientChangeValue() { + return clientChangeValue_; + } + /** + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ * + * required uint64 client_change_value = 1; + */ + public Builder setClientChangeValue(long value) { + bitField0_ |= 0x00000001; + clientChangeValue_ = value; + onChanged(); + return this; + } + /** + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ * + * required uint64 client_change_value = 1; + */ + public Builder clearClientChangeValue() { + bitField0_ = (bitField0_ & ~0x00000001); + clientChangeValue_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ * + * required bytes signature = 2; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ * + * required bytes signature = 2; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ * + * required bytes signature = 2; + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + signature_ = value; + onChanged(); + return this; + } + /** + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ * + * required bytes signature = 2; + */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000002); + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString info_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Information about this update. Used to extend this protocol.
+       * 
+ * + * optional bytes info = 3; + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * Information about this update. Used to extend this protocol.
+       * 
+ * + * optional bytes info = 3; + */ + public com.google.protobuf.ByteString getInfo() { + return info_; + } + /** + *
+       * Information about this update. Used to extend this protocol.
+       * 
+ * + * optional bytes info = 3; + */ + public Builder setInfo(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + info_ = value; + onChanged(); + return this; + } + /** + *
+       * Information about this update. Used to extend this protocol.
+       * 
+ * + * optional bytes info = 3; + */ + public Builder clearInfo() { + bitField0_ = (bitField0_ & ~0x00000004); + info_ = getDefaultInstance().getInfo(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.UpdatePayment) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.UpdatePayment) + private static final org.bitcoin.paymentchannel.Protos.UpdatePayment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.UpdatePayment(); + } + + public static org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UpdatePayment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePayment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PaymentAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.PaymentAck) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Information about this update. Used to extend this protocol
+     * 
+ * + * optional bytes info = 1; + */ + boolean hasInfo(); + /** + *
+     * Information about this update. Used to extend this protocol
+     * 
+ * + * optional bytes info = 1; + */ + com.google.protobuf.ByteString getInfo(); + } + /** + *
+   * This message is sent as an acknowledgement of an UpdatePayment message
+   * 
+ * + * Protobuf type {@code paymentchannels.PaymentAck} + */ + public static final class PaymentAck extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.PaymentAck) + PaymentAckOrBuilder { + // Use PaymentAck.newBuilder() to construct. + private PaymentAck(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PaymentAck() { + info_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentAck( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + info_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.PaymentAck.class, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder.class); + } + + private int bitField0_; + public static final int INFO_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString info_; + /** + *
+     * Information about this update. Used to extend this protocol
+     * 
+ * + * optional bytes info = 1; + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * Information about this update. Used to extend this protocol
+     * 
+ * + * optional bytes info = 1; + */ + public com.google.protobuf.ByteString getInfo() { + return info_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, info_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, info_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.PaymentAck)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.PaymentAck other = (org.bitcoin.paymentchannel.Protos.PaymentAck) obj; + + boolean result = true; + result = result && (hasInfo() == other.hasInfo()); + if (hasInfo()) { + result = result && getInfo() + .equals(other.getInfo()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.PaymentAck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * This message is sent as an acknowledgement of an UpdatePayment message
+     * 
+ * + * Protobuf type {@code paymentchannels.PaymentAck} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.PaymentAck) + org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.PaymentAck.class, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.PaymentAck.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + info_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.PaymentAck getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.PaymentAck build() { + org.bitcoin.paymentchannel.Protos.PaymentAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.PaymentAck buildPartial() { + org.bitcoin.paymentchannel.Protos.PaymentAck result = new org.bitcoin.paymentchannel.Protos.PaymentAck(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.info_ = info_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.PaymentAck) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.PaymentAck)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.PaymentAck other) { + if (other == org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance()) return this; + if (other.hasInfo()) { + setInfo(other.getInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.PaymentAck parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.PaymentAck) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString info_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Information about this update. Used to extend this protocol
+       * 
+ * + * optional bytes info = 1; + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * Information about this update. Used to extend this protocol
+       * 
+ * + * optional bytes info = 1; + */ + public com.google.protobuf.ByteString getInfo() { + return info_; + } + /** + *
+       * Information about this update. Used to extend this protocol
+       * 
+ * + * optional bytes info = 1; + */ + public Builder setInfo(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + info_ = value; + onChanged(); + return this; + } + /** + *
+       * Information about this update. Used to extend this protocol
+       * 
+ * + * optional bytes info = 1; + */ + public Builder clearInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + info_ = getDefaultInstance().getInfo(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.PaymentAck) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.PaymentAck) + private static final org.bitcoin.paymentchannel.Protos.PaymentAck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.PaymentAck(); + } + + public static org.bitcoin.paymentchannel.Protos.PaymentAck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PaymentAck parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentAck(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.PaymentAck getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SettlementOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.Settlement) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * A copy of the fully signed final contract that settles the channel. The client can verify
+     * the transaction is correct and then commit it to their wallet.
+     * 
+ * + * required bytes tx = 3; + */ + boolean hasTx(); + /** + *
+     * A copy of the fully signed final contract that settles the channel. The client can verify
+     * the transaction is correct and then commit it to their wallet.
+     * 
+ * + * required bytes tx = 3; + */ + com.google.protobuf.ByteString getTx(); + } + /** + * Protobuf type {@code paymentchannels.Settlement} + */ + public static final class Settlement extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.Settlement) + SettlementOrBuilder { + // Use Settlement.newBuilder() to construct. + private Settlement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Settlement() { + tx_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Settlement( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 26: { + bitField0_ |= 0x00000001; + tx_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Settlement.class, org.bitcoin.paymentchannel.Protos.Settlement.Builder.class); + } + + private int bitField0_; + public static final int TX_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString tx_; + /** + *
+     * A copy of the fully signed final contract that settles the channel. The client can verify
+     * the transaction is correct and then commit it to their wallet.
+     * 
+ * + * required bytes tx = 3; + */ + public boolean hasTx() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * A copy of the fully signed final contract that settles the channel. The client can verify
+     * the transaction is correct and then commit it to their wallet.
+     * 
+ * + * required bytes tx = 3; + */ + public com.google.protobuf.ByteString getTx() { + return tx_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasTx()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(3, tx_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, tx_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.Settlement)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.Settlement other = (org.bitcoin.paymentchannel.Protos.Settlement) obj; + + boolean result = true; + result = result && (hasTx() == other.hasTx()); + if (hasTx()) { + result = result && getTx() + .equals(other.getTx()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasTx()) { + hash = (37 * hash) + TX_FIELD_NUMBER; + hash = (53 * hash) + getTx().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Settlement prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code paymentchannels.Settlement} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.Settlement) + org.bitcoin.paymentchannel.Protos.SettlementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Settlement.class, org.bitcoin.paymentchannel.Protos.Settlement.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.Settlement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + tx_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.Settlement getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.Settlement build() { + org.bitcoin.paymentchannel.Protos.Settlement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.Settlement buildPartial() { + org.bitcoin.paymentchannel.Protos.Settlement result = new org.bitcoin.paymentchannel.Protos.Settlement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.tx_ = tx_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.Settlement) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.Settlement)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Settlement other) { + if (other == org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance()) return this; + if (other.hasTx()) { + setTx(other.getTx()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasTx()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.Settlement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.Settlement) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * A copy of the fully signed final contract that settles the channel. The client can verify
+       * the transaction is correct and then commit it to their wallet.
+       * 
+ * + * required bytes tx = 3; + */ + public boolean hasTx() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * A copy of the fully signed final contract that settles the channel. The client can verify
+       * the transaction is correct and then commit it to their wallet.
+       * 
+ * + * required bytes tx = 3; + */ + public com.google.protobuf.ByteString getTx() { + return tx_; + } + /** + *
+       * A copy of the fully signed final contract that settles the channel. The client can verify
+       * the transaction is correct and then commit it to their wallet.
+       * 
+ * + * required bytes tx = 3; + */ + public Builder setTx(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + tx_ = value; + onChanged(); + return this; + } + /** + *
+       * A copy of the fully signed final contract that settles the channel. The client can verify
+       * the transaction is correct and then commit it to their wallet.
+       * 
+ * + * required bytes tx = 3; + */ + public Builder clearTx() { + bitField0_ = (bitField0_ & ~0x00000001); + tx_ = getDefaultInstance().getTx(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.Settlement) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.Settlement) + private static final org.bitcoin.paymentchannel.Protos.Settlement DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.Settlement(); + } + + public static org.bitcoin.paymentchannel.Protos.Settlement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Settlement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Settlement(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.Settlement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ErrorOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.Error) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + boolean hasCode(); + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode(); + + /** + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ * + * optional string explanation = 2; + */ + boolean hasExplanation(); + /** + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ * + * optional string explanation = 2; + */ + java.lang.String getExplanation(); + /** + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ * + * optional string explanation = 2; + */ + com.google.protobuf.ByteString + getExplanationBytes(); + + /** + *
+     * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+     * 
+ * + * optional uint64 expected_value = 3; + */ + boolean hasExpectedValue(); + /** + *
+     * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+     * 
+ * + * optional uint64 expected_value = 3; + */ + long getExpectedValue(); + } + /** + *
+   * An Error can be sent by either party at any time
+   * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
+   * closing the socket (unless they just received an ERROR or a CLOSE)
+   * 
+ * + * Protobuf type {@code paymentchannels.Error} + */ + public static final class Error extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.Error) + ErrorOrBuilder { + // Use Error.newBuilder() to construct. + private Error(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Error() { + code_ = 8; + explanation_ = ""; + expectedValue_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Error( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.bitcoin.paymentchannel.Protos.Error.ErrorCode value = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + code_ = rawValue; + } + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + explanation_ = bs; + break; + } + case 24: { + bitField0_ |= 0x00000004; + expectedValue_ = input.readUInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class); + } + + /** + * Protobuf enum {@code paymentchannels.Error.ErrorCode} + */ + public enum ErrorCode + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * Protocol timeout occurred (one party hung).
+       * 
+ * + * TIMEOUT = 1; + */ + TIMEOUT(1), + /** + *
+       * Generic error indicating some message was not properly
+       * 
+ * + * SYNTAX_ERROR = 2; + */ + SYNTAX_ERROR(2), + /** + *
+       * formatted or was out of order.
+       * 
+ * + * NO_ACCEPTABLE_VERSION = 3; + */ + NO_ACCEPTABLE_VERSION(3), + /** + *
+       * A provided transaction was not in the proper structure
+       * 
+ * + * BAD_TRANSACTION = 4; + */ + BAD_TRANSACTION(4), + /** + *
+       * (wrong inputs/outputs, sequence, lock time, signature,
+       * etc)
+       * 
+ * + * TIME_WINDOW_UNACCEPTABLE = 5; + */ + TIME_WINDOW_UNACCEPTABLE(5), + /** + *
+       * for the primary
+       * 
+ * + * CHANNEL_VALUE_TOO_LARGE = 6; + */ + CHANNEL_VALUE_TOO_LARGE(6), + /** + *
+       * too large for the primary
+       * 
+ * + * MIN_PAYMENT_TOO_LARGE = 7; + */ + MIN_PAYMENT_TOO_LARGE(7), + /** + * OTHER = 8; + */ + OTHER(8), + ; + + /** + *
+       * Protocol timeout occurred (one party hung).
+       * 
+ * + * TIMEOUT = 1; + */ + public static final int TIMEOUT_VALUE = 1; + /** + *
+       * Generic error indicating some message was not properly
+       * 
+ * + * SYNTAX_ERROR = 2; + */ + public static final int SYNTAX_ERROR_VALUE = 2; + /** + *
+       * formatted or was out of order.
+       * 
+ * + * NO_ACCEPTABLE_VERSION = 3; + */ + public static final int NO_ACCEPTABLE_VERSION_VALUE = 3; + /** + *
+       * A provided transaction was not in the proper structure
+       * 
+ * + * BAD_TRANSACTION = 4; + */ + public static final int BAD_TRANSACTION_VALUE = 4; + /** + *
+       * (wrong inputs/outputs, sequence, lock time, signature,
+       * etc)
+       * 
+ * + * TIME_WINDOW_UNACCEPTABLE = 5; + */ + public static final int TIME_WINDOW_UNACCEPTABLE_VALUE = 5; + /** + *
+       * for the primary
+       * 
+ * + * CHANNEL_VALUE_TOO_LARGE = 6; + */ + public static final int CHANNEL_VALUE_TOO_LARGE_VALUE = 6; + /** + *
+       * too large for the primary
+       * 
+ * + * MIN_PAYMENT_TOO_LARGE = 7; + */ + public static final int MIN_PAYMENT_TOO_LARGE_VALUE = 7; + /** + * OTHER = 8; + */ + public static final int OTHER_VALUE = 8; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ErrorCode valueOf(int value) { + return forNumber(value); + } + + public static ErrorCode forNumber(int value) { + switch (value) { + case 1: return TIMEOUT; + case 2: return SYNTAX_ERROR; + case 3: return NO_ACCEPTABLE_VERSION; + case 4: return BAD_TRANSACTION; + case 5: return TIME_WINDOW_UNACCEPTABLE; + case 6: return CHANNEL_VALUE_TOO_LARGE; + case 7: return MIN_PAYMENT_TOO_LARGE; + case 8: return OTHER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ErrorCode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ErrorCode findValueByNumber(int number) { + return ErrorCode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.Error.getDescriptor().getEnumTypes().get(0); + } + + private static final ErrorCode[] VALUES = values(); + + public static ErrorCode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ErrorCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:paymentchannels.Error.ErrorCode) + } + + private int bitField0_; + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public boolean hasCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() { + org.bitcoin.paymentchannel.Protos.Error.ErrorCode result = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(code_); + return result == null ? org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER : result; + } + + public static final int EXPLANATION_FIELD_NUMBER = 2; + private volatile java.lang.Object explanation_; + /** + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ * + * optional string explanation = 2; + */ + public boolean hasExplanation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ * + * optional string explanation = 2; + */ + public java.lang.String getExplanation() { + java.lang.Object ref = explanation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + explanation_ = s; + } + return s; + } + } + /** + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ * + * optional string explanation = 2; + */ + public com.google.protobuf.ByteString + getExplanationBytes() { + java.lang.Object ref = explanation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + explanation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPECTED_VALUE_FIELD_NUMBER = 3; + private long expectedValue_; + /** + *
+     * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+     * 
+ * + * optional uint64 expected_value = 3; + */ + public boolean hasExpectedValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+     * 
+ * + * optional uint64 expected_value = 3; + */ + public long getExpectedValue() { + return expectedValue_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, code_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, explanation_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, expectedValue_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, code_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, explanation_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, expectedValue_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.paymentchannel.Protos.Error)) { + return super.equals(obj); + } + org.bitcoin.paymentchannel.Protos.Error other = (org.bitcoin.paymentchannel.Protos.Error) obj; + + boolean result = true; + result = result && (hasCode() == other.hasCode()); + if (hasCode()) { + result = result && code_ == other.code_; + } + result = result && (hasExplanation() == other.hasExplanation()); + if (hasExplanation()) { + result = result && getExplanation() + .equals(other.getExplanation()); + } + result = result && (hasExpectedValue() == other.hasExpectedValue()); + if (hasExpectedValue()) { + result = result && (getExpectedValue() + == other.getExpectedValue()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasCode()) { + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + } + if (hasExplanation()) { + hash = (37 * hash) + EXPLANATION_FIELD_NUMBER; + hash = (53 * hash) + getExplanation().hashCode(); + } + if (hasExpectedValue()) { + hash = (37 * hash) + EXPECTED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExpectedValue()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Error prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * An Error can be sent by either party at any time
+     * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
+     * closing the socket (unless they just received an ERROR or a CLOSE)
+     * 
+ * + * Protobuf type {@code paymentchannels.Error} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.Error) + org.bitcoin.paymentchannel.Protos.ErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.Error.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + code_ = 8; + bitField0_ = (bitField0_ & ~0x00000001); + explanation_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + expectedValue_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.Error build() { + org.bitcoin.paymentchannel.Protos.Error result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.Error buildPartial() { + org.bitcoin.paymentchannel.Protos.Error result = new org.bitcoin.paymentchannel.Protos.Error(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.code_ = code_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.explanation_ = explanation_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.expectedValue_ = expectedValue_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.Error) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.Error)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Error other) { + if (other == org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) return this; + if (other.hasCode()) { + setCode(other.getCode()); + } + if (other.hasExplanation()) { + bitField0_ |= 0x00000002; + explanation_ = other.explanation_; + onChanged(); + } + if (other.hasExpectedValue()) { + setExpectedValue(other.getExpectedValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.Error parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.Error) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int code_ = 8; + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public boolean hasCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() { + org.bitcoin.paymentchannel.Protos.Error.ErrorCode result = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(code_); + return result == null ? org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER : result; + } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public Builder setCode(org.bitcoin.paymentchannel.Protos.Error.ErrorCode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 8; + onChanged(); + return this; + } + + private java.lang.Object explanation_ = ""; + /** + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ * + * optional string explanation = 2; + */ + public boolean hasExplanation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ * + * optional string explanation = 2; + */ + public java.lang.String getExplanation() { + java.lang.Object ref = explanation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + explanation_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ * + * optional string explanation = 2; + */ + public com.google.protobuf.ByteString + getExplanationBytes() { + java.lang.Object ref = explanation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + explanation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ * + * optional string explanation = 2; + */ + public Builder setExplanation( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + explanation_ = value; + onChanged(); + return this; + } + /** + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ * + * optional string explanation = 2; + */ + public Builder clearExplanation() { + bitField0_ = (bitField0_ & ~0x00000002); + explanation_ = getDefaultInstance().getExplanation(); + onChanged(); + return this; + } + /** + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ * + * optional string explanation = 2; + */ + public Builder setExplanationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + explanation_ = value; + onChanged(); + return this; + } + + private long expectedValue_ ; + /** + *
+       * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+       * 
+ * + * optional uint64 expected_value = 3; + */ + public boolean hasExpectedValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+       * 
+ * + * optional uint64 expected_value = 3; + */ + public long getExpectedValue() { + return expectedValue_; + } + /** + *
+       * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+       * 
+ * + * optional uint64 expected_value = 3; + */ + public Builder setExpectedValue(long value) { + bitField0_ |= 0x00000004; + expectedValue_ = value; + onChanged(); + return this; + } + /** + *
+       * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+       * 
+ * + * optional uint64 expected_value = 3; + */ + public Builder clearExpectedValue() { + bitField0_ = (bitField0_ & ~0x00000004); + expectedValue_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.Error) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.Error) + private static final org.bitcoin.paymentchannel.Protos.Error DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.Error(); + } + + public static org.bitcoin.paymentchannel.Protos.Error getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Error parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Error(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_TwoWayChannelMessage_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_ClientVersion_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_ClientVersion_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_ServerVersion_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_ServerVersion_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_Initiate_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_Initiate_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_ProvideRefund_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_ProvideRefund_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_ReturnRefund_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_ReturnRefund_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_ProvideContract_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_ProvideContract_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_UpdatePayment_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_UpdatePayment_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_PaymentAck_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_PaymentAck_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_Settlement_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_Settlement_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_Error_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_Error_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024paymentchannel.proto\022\017paymentchannels\"" + + "\260\006\n\024TwoWayChannelMessage\022?\n\004type\030\001 \002(\01621" + + ".paymentchannels.TwoWayChannelMessage.Me" + + "ssageType\0226\n\016client_version\030\002 \001(\0132\036.paym" + + "entchannels.ClientVersion\0226\n\016server_vers" + + "ion\030\003 \001(\0132\036.paymentchannels.ServerVersio" + + "n\022+\n\010initiate\030\004 \001(\0132\031.paymentchannels.In" + + "itiate\0226\n\016provide_refund\030\005 \001(\0132\036.payment" + + "channels.ProvideRefund\0224\n\rreturn_refund\030" + + "\006 \001(\0132\035.paymentchannels.ReturnRefund\022:\n\020", + "provide_contract\030\007 \001(\0132 .paymentchannels" + + ".ProvideContract\0226\n\016update_payment\030\010 \001(\013" + + "2\036.paymentchannels.UpdatePayment\0220\n\013paym" + + "ent_ack\030\013 \001(\0132\033.paymentchannels.PaymentA" + + "ck\022/\n\nsettlement\030\t \001(\0132\033.paymentchannels" + + ".Settlement\022%\n\005error\030\n \001(\0132\026.paymentchan" + + "nels.Error\"\315\001\n\013MessageType\022\022\n\016CLIENT_VER" + + "SION\020\001\022\022\n\016SERVER_VERSION\020\002\022\014\n\010INITIATE\020\003" + + "\022\022\n\016PROVIDE_REFUND\020\004\022\021\n\rRETURN_REFUND\020\005\022" + + "\024\n\020PROVIDE_CONTRACT\020\006\022\020\n\014CHANNEL_OPEN\020\007\022", + "\022\n\016UPDATE_PAYMENT\020\010\022\017\n\013PAYMENT_ACK\020\013\022\t\n\005" + + "CLOSE\020\t\022\t\n\005ERROR\020\n\"y\n\rClientVersion\022\r\n\005m" + + "ajor\030\001 \002(\005\022\020\n\005minor\030\002 \001(\005:\0010\022&\n\036previous" + + "_channel_contract_hash\030\003 \001(\014\022\037\n\020time_win" + + "dow_secs\030\004 \001(\004:\00586340\"0\n\rServerVersion\022\r" + + "\n\005major\030\001 \002(\005\022\020\n\005minor\030\002 \001(\005:\0010\"r\n\010Initi" + + "ate\022\024\n\014multisig_key\030\001 \002(\014\022!\n\031min_accepte" + + "d_channel_size\030\002 \002(\004\022\030\n\020expire_time_secs" + + "\030\003 \002(\004\022\023\n\013min_payment\030\004 \002(\004\"1\n\rProvideRe" + + "fund\022\024\n\014multisig_key\030\001 \002(\014\022\n\n\002tx\030\002 \002(\014\"!", + "\n\014ReturnRefund\022\021\n\tsignature\030\001 \002(\014\"j\n\017Pro" + + "videContract\022\n\n\002tx\030\001 \002(\014\0227\n\017initial_paym" + + "ent\030\002 \002(\0132\036.paymentchannels.UpdatePaymen" + + "t\022\022\n\nclient_key\030\003 \001(\014\"M\n\rUpdatePayment\022\033" + + "\n\023client_change_value\030\001 \002(\004\022\021\n\tsignature" + + "\030\002 \002(\014\022\014\n\004info\030\003 \001(\014\"\032\n\nPaymentAck\022\014\n\004in" + + "fo\030\001 \001(\014\"\030\n\nSettlement\022\n\n\002tx\030\003 \002(\014\"\251\002\n\005E" + + "rror\0225\n\004code\030\001 \001(\0162 .paymentchannels.Err" + + "or.ErrorCode:\005OTHER\022\023\n\013explanation\030\002 \001(\t" + + "\022\026\n\016expected_value\030\003 \001(\004\"\273\001\n\tErrorCode\022\013", + "\n\007TIMEOUT\020\001\022\020\n\014SYNTAX_ERROR\020\002\022\031\n\025NO_ACCE" + + "PTABLE_VERSION\020\003\022\023\n\017BAD_TRANSACTION\020\004\022\034\n" + + "\030TIME_WINDOW_UNACCEPTABLE\020\005\022\033\n\027CHANNEL_V" + + "ALUE_TOO_LARGE\020\006\022\031\n\025MIN_PAYMENT_TOO_LARG" + + "E\020\007\022\t\n\005OTHER\020\010B$\n\032org.bitcoin.paymentcha" + + "nnelB\006Protos" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_paymentchannels_TwoWayChannelMessage_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_TwoWayChannelMessage_descriptor, + new java.lang.String[] { "Type", "ClientVersion", "ServerVersion", "Initiate", "ProvideRefund", "ReturnRefund", "ProvideContract", "UpdatePayment", "PaymentAck", "Settlement", "Error", }); + internal_static_paymentchannels_ClientVersion_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_paymentchannels_ClientVersion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_ClientVersion_descriptor, + new java.lang.String[] { "Major", "Minor", "PreviousChannelContractHash", "TimeWindowSecs", }); + internal_static_paymentchannels_ServerVersion_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_paymentchannels_ServerVersion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_ServerVersion_descriptor, + new java.lang.String[] { "Major", "Minor", }); + internal_static_paymentchannels_Initiate_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_paymentchannels_Initiate_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_Initiate_descriptor, + new java.lang.String[] { "MultisigKey", "MinAcceptedChannelSize", "ExpireTimeSecs", "MinPayment", }); + internal_static_paymentchannels_ProvideRefund_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_paymentchannels_ProvideRefund_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_ProvideRefund_descriptor, + new java.lang.String[] { "MultisigKey", "Tx", }); + internal_static_paymentchannels_ReturnRefund_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_paymentchannels_ReturnRefund_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_ReturnRefund_descriptor, + new java.lang.String[] { "Signature", }); + internal_static_paymentchannels_ProvideContract_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_paymentchannels_ProvideContract_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_ProvideContract_descriptor, + new java.lang.String[] { "Tx", "InitialPayment", "ClientKey", }); + internal_static_paymentchannels_UpdatePayment_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_paymentchannels_UpdatePayment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_UpdatePayment_descriptor, + new java.lang.String[] { "ClientChangeValue", "Signature", "Info", }); + internal_static_paymentchannels_PaymentAck_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_paymentchannels_PaymentAck_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_PaymentAck_descriptor, + new java.lang.String[] { "Info", }); + internal_static_paymentchannels_Settlement_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_paymentchannels_Settlement_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_Settlement_descriptor, + new java.lang.String[] { "Tx", }); + internal_static_paymentchannels_Error_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_paymentchannels_Error_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_Error_descriptor, + new java.lang.String[] { "Code", "Explanation", "ExpectedValue", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/core/src/main/java/org/bitcoin/protocols/payments/Protos.java b/core/src/main/java/org/bitcoin/protocols/payments/Protos.java new file mode 100644 index 00000000..7db4cb8c --- /dev/null +++ b/core/src/main/java/org/bitcoin/protocols/payments/Protos.java @@ -0,0 +1,6547 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: paymentrequest.proto + +package org.bitcoin.protocols.payments; + +public final class Protos { + private Protos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface OutputOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.Output) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * amount is integer-number-of-satoshis
+     * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + boolean hasAmount(); + /** + *
+     * amount is integer-number-of-satoshis
+     * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + long getAmount(); + + /** + *
+     * usually one of the standard Script forms
+     * 
+ * + * required bytes script = 2; + */ + boolean hasScript(); + /** + *
+     * usually one of the standard Script forms
+     * 
+ * + * required bytes script = 2; + */ + com.google.protobuf.ByteString getScript(); + } + /** + *
+   * Generalized form of "send payment to this/these bitcoin addresses"
+   * 
+ * + * Protobuf type {@code payments.Output} + */ + public static final class Output extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:payments.Output) + OutputOrBuilder { + // Use Output.newBuilder() to construct. + private Output(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Output() { + amount_ = 0L; + script_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Output( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + amount_ = input.readUInt64(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + script_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.Output.class, org.bitcoin.protocols.payments.Protos.Output.Builder.class); + } + + private int bitField0_; + public static final int AMOUNT_FIELD_NUMBER = 1; + private long amount_; + /** + *
+     * amount is integer-number-of-satoshis
+     * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + public boolean hasAmount() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * amount is integer-number-of-satoshis
+     * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + public long getAmount() { + return amount_; + } + + public static final int SCRIPT_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString script_; + /** + *
+     * usually one of the standard Script forms
+     * 
+ * + * required bytes script = 2; + */ + public boolean hasScript() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * usually one of the standard Script forms
+     * 
+ * + * required bytes script = 2; + */ + public com.google.protobuf.ByteString getScript() { + return script_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasScript()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt64(1, amount_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, script_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, amount_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, script_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.protocols.payments.Protos.Output)) { + return super.equals(obj); + } + org.bitcoin.protocols.payments.Protos.Output other = (org.bitcoin.protocols.payments.Protos.Output) obj; + + boolean result = true; + result = result && (hasAmount() == other.hasAmount()); + if (hasAmount()) { + result = result && (getAmount() + == other.getAmount()); + } + result = result && (hasScript() == other.hasScript()); + if (hasScript()) { + result = result && getScript() + .equals(other.getScript()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasAmount()) { + hash = (37 * hash) + AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAmount()); + } + if (hasScript()) { + hash = (37 * hash) + SCRIPT_FIELD_NUMBER; + hash = (53 * hash) + getScript().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Output parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.Output parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.Output prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Generalized form of "send payment to this/these bitcoin addresses"
+     * 
+ * + * Protobuf type {@code payments.Output} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:payments.Output) + org.bitcoin.protocols.payments.Protos.OutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.Output.class, org.bitcoin.protocols.payments.Protos.Output.Builder.class); + } + + // Construct using org.bitcoin.protocols.payments.Protos.Output.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + amount_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + script_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_descriptor; + } + + public org.bitcoin.protocols.payments.Protos.Output getDefaultInstanceForType() { + return org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance(); + } + + public org.bitcoin.protocols.payments.Protos.Output build() { + org.bitcoin.protocols.payments.Protos.Output result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.protocols.payments.Protos.Output buildPartial() { + org.bitcoin.protocols.payments.Protos.Output result = new org.bitcoin.protocols.payments.Protos.Output(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.amount_ = amount_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.script_ = script_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.protocols.payments.Protos.Output) { + return mergeFrom((org.bitcoin.protocols.payments.Protos.Output)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Output other) { + if (other == org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance()) return this; + if (other.hasAmount()) { + setAmount(other.getAmount()); + } + if (other.hasScript()) { + setScript(other.getScript()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasScript()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.protocols.payments.Protos.Output parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.protocols.payments.Protos.Output) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long amount_ ; + /** + *
+       * amount is integer-number-of-satoshis
+       * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + public boolean hasAmount() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * amount is integer-number-of-satoshis
+       * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + public long getAmount() { + return amount_; + } + /** + *
+       * amount is integer-number-of-satoshis
+       * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + public Builder setAmount(long value) { + bitField0_ |= 0x00000001; + amount_ = value; + onChanged(); + return this; + } + /** + *
+       * amount is integer-number-of-satoshis
+       * 
+ * + * optional uint64 amount = 1 [default = 0]; + */ + public Builder clearAmount() { + bitField0_ = (bitField0_ & ~0x00000001); + amount_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString script_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * usually one of the standard Script forms
+       * 
+ * + * required bytes script = 2; + */ + public boolean hasScript() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * usually one of the standard Script forms
+       * 
+ * + * required bytes script = 2; + */ + public com.google.protobuf.ByteString getScript() { + return script_; + } + /** + *
+       * usually one of the standard Script forms
+       * 
+ * + * required bytes script = 2; + */ + public Builder setScript(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + script_ = value; + onChanged(); + return this; + } + /** + *
+       * usually one of the standard Script forms
+       * 
+ * + * required bytes script = 2; + */ + public Builder clearScript() { + bitField0_ = (bitField0_ & ~0x00000002); + script_ = getDefaultInstance().getScript(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:payments.Output) + } + + // @@protoc_insertion_point(class_scope:payments.Output) + private static final org.bitcoin.protocols.payments.Protos.Output DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.Output(); + } + + public static org.bitcoin.protocols.payments.Protos.Output getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Output parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Output(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.protocols.payments.Protos.Output getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PaymentDetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.PaymentDetails) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * "main" or "test"
+     * 
+ * + * optional string network = 1 [default = "main"]; + */ + boolean hasNetwork(); + /** + *
+     * "main" or "test"
+     * 
+ * + * optional string network = 1 [default = "main"]; + */ + java.lang.String getNetwork(); + /** + *
+     * "main" or "test"
+     * 
+ * + * optional string network = 1 [default = "main"]; + */ + com.google.protobuf.ByteString + getNetworkBytes(); + + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + java.util.List + getOutputsList(); + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + org.bitcoin.protocols.payments.Protos.Output getOutputs(int index); + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + int getOutputsCount(); + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + java.util.List + getOutputsOrBuilderList(); + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + org.bitcoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder( + int index); + + /** + *
+     * Timestamp; when payment request created
+     * 
+ * + * required uint64 time = 3; + */ + boolean hasTime(); + /** + *
+     * Timestamp; when payment request created
+     * 
+ * + * required uint64 time = 3; + */ + long getTime(); + + /** + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ * + * optional uint64 expires = 4; + */ + boolean hasExpires(); + /** + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ * + * optional uint64 expires = 4; + */ + long getExpires(); + + /** + *
+     * Human-readable description of request for the customer
+     * 
+ * + * optional string memo = 5; + */ + boolean hasMemo(); + /** + *
+     * Human-readable description of request for the customer
+     * 
+ * + * optional string memo = 5; + */ + java.lang.String getMemo(); + /** + *
+     * Human-readable description of request for the customer
+     * 
+ * + * optional string memo = 5; + */ + com.google.protobuf.ByteString + getMemoBytes(); + + /** + *
+     * URL to send Payment and get PaymentACK
+     * 
+ * + * optional string payment_url = 6; + */ + boolean hasPaymentUrl(); + /** + *
+     * URL to send Payment and get PaymentACK
+     * 
+ * + * optional string payment_url = 6; + */ + java.lang.String getPaymentUrl(); + /** + *
+     * URL to send Payment and get PaymentACK
+     * 
+ * + * optional string payment_url = 6; + */ + com.google.protobuf.ByteString + getPaymentUrlBytes(); + + /** + *
+     * Arbitrary data to include in the Payment message
+     * 
+ * + * optional bytes merchant_data = 7; + */ + boolean hasMerchantData(); + /** + *
+     * Arbitrary data to include in the Payment message
+     * 
+ * + * optional bytes merchant_data = 7; + */ + com.google.protobuf.ByteString getMerchantData(); + } + /** + * Protobuf type {@code payments.PaymentDetails} + */ + public static final class PaymentDetails extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:payments.PaymentDetails) + PaymentDetailsOrBuilder { + // Use PaymentDetails.newBuilder() to construct. + private PaymentDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PaymentDetails() { + network_ = "main"; + outputs_ = java.util.Collections.emptyList(); + time_ = 0L; + expires_ = 0L; + memo_ = ""; + paymentUrl_ = ""; + merchantData_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + network_ = bs; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + outputs_.add( + input.readMessage(org.bitcoin.protocols.payments.Protos.Output.PARSER, extensionRegistry)); + break; + } + case 24: { + bitField0_ |= 0x00000002; + time_ = input.readUInt64(); + break; + } + case 32: { + bitField0_ |= 0x00000004; + expires_ = input.readUInt64(); + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + memo_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + paymentUrl_ = bs; + break; + } + case 58: { + bitField0_ |= 0x00000020; + merchantData_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.PaymentDetails.class, org.bitcoin.protocols.payments.Protos.PaymentDetails.Builder.class); + } + + private int bitField0_; + public static final int NETWORK_FIELD_NUMBER = 1; + private volatile java.lang.Object network_; + /** + *
+     * "main" or "test"
+     * 
+ * + * optional string network = 1 [default = "main"]; + */ + public boolean hasNetwork() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * "main" or "test"
+     * 
+ * + * optional string network = 1 [default = "main"]; + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + network_ = s; + } + return s; + } + } + /** + *
+     * "main" or "test"
+     * 
+ * + * optional string network = 1 [default = "main"]; + */ + public com.google.protobuf.ByteString + getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUTS_FIELD_NUMBER = 2; + private java.util.List outputs_; + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + public java.util.List getOutputsList() { + return outputs_; + } + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + public int getOutputsCount() { + return outputs_.size(); + } + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.Output getOutputs(int index) { + return outputs_.get(index); + } + /** + *
+     * Where payment should be sent
+     * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder( + int index) { + return outputs_.get(index); + } + + public static final int TIME_FIELD_NUMBER = 3; + private long time_; + /** + *
+     * Timestamp; when payment request created
+     * 
+ * + * required uint64 time = 3; + */ + public boolean hasTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * Timestamp; when payment request created
+     * 
+ * + * required uint64 time = 3; + */ + public long getTime() { + return time_; + } + + public static final int EXPIRES_FIELD_NUMBER = 4; + private long expires_; + /** + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ * + * optional uint64 expires = 4; + */ + public boolean hasExpires() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ * + * optional uint64 expires = 4; + */ + public long getExpires() { + return expires_; + } + + public static final int MEMO_FIELD_NUMBER = 5; + private volatile java.lang.Object memo_; + /** + *
+     * Human-readable description of request for the customer
+     * 
+ * + * optional string memo = 5; + */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * Human-readable description of request for the customer
+     * 
+ * + * optional string memo = 5; + */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + memo_ = s; + } + return s; + } + } + /** + *
+     * Human-readable description of request for the customer
+     * 
+ * + * optional string memo = 5; + */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYMENT_URL_FIELD_NUMBER = 6; + private volatile java.lang.Object paymentUrl_; + /** + *
+     * URL to send Payment and get PaymentACK
+     * 
+ * + * optional string payment_url = 6; + */ + public boolean hasPaymentUrl() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * URL to send Payment and get PaymentACK
+     * 
+ * + * optional string payment_url = 6; + */ + public java.lang.String getPaymentUrl() { + java.lang.Object ref = paymentUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + paymentUrl_ = s; + } + return s; + } + } + /** + *
+     * URL to send Payment and get PaymentACK
+     * 
+ * + * optional string payment_url = 6; + */ + public com.google.protobuf.ByteString + getPaymentUrlBytes() { + java.lang.Object ref = paymentUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + paymentUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MERCHANT_DATA_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString merchantData_; + /** + *
+     * Arbitrary data to include in the Payment message
+     * 
+ * + * optional bytes merchant_data = 7; + */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     * Arbitrary data to include in the Payment message
+     * 
+ * + * optional bytes merchant_data = 7; + */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasTime()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getOutputsCount(); i++) { + if (!getOutputs(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(2, outputs_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt64(3, time_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(4, expires_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, memo_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, paymentUrl_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(7, merchantData_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, outputs_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, time_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, expires_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, memo_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, paymentUrl_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(7, merchantData_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.protocols.payments.Protos.PaymentDetails)) { + return super.equals(obj); + } + org.bitcoin.protocols.payments.Protos.PaymentDetails other = (org.bitcoin.protocols.payments.Protos.PaymentDetails) obj; + + boolean result = true; + result = result && (hasNetwork() == other.hasNetwork()); + if (hasNetwork()) { + result = result && getNetwork() + .equals(other.getNetwork()); + } + result = result && getOutputsList() + .equals(other.getOutputsList()); + result = result && (hasTime() == other.hasTime()); + if (hasTime()) { + result = result && (getTime() + == other.getTime()); + } + result = result && (hasExpires() == other.hasExpires()); + if (hasExpires()) { + result = result && (getExpires() + == other.getExpires()); + } + result = result && (hasMemo() == other.hasMemo()); + if (hasMemo()) { + result = result && getMemo() + .equals(other.getMemo()); + } + result = result && (hasPaymentUrl() == other.hasPaymentUrl()); + if (hasPaymentUrl()) { + result = result && getPaymentUrl() + .equals(other.getPaymentUrl()); + } + result = result && (hasMerchantData() == other.hasMerchantData()); + if (hasMerchantData()) { + result = result && getMerchantData() + .equals(other.getMerchantData()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasNetwork()) { + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + } + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + if (hasTime()) { + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + } + if (hasExpires()) { + hash = (37 * hash) + EXPIRES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExpires()); + } + if (hasMemo()) { + hash = (37 * hash) + MEMO_FIELD_NUMBER; + hash = (53 * hash) + getMemo().hashCode(); + } + if (hasPaymentUrl()) { + hash = (37 * hash) + PAYMENT_URL_FIELD_NUMBER; + hash = (53 * hash) + getPaymentUrl().hashCode(); + } + if (hasMerchantData()) { + hash = (37 * hash) + MERCHANT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getMerchantData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.PaymentDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.PaymentDetails} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:payments.PaymentDetails) + org.bitcoin.protocols.payments.Protos.PaymentDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.PaymentDetails.class, org.bitcoin.protocols.payments.Protos.PaymentDetails.Builder.class); + } + + // Construct using org.bitcoin.protocols.payments.Protos.PaymentDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOutputsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + network_ = "main"; + bitField0_ = (bitField0_ & ~0x00000001); + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + outputsBuilder_.clear(); + } + time_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + expires_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + memo_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + paymentUrl_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + merchantData_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_descriptor; + } + + public org.bitcoin.protocols.payments.Protos.PaymentDetails getDefaultInstanceForType() { + return org.bitcoin.protocols.payments.Protos.PaymentDetails.getDefaultInstance(); + } + + public org.bitcoin.protocols.payments.Protos.PaymentDetails build() { + org.bitcoin.protocols.payments.Protos.PaymentDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.protocols.payments.Protos.PaymentDetails buildPartial() { + org.bitcoin.protocols.payments.Protos.PaymentDetails result = new org.bitcoin.protocols.payments.Protos.PaymentDetails(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.network_ = network_; + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.time_ = time_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.expires_ = expires_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.memo_ = memo_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000010; + } + result.paymentUrl_ = paymentUrl_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.merchantData_ = merchantData_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.protocols.payments.Protos.PaymentDetails) { + return mergeFrom((org.bitcoin.protocols.payments.Protos.PaymentDetails)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.PaymentDetails other) { + if (other == org.bitcoin.protocols.payments.Protos.PaymentDetails.getDefaultInstance()) return this; + if (other.hasNetwork()) { + bitField0_ |= 0x00000001; + network_ = other.network_; + onChanged(); + } + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + outputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOutputsFieldBuilder() : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + if (other.hasTime()) { + setTime(other.getTime()); + } + if (other.hasExpires()) { + setExpires(other.getExpires()); + } + if (other.hasMemo()) { + bitField0_ |= 0x00000010; + memo_ = other.memo_; + onChanged(); + } + if (other.hasPaymentUrl()) { + bitField0_ |= 0x00000020; + paymentUrl_ = other.paymentUrl_; + onChanged(); + } + if (other.hasMerchantData()) { + setMerchantData(other.getMerchantData()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasTime()) { + return false; + } + for (int i = 0; i < getOutputsCount(); i++) { + if (!getOutputs(i).isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.protocols.payments.Protos.PaymentDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.protocols.payments.Protos.PaymentDetails) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object network_ = "main"; + /** + *
+       * "main" or "test"
+       * 
+ * + * optional string network = 1 [default = "main"]; + */ + public boolean hasNetwork() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * "main" or "test"
+       * 
+ * + * optional string network = 1 [default = "main"]; + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + network_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * "main" or "test"
+       * 
+ * + * optional string network = 1 [default = "main"]; + */ + public com.google.protobuf.ByteString + getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * "main" or "test"
+       * 
+ * + * optional string network = 1 [default = "main"]; + */ + public Builder setNetwork( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + network_ = value; + onChanged(); + return this; + } + /** + *
+       * "main" or "test"
+       * 
+ * + * optional string network = 1 [default = "main"]; + */ + public Builder clearNetwork() { + bitField0_ = (bitField0_ & ~0x00000001); + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + *
+       * "main" or "test"
+       * 
+ * + * optional string network = 1 [default = "main"]; + */ + public Builder setNetworkBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + network_ = value; + onChanged(); + return this; + } + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Output, org.bitcoin.protocols.payments.Protos.Output.Builder, org.bitcoin.protocols.payments.Protos.OutputOrBuilder> outputsBuilder_; + + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.Output getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder setOutputs( + int index, org.bitcoin.protocols.payments.Protos.Output value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder setOutputs( + int index, org.bitcoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder addOutputs(org.bitcoin.protocols.payments.Protos.Output value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder addOutputs( + int index, org.bitcoin.protocols.payments.Protos.Output value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder addOutputs( + org.bitcoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder addOutputs( + int index, org.bitcoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.Output.Builder getOutputsBuilder( + int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder( + int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.Output.Builder addOutputsBuilder() { + return getOutputsFieldBuilder().addBuilder( + org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public org.bitcoin.protocols.payments.Protos.Output.Builder addOutputsBuilder( + int index) { + return getOutputsFieldBuilder().addBuilder( + index, org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + *
+       * Where payment should be sent
+       * 
+ * + * repeated .payments.Output outputs = 2; + */ + public java.util.List + getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Output, org.bitcoin.protocols.payments.Protos.Output.Builder, org.bitcoin.protocols.payments.Protos.OutputOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Output, org.bitcoin.protocols.payments.Protos.Output.Builder, org.bitcoin.protocols.payments.Protos.OutputOrBuilder>( + outputs_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + + private long time_ ; + /** + *
+       * Timestamp; when payment request created
+       * 
+ * + * required uint64 time = 3; + */ + public boolean hasTime() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * Timestamp; when payment request created
+       * 
+ * + * required uint64 time = 3; + */ + public long getTime() { + return time_; + } + /** + *
+       * Timestamp; when payment request created
+       * 
+ * + * required uint64 time = 3; + */ + public Builder setTime(long value) { + bitField0_ |= 0x00000004; + time_ = value; + onChanged(); + return this; + } + /** + *
+       * Timestamp; when payment request created
+       * 
+ * + * required uint64 time = 3; + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000004); + time_ = 0L; + onChanged(); + return this; + } + + private long expires_ ; + /** + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ * + * optional uint64 expires = 4; + */ + public boolean hasExpires() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ * + * optional uint64 expires = 4; + */ + public long getExpires() { + return expires_; + } + /** + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ * + * optional uint64 expires = 4; + */ + public Builder setExpires(long value) { + bitField0_ |= 0x00000008; + expires_ = value; + onChanged(); + return this; + } + /** + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ * + * optional uint64 expires = 4; + */ + public Builder clearExpires() { + bitField0_ = (bitField0_ & ~0x00000008); + expires_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object memo_ = ""; + /** + *
+       * Human-readable description of request for the customer
+       * 
+ * + * optional string memo = 5; + */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       * Human-readable description of request for the customer
+       * 
+ * + * optional string memo = 5; + */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + memo_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Human-readable description of request for the customer
+       * 
+ * + * optional string memo = 5; + */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Human-readable description of request for the customer
+       * 
+ * + * optional string memo = 5; + */ + public Builder setMemo( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + memo_ = value; + onChanged(); + return this; + } + /** + *
+       * Human-readable description of request for the customer
+       * 
+ * + * optional string memo = 5; + */ + public Builder clearMemo() { + bitField0_ = (bitField0_ & ~0x00000010); + memo_ = getDefaultInstance().getMemo(); + onChanged(); + return this; + } + /** + *
+       * Human-readable description of request for the customer
+       * 
+ * + * optional string memo = 5; + */ + public Builder setMemoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + memo_ = value; + onChanged(); + return this; + } + + private java.lang.Object paymentUrl_ = ""; + /** + *
+       * URL to send Payment and get PaymentACK
+       * 
+ * + * optional string payment_url = 6; + */ + public boolean hasPaymentUrl() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+       * URL to send Payment and get PaymentACK
+       * 
+ * + * optional string payment_url = 6; + */ + public java.lang.String getPaymentUrl() { + java.lang.Object ref = paymentUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + paymentUrl_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * URL to send Payment and get PaymentACK
+       * 
+ * + * optional string payment_url = 6; + */ + public com.google.protobuf.ByteString + getPaymentUrlBytes() { + java.lang.Object ref = paymentUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + paymentUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * URL to send Payment and get PaymentACK
+       * 
+ * + * optional string payment_url = 6; + */ + public Builder setPaymentUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + paymentUrl_ = value; + onChanged(); + return this; + } + /** + *
+       * URL to send Payment and get PaymentACK
+       * 
+ * + * optional string payment_url = 6; + */ + public Builder clearPaymentUrl() { + bitField0_ = (bitField0_ & ~0x00000020); + paymentUrl_ = getDefaultInstance().getPaymentUrl(); + onChanged(); + return this; + } + /** + *
+       * URL to send Payment and get PaymentACK
+       * 
+ * + * optional string payment_url = 6; + */ + public Builder setPaymentUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + paymentUrl_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString merchantData_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Arbitrary data to include in the Payment message
+       * 
+ * + * optional bytes merchant_data = 7; + */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+       * Arbitrary data to include in the Payment message
+       * 
+ * + * optional bytes merchant_data = 7; + */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + /** + *
+       * Arbitrary data to include in the Payment message
+       * 
+ * + * optional bytes merchant_data = 7; + */ + public Builder setMerchantData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + merchantData_ = value; + onChanged(); + return this; + } + /** + *
+       * Arbitrary data to include in the Payment message
+       * 
+ * + * optional bytes merchant_data = 7; + */ + public Builder clearMerchantData() { + bitField0_ = (bitField0_ & ~0x00000040); + merchantData_ = getDefaultInstance().getMerchantData(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:payments.PaymentDetails) + } + + // @@protoc_insertion_point(class_scope:payments.PaymentDetails) + private static final org.bitcoin.protocols.payments.Protos.PaymentDetails DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.PaymentDetails(); + } + + public static org.bitcoin.protocols.payments.Protos.PaymentDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PaymentDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentDetails(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.protocols.payments.Protos.PaymentDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PaymentRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.PaymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + boolean hasPaymentDetailsVersion(); + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + int getPaymentDetailsVersion(); + + /** + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + boolean hasPkiType(); + /** + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + java.lang.String getPkiType(); + /** + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + com.google.protobuf.ByteString + getPkiTypeBytes(); + + /** + *
+     * depends on pki_type
+     * 
+ * + * optional bytes pki_data = 3; + */ + boolean hasPkiData(); + /** + *
+     * depends on pki_type
+     * 
+ * + * optional bytes pki_data = 3; + */ + com.google.protobuf.ByteString getPkiData(); + + /** + *
+     * PaymentDetails
+     * 
+ * + * required bytes serialized_payment_details = 4; + */ + boolean hasSerializedPaymentDetails(); + /** + *
+     * PaymentDetails
+     * 
+ * + * required bytes serialized_payment_details = 4; + */ + com.google.protobuf.ByteString getSerializedPaymentDetails(); + + /** + *
+     * pki-dependent signature
+     * 
+ * + * optional bytes signature = 5; + */ + boolean hasSignature(); + /** + *
+     * pki-dependent signature
+     * 
+ * + * optional bytes signature = 5; + */ + com.google.protobuf.ByteString getSignature(); + } + /** + * Protobuf type {@code payments.PaymentRequest} + */ + public static final class PaymentRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:payments.PaymentRequest) + PaymentRequestOrBuilder { + // Use PaymentRequest.newBuilder() to construct. + private PaymentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PaymentRequest() { + paymentDetailsVersion_ = 1; + pkiType_ = "none"; + pkiData_ = com.google.protobuf.ByteString.EMPTY; + serializedPaymentDetails_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + paymentDetailsVersion_ = input.readUInt32(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + pkiType_ = bs; + break; + } + case 26: { + bitField0_ |= 0x00000004; + pkiData_ = input.readBytes(); + break; + } + case 34: { + bitField0_ |= 0x00000008; + serializedPaymentDetails_ = input.readBytes(); + break; + } + case 42: { + bitField0_ |= 0x00000010; + signature_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.PaymentRequest.class, org.bitcoin.protocols.payments.Protos.PaymentRequest.Builder.class); + } + + private int bitField0_; + public static final int PAYMENT_DETAILS_VERSION_FIELD_NUMBER = 1; + private int paymentDetailsVersion_; + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public boolean hasPaymentDetailsVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public int getPaymentDetailsVersion() { + return paymentDetailsVersion_; + } + + public static final int PKI_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object pkiType_; + /** + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public boolean hasPkiType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public java.lang.String getPkiType() { + java.lang.Object ref = pkiType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + pkiType_ = s; + } + return s; + } + } + /** + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public com.google.protobuf.ByteString + getPkiTypeBytes() { + java.lang.Object ref = pkiType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pkiType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PKI_DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString pkiData_; + /** + *
+     * depends on pki_type
+     * 
+ * + * optional bytes pki_data = 3; + */ + public boolean hasPkiData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * depends on pki_type
+     * 
+ * + * optional bytes pki_data = 3; + */ + public com.google.protobuf.ByteString getPkiData() { + return pkiData_; + } + + public static final int SERIALIZED_PAYMENT_DETAILS_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString serializedPaymentDetails_; + /** + *
+     * PaymentDetails
+     * 
+ * + * required bytes serialized_payment_details = 4; + */ + public boolean hasSerializedPaymentDetails() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * PaymentDetails
+     * 
+ * + * required bytes serialized_payment_details = 4; + */ + public com.google.protobuf.ByteString getSerializedPaymentDetails() { + return serializedPaymentDetails_; + } + + public static final int SIGNATURE_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString signature_; + /** + *
+     * pki-dependent signature
+     * 
+ * + * optional bytes signature = 5; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * pki-dependent signature
+     * 
+ * + * optional bytes signature = 5; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasSerializedPaymentDetails()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt32(1, paymentDetailsVersion_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pkiType_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, pkiData_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, serializedPaymentDetails_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, signature_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, paymentDetailsVersion_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pkiType_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, pkiData_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, serializedPaymentDetails_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, signature_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.protocols.payments.Protos.PaymentRequest)) { + return super.equals(obj); + } + org.bitcoin.protocols.payments.Protos.PaymentRequest other = (org.bitcoin.protocols.payments.Protos.PaymentRequest) obj; + + boolean result = true; + result = result && (hasPaymentDetailsVersion() == other.hasPaymentDetailsVersion()); + if (hasPaymentDetailsVersion()) { + result = result && (getPaymentDetailsVersion() + == other.getPaymentDetailsVersion()); + } + result = result && (hasPkiType() == other.hasPkiType()); + if (hasPkiType()) { + result = result && getPkiType() + .equals(other.getPkiType()); + } + result = result && (hasPkiData() == other.hasPkiData()); + if (hasPkiData()) { + result = result && getPkiData() + .equals(other.getPkiData()); + } + result = result && (hasSerializedPaymentDetails() == other.hasSerializedPaymentDetails()); + if (hasSerializedPaymentDetails()) { + result = result && getSerializedPaymentDetails() + .equals(other.getSerializedPaymentDetails()); + } + result = result && (hasSignature() == other.hasSignature()); + if (hasSignature()) { + result = result && getSignature() + .equals(other.getSignature()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasPaymentDetailsVersion()) { + hash = (37 * hash) + PAYMENT_DETAILS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getPaymentDetailsVersion(); + } + if (hasPkiType()) { + hash = (37 * hash) + PKI_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getPkiType().hashCode(); + } + if (hasPkiData()) { + hash = (37 * hash) + PKI_DATA_FIELD_NUMBER; + hash = (53 * hash) + getPkiData().hashCode(); + } + if (hasSerializedPaymentDetails()) { + hash = (37 * hash) + SERIALIZED_PAYMENT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getSerializedPaymentDetails().hashCode(); + } + if (hasSignature()) { + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.PaymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.PaymentRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:payments.PaymentRequest) + org.bitcoin.protocols.payments.Protos.PaymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.PaymentRequest.class, org.bitcoin.protocols.payments.Protos.PaymentRequest.Builder.class); + } + + // Construct using org.bitcoin.protocols.payments.Protos.PaymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + paymentDetailsVersion_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + pkiType_ = "none"; + bitField0_ = (bitField0_ & ~0x00000002); + pkiData_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + serializedPaymentDetails_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + signature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_descriptor; + } + + public org.bitcoin.protocols.payments.Protos.PaymentRequest getDefaultInstanceForType() { + return org.bitcoin.protocols.payments.Protos.PaymentRequest.getDefaultInstance(); + } + + public org.bitcoin.protocols.payments.Protos.PaymentRequest build() { + org.bitcoin.protocols.payments.Protos.PaymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.protocols.payments.Protos.PaymentRequest buildPartial() { + org.bitcoin.protocols.payments.Protos.PaymentRequest result = new org.bitcoin.protocols.payments.Protos.PaymentRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.paymentDetailsVersion_ = paymentDetailsVersion_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.pkiType_ = pkiType_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.pkiData_ = pkiData_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.serializedPaymentDetails_ = serializedPaymentDetails_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.signature_ = signature_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.protocols.payments.Protos.PaymentRequest) { + return mergeFrom((org.bitcoin.protocols.payments.Protos.PaymentRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.PaymentRequest other) { + if (other == org.bitcoin.protocols.payments.Protos.PaymentRequest.getDefaultInstance()) return this; + if (other.hasPaymentDetailsVersion()) { + setPaymentDetailsVersion(other.getPaymentDetailsVersion()); + } + if (other.hasPkiType()) { + bitField0_ |= 0x00000002; + pkiType_ = other.pkiType_; + onChanged(); + } + if (other.hasPkiData()) { + setPkiData(other.getPkiData()); + } + if (other.hasSerializedPaymentDetails()) { + setSerializedPaymentDetails(other.getSerializedPaymentDetails()); + } + if (other.hasSignature()) { + setSignature(other.getSignature()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasSerializedPaymentDetails()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.protocols.payments.Protos.PaymentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.protocols.payments.Protos.PaymentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int paymentDetailsVersion_ = 1; + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public boolean hasPaymentDetailsVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public int getPaymentDetailsVersion() { + return paymentDetailsVersion_; + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public Builder setPaymentDetailsVersion(int value) { + bitField0_ |= 0x00000001; + paymentDetailsVersion_ = value; + onChanged(); + return this; + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public Builder clearPaymentDetailsVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + paymentDetailsVersion_ = 1; + onChanged(); + return this; + } + + private java.lang.Object pkiType_ = "none"; + /** + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public boolean hasPkiType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public java.lang.String getPkiType() { + java.lang.Object ref = pkiType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + pkiType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public com.google.protobuf.ByteString + getPkiTypeBytes() { + java.lang.Object ref = pkiType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pkiType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public Builder setPkiType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + pkiType_ = value; + onChanged(); + return this; + } + /** + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public Builder clearPkiType() { + bitField0_ = (bitField0_ & ~0x00000002); + pkiType_ = getDefaultInstance().getPkiType(); + onChanged(); + return this; + } + /** + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ * + * optional string pki_type = 2 [default = "none"]; + */ + public Builder setPkiTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + pkiType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString pkiData_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * depends on pki_type
+       * 
+ * + * optional bytes pki_data = 3; + */ + public boolean hasPkiData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * depends on pki_type
+       * 
+ * + * optional bytes pki_data = 3; + */ + public com.google.protobuf.ByteString getPkiData() { + return pkiData_; + } + /** + *
+       * depends on pki_type
+       * 
+ * + * optional bytes pki_data = 3; + */ + public Builder setPkiData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + pkiData_ = value; + onChanged(); + return this; + } + /** + *
+       * depends on pki_type
+       * 
+ * + * optional bytes pki_data = 3; + */ + public Builder clearPkiData() { + bitField0_ = (bitField0_ & ~0x00000004); + pkiData_ = getDefaultInstance().getPkiData(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serializedPaymentDetails_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * PaymentDetails
+       * 
+ * + * required bytes serialized_payment_details = 4; + */ + public boolean hasSerializedPaymentDetails() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * PaymentDetails
+       * 
+ * + * required bytes serialized_payment_details = 4; + */ + public com.google.protobuf.ByteString getSerializedPaymentDetails() { + return serializedPaymentDetails_; + } + /** + *
+       * PaymentDetails
+       * 
+ * + * required bytes serialized_payment_details = 4; + */ + public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + serializedPaymentDetails_ = value; + onChanged(); + return this; + } + /** + *
+       * PaymentDetails
+       * 
+ * + * required bytes serialized_payment_details = 4; + */ + public Builder clearSerializedPaymentDetails() { + bitField0_ = (bitField0_ & ~0x00000008); + serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * pki-dependent signature
+       * 
+ * + * optional bytes signature = 5; + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       * pki-dependent signature
+       * 
+ * + * optional bytes signature = 5; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + *
+       * pki-dependent signature
+       * 
+ * + * optional bytes signature = 5; + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + signature_ = value; + onChanged(); + return this; + } + /** + *
+       * pki-dependent signature
+       * 
+ * + * optional bytes signature = 5; + */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000010); + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:payments.PaymentRequest) + } + + // @@protoc_insertion_point(class_scope:payments.PaymentRequest) + private static final org.bitcoin.protocols.payments.Protos.PaymentRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.PaymentRequest(); + } + + public static org.bitcoin.protocols.payments.Protos.PaymentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PaymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.protocols.payments.Protos.PaymentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface X509CertificatesOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.X509Certificates) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * DER-encoded X.509 certificate chain
+     * 
+ * + * repeated bytes certificate = 1; + */ + java.util.List getCertificateList(); + /** + *
+     * DER-encoded X.509 certificate chain
+     * 
+ * + * repeated bytes certificate = 1; + */ + int getCertificateCount(); + /** + *
+     * DER-encoded X.509 certificate chain
+     * 
+ * + * repeated bytes certificate = 1; + */ + com.google.protobuf.ByteString getCertificate(int index); + } + /** + * Protobuf type {@code payments.X509Certificates} + */ + public static final class X509Certificates extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:payments.X509Certificates) + X509CertificatesOrBuilder { + // Use X509Certificates.newBuilder() to construct. + private X509Certificates(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private X509Certificates() { + certificate_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private X509Certificates( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + certificate_.add(input.readBytes()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = java.util.Collections.unmodifiableList(certificate_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_X509Certificates_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_X509Certificates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.X509Certificates.class, org.bitcoin.protocols.payments.Protos.X509Certificates.Builder.class); + } + + public static final int CERTIFICATE_FIELD_NUMBER = 1; + private java.util.List certificate_; + /** + *
+     * DER-encoded X.509 certificate chain
+     * 
+ * + * repeated bytes certificate = 1; + */ + public java.util.List + getCertificateList() { + return certificate_; + } + /** + *
+     * DER-encoded X.509 certificate chain
+     * 
+ * + * repeated bytes certificate = 1; + */ + public int getCertificateCount() { + return certificate_.size(); + } + /** + *
+     * DER-encoded X.509 certificate chain
+     * 
+ * + * repeated bytes certificate = 1; + */ + public com.google.protobuf.ByteString getCertificate(int index) { + return certificate_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < certificate_.size(); i++) { + output.writeBytes(1, certificate_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < certificate_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(certificate_.get(i)); + } + size += dataSize; + size += 1 * getCertificateList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.protocols.payments.Protos.X509Certificates)) { + return super.equals(obj); + } + org.bitcoin.protocols.payments.Protos.X509Certificates other = (org.bitcoin.protocols.payments.Protos.X509Certificates) obj; + + boolean result = true; + result = result && getCertificateList() + .equals(other.getCertificateList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getCertificateCount() > 0) { + hash = (37 * hash) + CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCertificateList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.X509Certificates prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.X509Certificates} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:payments.X509Certificates) + org.bitcoin.protocols.payments.Protos.X509CertificatesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_X509Certificates_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_X509Certificates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.X509Certificates.class, org.bitcoin.protocols.payments.Protos.X509Certificates.Builder.class); + } + + // Construct using org.bitcoin.protocols.payments.Protos.X509Certificates.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + certificate_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_X509Certificates_descriptor; + } + + public org.bitcoin.protocols.payments.Protos.X509Certificates getDefaultInstanceForType() { + return org.bitcoin.protocols.payments.Protos.X509Certificates.getDefaultInstance(); + } + + public org.bitcoin.protocols.payments.Protos.X509Certificates build() { + org.bitcoin.protocols.payments.Protos.X509Certificates result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.protocols.payments.Protos.X509Certificates buildPartial() { + org.bitcoin.protocols.payments.Protos.X509Certificates result = new org.bitcoin.protocols.payments.Protos.X509Certificates(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = java.util.Collections.unmodifiableList(certificate_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.certificate_ = certificate_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.protocols.payments.Protos.X509Certificates) { + return mergeFrom((org.bitcoin.protocols.payments.Protos.X509Certificates)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.X509Certificates other) { + if (other == org.bitcoin.protocols.payments.Protos.X509Certificates.getDefaultInstance()) return this; + if (!other.certificate_.isEmpty()) { + if (certificate_.isEmpty()) { + certificate_ = other.certificate_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCertificateIsMutable(); + certificate_.addAll(other.certificate_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.protocols.payments.Protos.X509Certificates parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.protocols.payments.Protos.X509Certificates) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List certificate_ = java.util.Collections.emptyList(); + private void ensureCertificateIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = new java.util.ArrayList(certificate_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public java.util.List + getCertificateList() { + return java.util.Collections.unmodifiableList(certificate_); + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public int getCertificateCount() { + return certificate_.size(); + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public com.google.protobuf.ByteString getCertificate(int index) { + return certificate_.get(index); + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public Builder setCertificate( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificateIsMutable(); + certificate_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public Builder addCertificate(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificateIsMutable(); + certificate_.add(value); + onChanged(); + return this; + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public Builder addAllCertificate( + java.lang.Iterable values) { + ensureCertificateIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, certificate_); + onChanged(); + return this; + } + /** + *
+       * DER-encoded X.509 certificate chain
+       * 
+ * + * repeated bytes certificate = 1; + */ + public Builder clearCertificate() { + certificate_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:payments.X509Certificates) + } + + // @@protoc_insertion_point(class_scope:payments.X509Certificates) + private static final org.bitcoin.protocols.payments.Protos.X509Certificates DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.X509Certificates(); + } + + public static org.bitcoin.protocols.payments.Protos.X509Certificates getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public X509Certificates parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new X509Certificates(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.protocols.payments.Protos.X509Certificates getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PaymentOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.Payment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * From PaymentDetails.merchant_data
+     * 
+ * + * optional bytes merchant_data = 1; + */ + boolean hasMerchantData(); + /** + *
+     * From PaymentDetails.merchant_data
+     * 
+ * + * optional bytes merchant_data = 1; + */ + com.google.protobuf.ByteString getMerchantData(); + + /** + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ * + * repeated bytes transactions = 2; + */ + java.util.List getTransactionsList(); + /** + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ * + * repeated bytes transactions = 2; + */ + int getTransactionsCount(); + /** + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ * + * repeated bytes transactions = 2; + */ + com.google.protobuf.ByteString getTransactions(int index); + + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + java.util.List + getRefundToList(); + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + org.bitcoin.protocols.payments.Protos.Output getRefundTo(int index); + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + int getRefundToCount(); + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + java.util.List + getRefundToOrBuilderList(); + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + org.bitcoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( + int index); + + /** + *
+     * Human-readable message for the merchant
+     * 
+ * + * optional string memo = 4; + */ + boolean hasMemo(); + /** + *
+     * Human-readable message for the merchant
+     * 
+ * + * optional string memo = 4; + */ + java.lang.String getMemo(); + /** + *
+     * Human-readable message for the merchant
+     * 
+ * + * optional string memo = 4; + */ + com.google.protobuf.ByteString + getMemoBytes(); + } + /** + * Protobuf type {@code payments.Payment} + */ + public static final class Payment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:payments.Payment) + PaymentOrBuilder { + // Use Payment.newBuilder() to construct. + private Payment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Payment() { + merchantData_ = com.google.protobuf.ByteString.EMPTY; + transactions_ = java.util.Collections.emptyList(); + refundTo_ = java.util.Collections.emptyList(); + memo_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Payment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + merchantData_ = input.readBytes(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + transactions_.add(input.readBytes()); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + refundTo_.add( + input.readMessage(org.bitcoin.protocols.payments.Protos.Output.PARSER, extensionRegistry)); + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + memo_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = java.util.Collections.unmodifiableList(transactions_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = java.util.Collections.unmodifiableList(refundTo_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Payment_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Payment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.Payment.class, org.bitcoin.protocols.payments.Protos.Payment.Builder.class); + } + + private int bitField0_; + public static final int MERCHANT_DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString merchantData_; + /** + *
+     * From PaymentDetails.merchant_data
+     * 
+ * + * optional bytes merchant_data = 1; + */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * From PaymentDetails.merchant_data
+     * 
+ * + * optional bytes merchant_data = 1; + */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + + public static final int TRANSACTIONS_FIELD_NUMBER = 2; + private java.util.List transactions_; + /** + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ * + * repeated bytes transactions = 2; + */ + public java.util.List + getTransactionsList() { + return transactions_; + } + /** + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ * + * repeated bytes transactions = 2; + */ + public int getTransactionsCount() { + return transactions_.size(); + } + /** + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ * + * repeated bytes transactions = 2; + */ + public com.google.protobuf.ByteString getTransactions(int index) { + return transactions_.get(index); + } + + public static final int REFUND_TO_FIELD_NUMBER = 3; + private java.util.List refundTo_; + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public java.util.List getRefundToList() { + return refundTo_; + } + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public java.util.List + getRefundToOrBuilderList() { + return refundTo_; + } + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public int getRefundToCount() { + return refundTo_.size(); + } + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.Output getRefundTo(int index) { + return refundTo_.get(index); + } + /** + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( + int index) { + return refundTo_.get(index); + } + + public static final int MEMO_FIELD_NUMBER = 4; + private volatile java.lang.Object memo_; + /** + *
+     * Human-readable message for the merchant
+     * 
+ * + * optional string memo = 4; + */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * Human-readable message for the merchant
+     * 
+ * + * optional string memo = 4; + */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + memo_ = s; + } + return s; + } + } + /** + *
+     * Human-readable message for the merchant
+     * 
+ * + * optional string memo = 4; + */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getRefundToCount(); i++) { + if (!getRefundTo(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, merchantData_); + } + for (int i = 0; i < transactions_.size(); i++) { + output.writeBytes(2, transactions_.get(i)); + } + for (int i = 0; i < refundTo_.size(); i++) { + output.writeMessage(3, refundTo_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, memo_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, merchantData_); + } + { + int dataSize = 0; + for (int i = 0; i < transactions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(transactions_.get(i)); + } + size += dataSize; + size += 1 * getTransactionsList().size(); + } + for (int i = 0; i < refundTo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, refundTo_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, memo_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.protocols.payments.Protos.Payment)) { + return super.equals(obj); + } + org.bitcoin.protocols.payments.Protos.Payment other = (org.bitcoin.protocols.payments.Protos.Payment) obj; + + boolean result = true; + result = result && (hasMerchantData() == other.hasMerchantData()); + if (hasMerchantData()) { + result = result && getMerchantData() + .equals(other.getMerchantData()); + } + result = result && getTransactionsList() + .equals(other.getTransactionsList()); + result = result && getRefundToList() + .equals(other.getRefundToList()); + result = result && (hasMemo() == other.hasMemo()); + if (hasMemo()) { + result = result && getMemo() + .equals(other.getMemo()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasMerchantData()) { + hash = (37 * hash) + MERCHANT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getMerchantData().hashCode(); + } + if (getTransactionsCount() > 0) { + hash = (37 * hash) + TRANSACTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionsList().hashCode(); + } + if (getRefundToCount() > 0) { + hash = (37 * hash) + REFUND_TO_FIELD_NUMBER; + hash = (53 * hash) + getRefundToList().hashCode(); + } + if (hasMemo()) { + hash = (37 * hash) + MEMO_FIELD_NUMBER; + hash = (53 * hash) + getMemo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.Payment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.Payment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:payments.Payment) + org.bitcoin.protocols.payments.Protos.PaymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Payment_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Payment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.Payment.class, org.bitcoin.protocols.payments.Protos.Payment.Builder.class); + } + + // Construct using org.bitcoin.protocols.payments.Protos.Payment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRefundToFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + merchantData_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + transactions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + if (refundToBuilder_ == null) { + refundTo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + refundToBuilder_.clear(); + } + memo_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_Payment_descriptor; + } + + public org.bitcoin.protocols.payments.Protos.Payment getDefaultInstanceForType() { + return org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance(); + } + + public org.bitcoin.protocols.payments.Protos.Payment build() { + org.bitcoin.protocols.payments.Protos.Payment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.protocols.payments.Protos.Payment buildPartial() { + org.bitcoin.protocols.payments.Protos.Payment result = new org.bitcoin.protocols.payments.Protos.Payment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.merchantData_ = merchantData_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = java.util.Collections.unmodifiableList(transactions_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.transactions_ = transactions_; + if (refundToBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = java.util.Collections.unmodifiableList(refundTo_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.refundTo_ = refundTo_; + } else { + result.refundTo_ = refundToBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000002; + } + result.memo_ = memo_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.protocols.payments.Protos.Payment) { + return mergeFrom((org.bitcoin.protocols.payments.Protos.Payment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Payment other) { + if (other == org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; + if (other.hasMerchantData()) { + setMerchantData(other.getMerchantData()); + } + if (!other.transactions_.isEmpty()) { + if (transactions_.isEmpty()) { + transactions_ = other.transactions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTransactionsIsMutable(); + transactions_.addAll(other.transactions_); + } + onChanged(); + } + if (refundToBuilder_ == null) { + if (!other.refundTo_.isEmpty()) { + if (refundTo_.isEmpty()) { + refundTo_ = other.refundTo_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRefundToIsMutable(); + refundTo_.addAll(other.refundTo_); + } + onChanged(); + } + } else { + if (!other.refundTo_.isEmpty()) { + if (refundToBuilder_.isEmpty()) { + refundToBuilder_.dispose(); + refundToBuilder_ = null; + refundTo_ = other.refundTo_; + bitField0_ = (bitField0_ & ~0x00000004); + refundToBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRefundToFieldBuilder() : null; + } else { + refundToBuilder_.addAllMessages(other.refundTo_); + } + } + } + if (other.hasMemo()) { + bitField0_ |= 0x00000008; + memo_ = other.memo_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getRefundToCount(); i++) { + if (!getRefundTo(i).isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.protocols.payments.Protos.Payment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.protocols.payments.Protos.Payment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString merchantData_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * From PaymentDetails.merchant_data
+       * 
+ * + * optional bytes merchant_data = 1; + */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * From PaymentDetails.merchant_data
+       * 
+ * + * optional bytes merchant_data = 1; + */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + /** + *
+       * From PaymentDetails.merchant_data
+       * 
+ * + * optional bytes merchant_data = 1; + */ + public Builder setMerchantData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + merchantData_ = value; + onChanged(); + return this; + } + /** + *
+       * From PaymentDetails.merchant_data
+       * 
+ * + * optional bytes merchant_data = 1; + */ + public Builder clearMerchantData() { + bitField0_ = (bitField0_ & ~0x00000001); + merchantData_ = getDefaultInstance().getMerchantData(); + onChanged(); + return this; + } + + private java.util.List transactions_ = java.util.Collections.emptyList(); + private void ensureTransactionsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = new java.util.ArrayList(transactions_); + bitField0_ |= 0x00000002; + } + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public java.util.List + getTransactionsList() { + return java.util.Collections.unmodifiableList(transactions_); + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public int getTransactionsCount() { + return transactions_.size(); + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public com.google.protobuf.ByteString getTransactions(int index) { + return transactions_.get(index); + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public Builder setTransactions( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public Builder addTransactions(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.add(value); + onChanged(); + return this; + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public Builder addAllTransactions( + java.lang.Iterable values) { + ensureTransactionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, transactions_); + onChanged(); + return this; + } + /** + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ * + * repeated bytes transactions = 2; + */ + public Builder clearTransactions() { + transactions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private java.util.List refundTo_ = + java.util.Collections.emptyList(); + private void ensureRefundToIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = new java.util.ArrayList(refundTo_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Output, org.bitcoin.protocols.payments.Protos.Output.Builder, org.bitcoin.protocols.payments.Protos.OutputOrBuilder> refundToBuilder_; + + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public java.util.List getRefundToList() { + if (refundToBuilder_ == null) { + return java.util.Collections.unmodifiableList(refundTo_); + } else { + return refundToBuilder_.getMessageList(); + } + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public int getRefundToCount() { + if (refundToBuilder_ == null) { + return refundTo_.size(); + } else { + return refundToBuilder_.getCount(); + } + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.Output getRefundTo(int index) { + if (refundToBuilder_ == null) { + return refundTo_.get(index); + } else { + return refundToBuilder_.getMessage(index); + } + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder setRefundTo( + int index, org.bitcoin.protocols.payments.Protos.Output value) { + if (refundToBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefundToIsMutable(); + refundTo_.set(index, value); + onChanged(); + } else { + refundToBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder setRefundTo( + int index, org.bitcoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.set(index, builderForValue.build()); + onChanged(); + } else { + refundToBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder addRefundTo(org.bitcoin.protocols.payments.Protos.Output value) { + if (refundToBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefundToIsMutable(); + refundTo_.add(value); + onChanged(); + } else { + refundToBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder addRefundTo( + int index, org.bitcoin.protocols.payments.Protos.Output value) { + if (refundToBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefundToIsMutable(); + refundTo_.add(index, value); + onChanged(); + } else { + refundToBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder addRefundTo( + org.bitcoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.add(builderForValue.build()); + onChanged(); + } else { + refundToBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder addRefundTo( + int index, org.bitcoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.add(index, builderForValue.build()); + onChanged(); + } else { + refundToBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder addAllRefundTo( + java.lang.Iterable values) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, refundTo_); + onChanged(); + } else { + refundToBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder clearRefundTo() { + if (refundToBuilder_ == null) { + refundTo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + refundToBuilder_.clear(); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public Builder removeRefundTo(int index) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.remove(index); + onChanged(); + } else { + refundToBuilder_.remove(index); + } + return this; + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.Output.Builder getRefundToBuilder( + int index) { + return getRefundToFieldBuilder().getBuilder(index); + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( + int index) { + if (refundToBuilder_ == null) { + return refundTo_.get(index); } else { + return refundToBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public java.util.List + getRefundToOrBuilderList() { + if (refundToBuilder_ != null) { + return refundToBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(refundTo_); + } + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.Output.Builder addRefundToBuilder() { + return getRefundToFieldBuilder().addBuilder( + org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public org.bitcoin.protocols.payments.Protos.Output.Builder addRefundToBuilder( + int index) { + return getRefundToFieldBuilder().addBuilder( + index, org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ * + * repeated .payments.Output refund_to = 3; + */ + public java.util.List + getRefundToBuilderList() { + return getRefundToFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Output, org.bitcoin.protocols.payments.Protos.Output.Builder, org.bitcoin.protocols.payments.Protos.OutputOrBuilder> + getRefundToFieldBuilder() { + if (refundToBuilder_ == null) { + refundToBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Output, org.bitcoin.protocols.payments.Protos.Output.Builder, org.bitcoin.protocols.payments.Protos.OutputOrBuilder>( + refundTo_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + refundTo_ = null; + } + return refundToBuilder_; + } + + private java.lang.Object memo_ = ""; + /** + *
+       * Human-readable message for the merchant
+       * 
+ * + * optional string memo = 4; + */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * Human-readable message for the merchant
+       * 
+ * + * optional string memo = 4; + */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + memo_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Human-readable message for the merchant
+       * 
+ * + * optional string memo = 4; + */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Human-readable message for the merchant
+       * 
+ * + * optional string memo = 4; + */ + public Builder setMemo( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + memo_ = value; + onChanged(); + return this; + } + /** + *
+       * Human-readable message for the merchant
+       * 
+ * + * optional string memo = 4; + */ + public Builder clearMemo() { + bitField0_ = (bitField0_ & ~0x00000008); + memo_ = getDefaultInstance().getMemo(); + onChanged(); + return this; + } + /** + *
+       * Human-readable message for the merchant
+       * 
+ * + * optional string memo = 4; + */ + public Builder setMemoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + memo_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:payments.Payment) + } + + // @@protoc_insertion_point(class_scope:payments.Payment) + private static final org.bitcoin.protocols.payments.Protos.Payment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.Payment(); + } + + public static org.bitcoin.protocols.payments.Protos.Payment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Payment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Payment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.protocols.payments.Protos.Payment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PaymentACKOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.PaymentACK) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Payment message that triggered this ACK
+     * 
+ * + * required .payments.Payment payment = 1; + */ + boolean hasPayment(); + /** + *
+     * Payment message that triggered this ACK
+     * 
+ * + * required .payments.Payment payment = 1; + */ + org.bitcoin.protocols.payments.Protos.Payment getPayment(); + /** + *
+     * Payment message that triggered this ACK
+     * 
+ * + * required .payments.Payment payment = 1; + */ + org.bitcoin.protocols.payments.Protos.PaymentOrBuilder getPaymentOrBuilder(); + + /** + *
+     * human-readable message for customer
+     * 
+ * + * optional string memo = 2; + */ + boolean hasMemo(); + /** + *
+     * human-readable message for customer
+     * 
+ * + * optional string memo = 2; + */ + java.lang.String getMemo(); + /** + *
+     * human-readable message for customer
+     * 
+ * + * optional string memo = 2; + */ + com.google.protobuf.ByteString + getMemoBytes(); + } + /** + * Protobuf type {@code payments.PaymentACK} + */ + public static final class PaymentACK extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:payments.PaymentACK) + PaymentACKOrBuilder { + // Use PaymentACK.newBuilder() to construct. + private PaymentACK(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PaymentACK() { + memo_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentACK( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + org.bitcoin.protocols.payments.Protos.Payment.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = payment_.toBuilder(); + } + payment_ = input.readMessage(org.bitcoin.protocols.payments.Protos.Payment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payment_); + payment_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + memo_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentACK_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentACK_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.PaymentACK.class, org.bitcoin.protocols.payments.Protos.PaymentACK.Builder.class); + } + + private int bitField0_; + public static final int PAYMENT_FIELD_NUMBER = 1; + private org.bitcoin.protocols.payments.Protos.Payment payment_; + /** + *
+     * Payment message that triggered this ACK
+     * 
+ * + * required .payments.Payment payment = 1; + */ + public boolean hasPayment() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * Payment message that triggered this ACK
+     * 
+ * + * required .payments.Payment payment = 1; + */ + public org.bitcoin.protocols.payments.Protos.Payment getPayment() { + return payment_ == null ? org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance() : payment_; + } + /** + *
+     * Payment message that triggered this ACK
+     * 
+ * + * required .payments.Payment payment = 1; + */ + public org.bitcoin.protocols.payments.Protos.PaymentOrBuilder getPaymentOrBuilder() { + return payment_ == null ? org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance() : payment_; + } + + public static final int MEMO_FIELD_NUMBER = 2; + private volatile java.lang.Object memo_; + /** + *
+     * human-readable message for customer
+     * 
+ * + * optional string memo = 2; + */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * human-readable message for customer
+     * 
+ * + * optional string memo = 2; + */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + memo_ = s; + } + return s; + } + } + /** + *
+     * human-readable message for customer
+     * 
+ * + * optional string memo = 2; + */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasPayment()) { + memoizedIsInitialized = 0; + return false; + } + if (!getPayment().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getPayment()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, memo_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPayment()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, memo_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoin.protocols.payments.Protos.PaymentACK)) { + return super.equals(obj); + } + org.bitcoin.protocols.payments.Protos.PaymentACK other = (org.bitcoin.protocols.payments.Protos.PaymentACK) obj; + + boolean result = true; + result = result && (hasPayment() == other.hasPayment()); + if (hasPayment()) { + result = result && getPayment() + .equals(other.getPayment()); + } + result = result && (hasMemo() == other.hasMemo()); + if (hasMemo()) { + result = result && getMemo() + .equals(other.getMemo()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasPayment()) { + hash = (37 * hash) + PAYMENT_FIELD_NUMBER; + hash = (53 * hash) + getPayment().hashCode(); + } + if (hasMemo()) { + hash = (37 * hash) + MEMO_FIELD_NUMBER; + hash = (53 * hash) + getMemo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.PaymentACK prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.PaymentACK} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:payments.PaymentACK) + org.bitcoin.protocols.payments.Protos.PaymentACKOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentACK_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentACK_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.protocols.payments.Protos.PaymentACK.class, org.bitcoin.protocols.payments.Protos.PaymentACK.Builder.class); + } + + // Construct using org.bitcoin.protocols.payments.Protos.PaymentACK.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPaymentFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (paymentBuilder_ == null) { + payment_ = null; + } else { + paymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + memo_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.protocols.payments.Protos.internal_static_payments_PaymentACK_descriptor; + } + + public org.bitcoin.protocols.payments.Protos.PaymentACK getDefaultInstanceForType() { + return org.bitcoin.protocols.payments.Protos.PaymentACK.getDefaultInstance(); + } + + public org.bitcoin.protocols.payments.Protos.PaymentACK build() { + org.bitcoin.protocols.payments.Protos.PaymentACK result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.protocols.payments.Protos.PaymentACK buildPartial() { + org.bitcoin.protocols.payments.Protos.PaymentACK result = new org.bitcoin.protocols.payments.Protos.PaymentACK(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (paymentBuilder_ == null) { + result.payment_ = payment_; + } else { + result.payment_ = paymentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.memo_ = memo_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.protocols.payments.Protos.PaymentACK) { + return mergeFrom((org.bitcoin.protocols.payments.Protos.PaymentACK)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.PaymentACK other) { + if (other == org.bitcoin.protocols.payments.Protos.PaymentACK.getDefaultInstance()) return this; + if (other.hasPayment()) { + mergePayment(other.getPayment()); + } + if (other.hasMemo()) { + bitField0_ |= 0x00000002; + memo_ = other.memo_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasPayment()) { + return false; + } + if (!getPayment().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.protocols.payments.Protos.PaymentACK parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.protocols.payments.Protos.PaymentACK) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.bitcoin.protocols.payments.Protos.Payment payment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Payment, org.bitcoin.protocols.payments.Protos.Payment.Builder, org.bitcoin.protocols.payments.Protos.PaymentOrBuilder> paymentBuilder_; + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public boolean hasPayment() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public org.bitcoin.protocols.payments.Protos.Payment getPayment() { + if (paymentBuilder_ == null) { + return payment_ == null ? org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance() : payment_; + } else { + return paymentBuilder_.getMessage(); + } + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public Builder setPayment(org.bitcoin.protocols.payments.Protos.Payment value) { + if (paymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payment_ = value; + onChanged(); + } else { + paymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public Builder setPayment( + org.bitcoin.protocols.payments.Protos.Payment.Builder builderForValue) { + if (paymentBuilder_ == null) { + payment_ = builderForValue.build(); + onChanged(); + } else { + paymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public Builder mergePayment(org.bitcoin.protocols.payments.Protos.Payment value) { + if (paymentBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + payment_ != null && + payment_ != org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) { + payment_ = + org.bitcoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); + } else { + payment_ = value; + } + onChanged(); + } else { + paymentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public Builder clearPayment() { + if (paymentBuilder_ == null) { + payment_ = null; + onChanged(); + } else { + paymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public org.bitcoin.protocols.payments.Protos.Payment.Builder getPaymentBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPaymentFieldBuilder().getBuilder(); + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + public org.bitcoin.protocols.payments.Protos.PaymentOrBuilder getPaymentOrBuilder() { + if (paymentBuilder_ != null) { + return paymentBuilder_.getMessageOrBuilder(); + } else { + return payment_ == null ? + org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance() : payment_; + } + } + /** + *
+       * Payment message that triggered this ACK
+       * 
+ * + * required .payments.Payment payment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Payment, org.bitcoin.protocols.payments.Protos.Payment.Builder, org.bitcoin.protocols.payments.Protos.PaymentOrBuilder> + getPaymentFieldBuilder() { + if (paymentBuilder_ == null) { + paymentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoin.protocols.payments.Protos.Payment, org.bitcoin.protocols.payments.Protos.Payment.Builder, org.bitcoin.protocols.payments.Protos.PaymentOrBuilder>( + getPayment(), + getParentForChildren(), + isClean()); + payment_ = null; + } + return paymentBuilder_; + } + + private java.lang.Object memo_ = ""; + /** + *
+       * human-readable message for customer
+       * 
+ * + * optional string memo = 2; + */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * human-readable message for customer
+       * 
+ * + * optional string memo = 2; + */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + memo_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * human-readable message for customer
+       * 
+ * + * optional string memo = 2; + */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * human-readable message for customer
+       * 
+ * + * optional string memo = 2; + */ + public Builder setMemo( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + memo_ = value; + onChanged(); + return this; + } + /** + *
+       * human-readable message for customer
+       * 
+ * + * optional string memo = 2; + */ + public Builder clearMemo() { + bitField0_ = (bitField0_ & ~0x00000002); + memo_ = getDefaultInstance().getMemo(); + onChanged(); + return this; + } + /** + *
+       * human-readable message for customer
+       * 
+ * + * optional string memo = 2; + */ + public Builder setMemoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + memo_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:payments.PaymentACK) + } + + // @@protoc_insertion_point(class_scope:payments.PaymentACK) + private static final org.bitcoin.protocols.payments.Protos.PaymentACK DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.PaymentACK(); + } + + public static org.bitcoin.protocols.payments.Protos.PaymentACK getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PaymentACK parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentACK(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoin.protocols.payments.Protos.PaymentACK getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_Output_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_payments_Output_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_PaymentDetails_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_payments_PaymentDetails_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_PaymentRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_payments_PaymentRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_X509Certificates_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_payments_X509Certificates_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_Payment_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_payments_Payment_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_PaymentACK_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_payments_PaymentACK_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024paymentrequest.proto\022\010payments\"+\n\006Outp" + + "ut\022\021\n\006amount\030\001 \001(\004:\0010\022\016\n\006script\030\002 \002(\014\"\243\001" + + "\n\016PaymentDetails\022\025\n\007network\030\001 \001(\t:\004main\022" + + "!\n\007outputs\030\002 \003(\0132\020.payments.Output\022\014\n\004ti" + + "me\030\003 \002(\004\022\017\n\007expires\030\004 \001(\004\022\014\n\004memo\030\005 \001(\t\022" + + "\023\n\013payment_url\030\006 \001(\t\022\025\n\rmerchant_data\030\007 " + + "\001(\014\"\225\001\n\016PaymentRequest\022\"\n\027payment_detail" + + "s_version\030\001 \001(\r:\0011\022\026\n\010pki_type\030\002 \001(\t:\004no" + + "ne\022\020\n\010pki_data\030\003 \001(\014\022\"\n\032serialized_payme" + + "nt_details\030\004 \002(\014\022\021\n\tsignature\030\005 \001(\014\"\'\n\020X", + "509Certificates\022\023\n\013certificate\030\001 \003(\014\"i\n\007" + + "Payment\022\025\n\rmerchant_data\030\001 \001(\014\022\024\n\014transa" + + "ctions\030\002 \003(\014\022#\n\trefund_to\030\003 \003(\0132\020.paymen" + + "ts.Output\022\014\n\004memo\030\004 \001(\t\">\n\nPaymentACK\022\"\n" + + "\007payment\030\001 \002(\0132\021.payments.Payment\022\014\n\004mem" + + "o\030\002 \001(\tB(\n\036org.bitcoin.protocols.payment" + + "sB\006Protos" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_payments_Output_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_payments_Output_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_payments_Output_descriptor, + new java.lang.String[] { "Amount", "Script", }); + internal_static_payments_PaymentDetails_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_payments_PaymentDetails_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_payments_PaymentDetails_descriptor, + new java.lang.String[] { "Network", "Outputs", "Time", "Expires", "Memo", "PaymentUrl", "MerchantData", }); + internal_static_payments_PaymentRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_payments_PaymentRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_payments_PaymentRequest_descriptor, + new java.lang.String[] { "PaymentDetailsVersion", "PkiType", "PkiData", "SerializedPaymentDetails", "Signature", }); + internal_static_payments_X509Certificates_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_payments_X509Certificates_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_payments_X509Certificates_descriptor, + new java.lang.String[] { "Certificate", }); + internal_static_payments_Payment_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_payments_Payment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_payments_Payment_descriptor, + new java.lang.String[] { "MerchantData", "Transactions", "RefundTo", "Memo", }); + internal_static_payments_PaymentACK_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_payments_PaymentACK_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_payments_PaymentACK_descriptor, + new java.lang.String[] { "Payment", "Memo", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/core/src/main/java/org/bitcoinj/protocols/channels/ClientState.java b/core/src/main/java/org/bitcoinj/protocols/channels/ClientState.java new file mode 100644 index 00000000..622b647d --- /dev/null +++ b/core/src/main/java/org/bitcoinj/protocols/channels/ClientState.java @@ -0,0 +1,2433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: storedclientpaymentchannel.proto + +package org.bitcoinj.protocols.channels; + +public final class ClientState { + private ClientState() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StoredClientPaymentChannelsOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.StoredClientPaymentChannels) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + java.util.List + getChannelsList(); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + int getChannelsCount(); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + java.util.List + getChannelsOrBuilderList(); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder( + int index); + } + /** + *
+   * A set of StoredPaymentChannel's
+   * 
+ * + * Protobuf type {@code paymentchannels.StoredClientPaymentChannels} + */ + public static final class StoredClientPaymentChannels extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.StoredClientPaymentChannels) + StoredClientPaymentChannelsOrBuilder { + // Use StoredClientPaymentChannels.newBuilder() to construct. + private StoredClientPaymentChannels(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredClientPaymentChannels() { + channels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredClientPaymentChannels( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + channels_.add( + input.readMessage(org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = java.util.Collections.unmodifiableList(channels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.class, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class); + } + + public static final int CHANNELS_FIELD_NUMBER = 1; + private java.util.List channels_; + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public java.util.List getChannelsList() { + return channels_; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public java.util.List + getChannelsOrBuilderList() { + return channels_; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public int getChannelsCount() { + return channels_.size(); + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index) { + return channels_.get(index); + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder( + int index) { + return channels_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getChannelsCount(); i++) { + if (!getChannels(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < channels_.size(); i++) { + output.writeMessage(1, channels_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < channels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, channels_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels)) { + return super.equals(obj); + } + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels other = (org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels) obj; + + boolean result = true; + result = result && getChannelsList() + .equals(other.getChannelsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getChannelsCount() > 0) { + hash = (37 * hash) + CHANNELS_FIELD_NUMBER; + hash = (53 * hash) + getChannelsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A set of StoredPaymentChannel's
+     * 
+ * + * Protobuf type {@code paymentchannels.StoredClientPaymentChannels} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.StoredClientPaymentChannels) + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.class, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class); + } + + // Construct using org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getChannelsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (channelsBuilder_ == null) { + channels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + channelsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels getDefaultInstanceForType() { + return org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.getDefaultInstance(); + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels build() { + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels buildPartial() { + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels result = new org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels(this); + int from_bitField0_ = bitField0_; + if (channelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = java.util.Collections.unmodifiableList(channels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.channels_ = channels_; + } else { + result.channels_ = channelsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels) { + return mergeFrom((org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels other) { + if (other == org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels.getDefaultInstance()) return this; + if (channelsBuilder_ == null) { + if (!other.channels_.isEmpty()) { + if (channels_.isEmpty()) { + channels_ = other.channels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureChannelsIsMutable(); + channels_.addAll(other.channels_); + } + onChanged(); + } + } else { + if (!other.channels_.isEmpty()) { + if (channelsBuilder_.isEmpty()) { + channelsBuilder_.dispose(); + channelsBuilder_ = null; + channels_ = other.channels_; + bitField0_ = (bitField0_ & ~0x00000001); + channelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getChannelsFieldBuilder() : null; + } else { + channelsBuilder_.addAllMessages(other.channels_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getChannelsCount(); i++) { + if (!getChannels(i).isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List channels_ = + java.util.Collections.emptyList(); + private void ensureChannelsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = new java.util.ArrayList(channels_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder> channelsBuilder_; + + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public java.util.List getChannelsList() { + if (channelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(channels_); + } else { + return channelsBuilder_.getMessageList(); + } + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public int getChannelsCount() { + if (channelsBuilder_ == null) { + return channels_.size(); + } else { + return channelsBuilder_.getCount(); + } + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index) { + if (channelsBuilder_ == null) { + return channels_.get(index); + } else { + return channelsBuilder_.getMessage(index); + } + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder setChannels( + int index, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel value) { + if (channelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChannelsIsMutable(); + channels_.set(index, value); + onChanged(); + } else { + channelsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder setChannels( + int index, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.set(index, builderForValue.build()); + onChanged(); + } else { + channelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder addChannels(org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel value) { + if (channelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChannelsIsMutable(); + channels_.add(value); + onChanged(); + } else { + channelsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder addChannels( + int index, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel value) { + if (channelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChannelsIsMutable(); + channels_.add(index, value); + onChanged(); + } else { + channelsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder addChannels( + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.add(builderForValue.build()); + onChanged(); + } else { + channelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder addChannels( + int index, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.add(index, builderForValue.build()); + onChanged(); + } else { + channelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder addAllChannels( + java.lang.Iterable values) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, channels_); + onChanged(); + } else { + channelsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder clearChannels() { + if (channelsBuilder_ == null) { + channels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + channelsBuilder_.clear(); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public Builder removeChannels(int index) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.remove(index); + onChanged(); + } else { + channelsBuilder_.remove(index); + } + return this; + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder getChannelsBuilder( + int index) { + return getChannelsFieldBuilder().getBuilder(index); + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder( + int index) { + if (channelsBuilder_ == null) { + return channels_.get(index); } else { + return channelsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public java.util.List + getChannelsOrBuilderList() { + if (channelsBuilder_ != null) { + return channelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(channels_); + } + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder addChannelsBuilder() { + return getChannelsFieldBuilder().addBuilder( + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()); + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder addChannelsBuilder( + int index) { + return getChannelsFieldBuilder().addBuilder( + index, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()); + } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ + public java.util.List + getChannelsBuilderList() { + return getChannelsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder> + getChannelsFieldBuilder() { + if (channelsBuilder_ == null) { + channelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder>( + channels_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + channels_ = null; + } + return channelsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredClientPaymentChannels) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.StoredClientPaymentChannels) + private static final org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels(); + } + + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StoredClientPaymentChannels parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredClientPaymentChannels(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannels getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StoredClientPaymentChannelOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.StoredClientPaymentChannel) + com.google.protobuf.MessageOrBuilder { + + /** + * required bytes id = 1; + */ + boolean hasId(); + /** + * required bytes id = 1; + */ + com.google.protobuf.ByteString getId(); + + /** + * required bytes contractTransaction = 2; + */ + boolean hasContractTransaction(); + /** + * required bytes contractTransaction = 2; + */ + com.google.protobuf.ByteString getContractTransaction(); + + /** + * required bytes refundTransaction = 3; + */ + boolean hasRefundTransaction(); + /** + * required bytes refundTransaction = 3; + */ + com.google.protobuf.ByteString getRefundTransaction(); + + /** + * required bytes myPublicKey = 8; + */ + boolean hasMyPublicKey(); + /** + * required bytes myPublicKey = 8; + */ + com.google.protobuf.ByteString getMyPublicKey(); + + /** + *
+     * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+     * 
+ * + * required bytes myKey = 4; + */ + boolean hasMyKey(); + /** + *
+     * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+     * 
+ * + * required bytes myKey = 4; + */ + com.google.protobuf.ByteString getMyKey(); + + /** + * required uint64 valueToMe = 5; + */ + boolean hasValueToMe(); + /** + * required uint64 valueToMe = 5; + */ + long getValueToMe(); + + /** + *
+     * Fees required to refund the transaction.
+     * 
+ * + * required uint64 refundFees = 6; + */ + boolean hasRefundFees(); + /** + *
+     * Fees required to refund the transaction.
+     * 
+ * + * required uint64 refundFees = 6; + */ + long getRefundFees(); + + /** + *
+     * When set, the hash of the transaction that was presented by the server for closure of the channel.
+     * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+     * It's supposed to be in the wallet already.
+     * 
+ * + * optional bytes closeTransactionHash = 7; + */ + boolean hasCloseTransactionHash(); + /** + *
+     * When set, the hash of the transaction that was presented by the server for closure of the channel.
+     * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+     * It's supposed to be in the wallet already.
+     * 
+ * + * optional bytes closeTransactionHash = 7; + */ + com.google.protobuf.ByteString getCloseTransactionHash(); + + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + boolean hasMajorVersion(); + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + int getMajorVersion(); + + /** + *
+     * The expiry time of the CLTV lock. Only used in protocol v2.
+     * 
+ * + * optional uint64 expiryTime = 10; + */ + boolean hasExpiryTime(); + /** + *
+     * The expiry time of the CLTV lock. Only used in protocol v2.
+     * 
+ * + * optional uint64 expiryTime = 10; + */ + long getExpiryTime(); + + /** + *
+     * The server's public key. Only used in protocol v2.
+     * 
+ * + * optional bytes serverKey = 11; + */ + boolean hasServerKey(); + /** + *
+     * The server's public key. Only used in protocol v2.
+     * 
+ * + * optional bytes serverKey = 11; + */ + com.google.protobuf.ByteString getServerKey(); + } + /** + *
+   * A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to
+   * reopen an existing channel
+   * 
+ * + * Protobuf type {@code paymentchannels.StoredClientPaymentChannel} + */ + public static final class StoredClientPaymentChannel extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.StoredClientPaymentChannel) + StoredClientPaymentChannelOrBuilder { + // Use StoredClientPaymentChannel.newBuilder() to construct. + private StoredClientPaymentChannel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredClientPaymentChannel() { + id_ = com.google.protobuf.ByteString.EMPTY; + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + refundTransaction_ = com.google.protobuf.ByteString.EMPTY; + myPublicKey_ = com.google.protobuf.ByteString.EMPTY; + myKey_ = com.google.protobuf.ByteString.EMPTY; + valueToMe_ = 0L; + refundFees_ = 0L; + closeTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + majorVersion_ = 1; + expiryTime_ = 0L; + serverKey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredClientPaymentChannel( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + id_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + contractTransaction_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + refundTransaction_ = input.readBytes(); + break; + } + case 34: { + bitField0_ |= 0x00000010; + myKey_ = input.readBytes(); + break; + } + case 40: { + bitField0_ |= 0x00000020; + valueToMe_ = input.readUInt64(); + break; + } + case 48: { + bitField0_ |= 0x00000040; + refundFees_ = input.readUInt64(); + break; + } + case 58: { + bitField0_ |= 0x00000080; + closeTransactionHash_ = input.readBytes(); + break; + } + case 66: { + bitField0_ |= 0x00000008; + myPublicKey_ = input.readBytes(); + break; + } + case 72: { + bitField0_ |= 0x00000100; + majorVersion_ = input.readUInt32(); + break; + } + case 80: { + bitField0_ |= 0x00000200; + expiryTime_ = input.readUInt64(); + break; + } + case 90: { + bitField0_ |= 0x00000400; + serverKey_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.class, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString id_; + /** + * required bytes id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes id = 1; + */ + public com.google.protobuf.ByteString getId() { + return id_; + } + + public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString contractTransaction_; + /** + * required bytes contractTransaction = 2; + */ + public boolean hasContractTransaction() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes contractTransaction = 2; + */ + public com.google.protobuf.ByteString getContractTransaction() { + return contractTransaction_; + } + + public static final int REFUNDTRANSACTION_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString refundTransaction_; + /** + * required bytes refundTransaction = 3; + */ + public boolean hasRefundTransaction() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes refundTransaction = 3; + */ + public com.google.protobuf.ByteString getRefundTransaction() { + return refundTransaction_; + } + + public static final int MYPUBLICKEY_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString myPublicKey_; + /** + * required bytes myPublicKey = 8; + */ + public boolean hasMyPublicKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes myPublicKey = 8; + */ + public com.google.protobuf.ByteString getMyPublicKey() { + return myPublicKey_; + } + + public static final int MYKEY_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString myKey_; + /** + *
+     * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+     * 
+ * + * required bytes myKey = 4; + */ + public boolean hasMyKey() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+     * 
+ * + * required bytes myKey = 4; + */ + public com.google.protobuf.ByteString getMyKey() { + return myKey_; + } + + public static final int VALUETOME_FIELD_NUMBER = 5; + private long valueToMe_; + /** + * required uint64 valueToMe = 5; + */ + public boolean hasValueToMe() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required uint64 valueToMe = 5; + */ + public long getValueToMe() { + return valueToMe_; + } + + public static final int REFUNDFEES_FIELD_NUMBER = 6; + private long refundFees_; + /** + *
+     * Fees required to refund the transaction.
+     * 
+ * + * required uint64 refundFees = 6; + */ + public boolean hasRefundFees() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+     * Fees required to refund the transaction.
+     * 
+ * + * required uint64 refundFees = 6; + */ + public long getRefundFees() { + return refundFees_; + } + + public static final int CLOSETRANSACTIONHASH_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString closeTransactionHash_; + /** + *
+     * When set, the hash of the transaction that was presented by the server for closure of the channel.
+     * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+     * It's supposed to be in the wallet already.
+     * 
+ * + * optional bytes closeTransactionHash = 7; + */ + public boolean hasCloseTransactionHash() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+     * When set, the hash of the transaction that was presented by the server for closure of the channel.
+     * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+     * It's supposed to be in the wallet already.
+     * 
+ * + * optional bytes closeTransactionHash = 7; + */ + public com.google.protobuf.ByteString getCloseTransactionHash() { + return closeTransactionHash_; + } + + public static final int MAJORVERSION_FIELD_NUMBER = 9; + private int majorVersion_; + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + public int getMajorVersion() { + return majorVersion_; + } + + public static final int EXPIRYTIME_FIELD_NUMBER = 10; + private long expiryTime_; + /** + *
+     * The expiry time of the CLTV lock. Only used in protocol v2.
+     * 
+ * + * optional uint64 expiryTime = 10; + */ + public boolean hasExpiryTime() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + *
+     * The expiry time of the CLTV lock. Only used in protocol v2.
+     * 
+ * + * optional uint64 expiryTime = 10; + */ + public long getExpiryTime() { + return expiryTime_; + } + + public static final int SERVERKEY_FIELD_NUMBER = 11; + private com.google.protobuf.ByteString serverKey_; + /** + *
+     * The server's public key. Only used in protocol v2.
+     * 
+ * + * optional bytes serverKey = 11; + */ + public boolean hasServerKey() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + *
+     * The server's public key. Only used in protocol v2.
+     * 
+ * + * optional bytes serverKey = 11; + */ + public com.google.protobuf.ByteString getServerKey() { + return serverKey_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasContractTransaction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRefundTransaction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMyPublicKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMyKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValueToMe()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRefundFees()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, contractTransaction_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, refundTransaction_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(4, myKey_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeUInt64(5, valueToMe_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeUInt64(6, refundFees_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBytes(7, closeTransactionHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(8, myPublicKey_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeUInt32(9, majorVersion_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeUInt64(10, expiryTime_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeBytes(11, serverKey_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, contractTransaction_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, refundTransaction_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, myKey_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, valueToMe_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, refundFees_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(7, closeTransactionHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, myPublicKey_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(9, majorVersion_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(10, expiryTime_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(11, serverKey_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel)) { + return super.equals(obj); + } + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel other = (org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel) obj; + + boolean result = true; + result = result && (hasId() == other.hasId()); + if (hasId()) { + result = result && getId() + .equals(other.getId()); + } + result = result && (hasContractTransaction() == other.hasContractTransaction()); + if (hasContractTransaction()) { + result = result && getContractTransaction() + .equals(other.getContractTransaction()); + } + result = result && (hasRefundTransaction() == other.hasRefundTransaction()); + if (hasRefundTransaction()) { + result = result && getRefundTransaction() + .equals(other.getRefundTransaction()); + } + result = result && (hasMyPublicKey() == other.hasMyPublicKey()); + if (hasMyPublicKey()) { + result = result && getMyPublicKey() + .equals(other.getMyPublicKey()); + } + result = result && (hasMyKey() == other.hasMyKey()); + if (hasMyKey()) { + result = result && getMyKey() + .equals(other.getMyKey()); + } + result = result && (hasValueToMe() == other.hasValueToMe()); + if (hasValueToMe()) { + result = result && (getValueToMe() + == other.getValueToMe()); + } + result = result && (hasRefundFees() == other.hasRefundFees()); + if (hasRefundFees()) { + result = result && (getRefundFees() + == other.getRefundFees()); + } + result = result && (hasCloseTransactionHash() == other.hasCloseTransactionHash()); + if (hasCloseTransactionHash()) { + result = result && getCloseTransactionHash() + .equals(other.getCloseTransactionHash()); + } + result = result && (hasMajorVersion() == other.hasMajorVersion()); + if (hasMajorVersion()) { + result = result && (getMajorVersion() + == other.getMajorVersion()); + } + result = result && (hasExpiryTime() == other.hasExpiryTime()); + if (hasExpiryTime()) { + result = result && (getExpiryTime() + == other.getExpiryTime()); + } + result = result && (hasServerKey() == other.hasServerKey()); + if (hasServerKey()) { + result = result && getServerKey() + .equals(other.getServerKey()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + } + if (hasContractTransaction()) { + hash = (37 * hash) + CONTRACTTRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getContractTransaction().hashCode(); + } + if (hasRefundTransaction()) { + hash = (37 * hash) + REFUNDTRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getRefundTransaction().hashCode(); + } + if (hasMyPublicKey()) { + hash = (37 * hash) + MYPUBLICKEY_FIELD_NUMBER; + hash = (53 * hash) + getMyPublicKey().hashCode(); + } + if (hasMyKey()) { + hash = (37 * hash) + MYKEY_FIELD_NUMBER; + hash = (53 * hash) + getMyKey().hashCode(); + } + if (hasValueToMe()) { + hash = (37 * hash) + VALUETOME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getValueToMe()); + } + if (hasRefundFees()) { + hash = (37 * hash) + REFUNDFEES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRefundFees()); + } + if (hasCloseTransactionHash()) { + hash = (37 * hash) + CLOSETRANSACTIONHASH_FIELD_NUMBER; + hash = (53 * hash) + getCloseTransactionHash().hashCode(); + } + if (hasMajorVersion()) { + hash = (37 * hash) + MAJORVERSION_FIELD_NUMBER; + hash = (53 * hash) + getMajorVersion(); + } + if (hasExpiryTime()) { + hash = (37 * hash) + EXPIRYTIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExpiryTime()); + } + if (hasServerKey()) { + hash = (37 * hash) + SERVERKEY_FIELD_NUMBER; + hash = (53 * hash) + getServerKey().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to
+     * reopen an existing channel
+     * 
+ * + * Protobuf type {@code paymentchannels.StoredClientPaymentChannel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.StoredClientPaymentChannel) + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.class, org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class); + } + + // Construct using org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + id_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + refundTransaction_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + myPublicKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + myKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + valueToMe_ = 0L; + bitField0_ = (bitField0_ & ~0x00000020); + refundFees_ = 0L; + bitField0_ = (bitField0_ & ~0x00000040); + closeTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + majorVersion_ = 1; + bitField0_ = (bitField0_ & ~0x00000100); + expiryTime_ = 0L; + bitField0_ = (bitField0_ & ~0x00000200); + serverKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel getDefaultInstanceForType() { + return org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance(); + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel build() { + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel buildPartial() { + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel result = new org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.contractTransaction_ = contractTransaction_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.refundTransaction_ = refundTransaction_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.myPublicKey_ = myPublicKey_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.myKey_ = myKey_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.valueToMe_ = valueToMe_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.refundFees_ = refundFees_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.closeTransactionHash_ = closeTransactionHash_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.majorVersion_ = majorVersion_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + result.expiryTime_ = expiryTime_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + result.serverKey_ = serverKey_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel) { + return mergeFrom((org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel other) { + if (other == org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasContractTransaction()) { + setContractTransaction(other.getContractTransaction()); + } + if (other.hasRefundTransaction()) { + setRefundTransaction(other.getRefundTransaction()); + } + if (other.hasMyPublicKey()) { + setMyPublicKey(other.getMyPublicKey()); + } + if (other.hasMyKey()) { + setMyKey(other.getMyKey()); + } + if (other.hasValueToMe()) { + setValueToMe(other.getValueToMe()); + } + if (other.hasRefundFees()) { + setRefundFees(other.getRefundFees()); + } + if (other.hasCloseTransactionHash()) { + setCloseTransactionHash(other.getCloseTransactionHash()); + } + if (other.hasMajorVersion()) { + setMajorVersion(other.getMajorVersion()); + } + if (other.hasExpiryTime()) { + setExpiryTime(other.getExpiryTime()); + } + if (other.hasServerKey()) { + setServerKey(other.getServerKey()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + if (!hasContractTransaction()) { + return false; + } + if (!hasRefundTransaction()) { + return false; + } + if (!hasMyPublicKey()) { + return false; + } + if (!hasMyKey()) { + return false; + } + if (!hasValueToMe()) { + return false; + } + if (!hasRefundFees()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString id_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes id = 1; + */ + public com.google.protobuf.ByteString getId() { + return id_; + } + /** + * required bytes id = 1; + */ + public Builder setId(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + * required bytes id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes contractTransaction = 2; + */ + public boolean hasContractTransaction() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes contractTransaction = 2; + */ + public com.google.protobuf.ByteString getContractTransaction() { + return contractTransaction_; + } + /** + * required bytes contractTransaction = 2; + */ + public Builder setContractTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + contractTransaction_ = value; + onChanged(); + return this; + } + /** + * required bytes contractTransaction = 2; + */ + public Builder clearContractTransaction() { + bitField0_ = (bitField0_ & ~0x00000002); + contractTransaction_ = getDefaultInstance().getContractTransaction(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString refundTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes refundTransaction = 3; + */ + public boolean hasRefundTransaction() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes refundTransaction = 3; + */ + public com.google.protobuf.ByteString getRefundTransaction() { + return refundTransaction_; + } + /** + * required bytes refundTransaction = 3; + */ + public Builder setRefundTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + refundTransaction_ = value; + onChanged(); + return this; + } + /** + * required bytes refundTransaction = 3; + */ + public Builder clearRefundTransaction() { + bitField0_ = (bitField0_ & ~0x00000004); + refundTransaction_ = getDefaultInstance().getRefundTransaction(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString myPublicKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes myPublicKey = 8; + */ + public boolean hasMyPublicKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes myPublicKey = 8; + */ + public com.google.protobuf.ByteString getMyPublicKey() { + return myPublicKey_; + } + /** + * required bytes myPublicKey = 8; + */ + public Builder setMyPublicKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + myPublicKey_ = value; + onChanged(); + return this; + } + /** + * required bytes myPublicKey = 8; + */ + public Builder clearMyPublicKey() { + bitField0_ = (bitField0_ & ~0x00000008); + myPublicKey_ = getDefaultInstance().getMyPublicKey(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString myKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+       * 
+ * + * required bytes myKey = 4; + */ + public boolean hasMyKey() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+       * 
+ * + * required bytes myKey = 4; + */ + public com.google.protobuf.ByteString getMyKey() { + return myKey_; + } + /** + *
+       * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+       * 
+ * + * required bytes myKey = 4; + */ + public Builder setMyKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + myKey_ = value; + onChanged(); + return this; + } + /** + *
+       * Deprecated, key is already stored in the wallet, and found using myPublicKey;
+       * 
+ * + * required bytes myKey = 4; + */ + public Builder clearMyKey() { + bitField0_ = (bitField0_ & ~0x00000010); + myKey_ = getDefaultInstance().getMyKey(); + onChanged(); + return this; + } + + private long valueToMe_ ; + /** + * required uint64 valueToMe = 5; + */ + public boolean hasValueToMe() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required uint64 valueToMe = 5; + */ + public long getValueToMe() { + return valueToMe_; + } + /** + * required uint64 valueToMe = 5; + */ + public Builder setValueToMe(long value) { + bitField0_ |= 0x00000020; + valueToMe_ = value; + onChanged(); + return this; + } + /** + * required uint64 valueToMe = 5; + */ + public Builder clearValueToMe() { + bitField0_ = (bitField0_ & ~0x00000020); + valueToMe_ = 0L; + onChanged(); + return this; + } + + private long refundFees_ ; + /** + *
+       * Fees required to refund the transaction.
+       * 
+ * + * required uint64 refundFees = 6; + */ + public boolean hasRefundFees() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + *
+       * Fees required to refund the transaction.
+       * 
+ * + * required uint64 refundFees = 6; + */ + public long getRefundFees() { + return refundFees_; + } + /** + *
+       * Fees required to refund the transaction.
+       * 
+ * + * required uint64 refundFees = 6; + */ + public Builder setRefundFees(long value) { + bitField0_ |= 0x00000040; + refundFees_ = value; + onChanged(); + return this; + } + /** + *
+       * Fees required to refund the transaction.
+       * 
+ * + * required uint64 refundFees = 6; + */ + public Builder clearRefundFees() { + bitField0_ = (bitField0_ & ~0x00000040); + refundFees_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString closeTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * When set, the hash of the transaction that was presented by the server for closure of the channel.
+       * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+       * It's supposed to be in the wallet already.
+       * 
+ * + * optional bytes closeTransactionHash = 7; + */ + public boolean hasCloseTransactionHash() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+       * When set, the hash of the transaction that was presented by the server for closure of the channel.
+       * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+       * It's supposed to be in the wallet already.
+       * 
+ * + * optional bytes closeTransactionHash = 7; + */ + public com.google.protobuf.ByteString getCloseTransactionHash() { + return closeTransactionHash_; + } + /** + *
+       * When set, the hash of the transaction that was presented by the server for closure of the channel.
+       * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+       * It's supposed to be in the wallet already.
+       * 
+ * + * optional bytes closeTransactionHash = 7; + */ + public Builder setCloseTransactionHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + closeTransactionHash_ = value; + onChanged(); + return this; + } + /** + *
+       * When set, the hash of the transaction that was presented by the server for closure of the channel.
+       * It spends the contractTransaction and is expected to be broadcast to the network by the server.
+       * It's supposed to be in the wallet already.
+       * 
+ * + * optional bytes closeTransactionHash = 7; + */ + public Builder clearCloseTransactionHash() { + bitField0_ = (bitField0_ & ~0x00000080); + closeTransactionHash_ = getDefaultInstance().getCloseTransactionHash(); + onChanged(); + return this; + } + + private int majorVersion_ = 1; + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + public int getMajorVersion() { + return majorVersion_; + } + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + public Builder setMajorVersion(int value) { + bitField0_ |= 0x00000100; + majorVersion_ = value; + onChanged(); + return this; + } + /** + * optional uint32 majorVersion = 9 [default = 1]; + */ + public Builder clearMajorVersion() { + bitField0_ = (bitField0_ & ~0x00000100); + majorVersion_ = 1; + onChanged(); + return this; + } + + private long expiryTime_ ; + /** + *
+       * The expiry time of the CLTV lock. Only used in protocol v2.
+       * 
+ * + * optional uint64 expiryTime = 10; + */ + public boolean hasExpiryTime() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + *
+       * The expiry time of the CLTV lock. Only used in protocol v2.
+       * 
+ * + * optional uint64 expiryTime = 10; + */ + public long getExpiryTime() { + return expiryTime_; + } + /** + *
+       * The expiry time of the CLTV lock. Only used in protocol v2.
+       * 
+ * + * optional uint64 expiryTime = 10; + */ + public Builder setExpiryTime(long value) { + bitField0_ |= 0x00000200; + expiryTime_ = value; + onChanged(); + return this; + } + /** + *
+       * The expiry time of the CLTV lock. Only used in protocol v2.
+       * 
+ * + * optional uint64 expiryTime = 10; + */ + public Builder clearExpiryTime() { + bitField0_ = (bitField0_ & ~0x00000200); + expiryTime_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serverKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The server's public key. Only used in protocol v2.
+       * 
+ * + * optional bytes serverKey = 11; + */ + public boolean hasServerKey() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + *
+       * The server's public key. Only used in protocol v2.
+       * 
+ * + * optional bytes serverKey = 11; + */ + public com.google.protobuf.ByteString getServerKey() { + return serverKey_; + } + /** + *
+       * The server's public key. Only used in protocol v2.
+       * 
+ * + * optional bytes serverKey = 11; + */ + public Builder setServerKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + serverKey_ = value; + onChanged(); + return this; + } + /** + *
+       * The server's public key. Only used in protocol v2.
+       * 
+ * + * optional bytes serverKey = 11; + */ + public Builder clearServerKey() { + bitField0_ = (bitField0_ & ~0x00000400); + serverKey_ = getDefaultInstance().getServerKey(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredClientPaymentChannel) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.StoredClientPaymentChannel) + private static final org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel(); + } + + public static org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StoredClientPaymentChannel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredClientPaymentChannel(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.protocols.channels.ClientState.StoredClientPaymentChannel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n storedclientpaymentchannel.proto\022\017paym" + + "entchannels\"\\\n\033StoredClientPaymentChanne" + + "ls\022=\n\010channels\030\001 \003(\0132+.paymentchannels.S" + + "toredClientPaymentChannel\"\211\002\n\032StoredClie" + + "ntPaymentChannel\022\n\n\002id\030\001 \002(\014\022\033\n\023contract" + + "Transaction\030\002 \002(\014\022\031\n\021refundTransaction\030\003" + + " \002(\014\022\023\n\013myPublicKey\030\010 \002(\014\022\r\n\005myKey\030\004 \002(\014" + + "\022\021\n\tvalueToMe\030\005 \002(\004\022\022\n\nrefundFees\030\006 \002(\004\022" + + "\034\n\024closeTransactionHash\030\007 \001(\014\022\027\n\014majorVe" + + "rsion\030\t \001(\r:\0011\022\022\n\nexpiryTime\030\n \001(\004\022\021\n\tse", + "rverKey\030\013 \001(\014B.\n\037org.bitcoinj.protocols." + + "channelsB\013ClientState" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_paymentchannels_StoredClientPaymentChannels_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_StoredClientPaymentChannels_descriptor, + new java.lang.String[] { "Channels", }); + internal_static_paymentchannels_StoredClientPaymentChannel_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_StoredClientPaymentChannel_descriptor, + new java.lang.String[] { "Id", "ContractTransaction", "RefundTransaction", "MyPublicKey", "MyKey", "ValueToMe", "RefundFees", "CloseTransactionHash", "MajorVersion", "ExpiryTime", "ServerKey", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/core/src/main/java/org/bitcoinj/protocols/channels/ServerState.java b/core/src/main/java/org/bitcoinj/protocols/channels/ServerState.java new file mode 100644 index 00000000..4b806cf7 --- /dev/null +++ b/core/src/main/java/org/bitcoinj/protocols/channels/ServerState.java @@ -0,0 +1,1997 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: storedserverpaymentchannel.proto + +package org.bitcoinj.protocols.channels; + +public final class ServerState { + private ServerState() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StoredServerPaymentChannelsOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.StoredServerPaymentChannels) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + java.util.List + getChannelsList(); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + int getChannelsCount(); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + java.util.List + getChannelsOrBuilderList(); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder( + int index); + } + /** + *
+   * A set of StoredPaymentChannel's
+   * 
+ * + * Protobuf type {@code paymentchannels.StoredServerPaymentChannels} + */ + public static final class StoredServerPaymentChannels extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.StoredServerPaymentChannels) + StoredServerPaymentChannelsOrBuilder { + // Use StoredServerPaymentChannels.newBuilder() to construct. + private StoredServerPaymentChannels(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredServerPaymentChannels() { + channels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredServerPaymentChannels( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + channels_.add( + input.readMessage(org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = java.util.Collections.unmodifiableList(channels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.class, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class); + } + + public static final int CHANNELS_FIELD_NUMBER = 1; + private java.util.List channels_; + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public java.util.List getChannelsList() { + return channels_; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public java.util.List + getChannelsOrBuilderList() { + return channels_; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public int getChannelsCount() { + return channels_.size(); + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index) { + return channels_.get(index); + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder( + int index) { + return channels_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getChannelsCount(); i++) { + if (!getChannels(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < channels_.size(); i++) { + output.writeMessage(1, channels_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < channels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, channels_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels)) { + return super.equals(obj); + } + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels other = (org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels) obj; + + boolean result = true; + result = result && getChannelsList() + .equals(other.getChannelsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getChannelsCount() > 0) { + hash = (37 * hash) + CHANNELS_FIELD_NUMBER; + hash = (53 * hash) + getChannelsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A set of StoredPaymentChannel's
+     * 
+ * + * Protobuf type {@code paymentchannels.StoredServerPaymentChannels} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.StoredServerPaymentChannels) + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.class, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class); + } + + // Construct using org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getChannelsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (channelsBuilder_ == null) { + channels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + channelsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels getDefaultInstanceForType() { + return org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.getDefaultInstance(); + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels build() { + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels buildPartial() { + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels result = new org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels(this); + int from_bitField0_ = bitField0_; + if (channelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = java.util.Collections.unmodifiableList(channels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.channels_ = channels_; + } else { + result.channels_ = channelsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels) { + return mergeFrom((org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels other) { + if (other == org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels.getDefaultInstance()) return this; + if (channelsBuilder_ == null) { + if (!other.channels_.isEmpty()) { + if (channels_.isEmpty()) { + channels_ = other.channels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureChannelsIsMutable(); + channels_.addAll(other.channels_); + } + onChanged(); + } + } else { + if (!other.channels_.isEmpty()) { + if (channelsBuilder_.isEmpty()) { + channelsBuilder_.dispose(); + channelsBuilder_ = null; + channels_ = other.channels_; + bitField0_ = (bitField0_ & ~0x00000001); + channelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getChannelsFieldBuilder() : null; + } else { + channelsBuilder_.addAllMessages(other.channels_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getChannelsCount(); i++) { + if (!getChannels(i).isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List channels_ = + java.util.Collections.emptyList(); + private void ensureChannelsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = new java.util.ArrayList(channels_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder> channelsBuilder_; + + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public java.util.List getChannelsList() { + if (channelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(channels_); + } else { + return channelsBuilder_.getMessageList(); + } + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public int getChannelsCount() { + if (channelsBuilder_ == null) { + return channels_.size(); + } else { + return channelsBuilder_.getCount(); + } + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index) { + if (channelsBuilder_ == null) { + return channels_.get(index); + } else { + return channelsBuilder_.getMessage(index); + } + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder setChannels( + int index, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel value) { + if (channelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChannelsIsMutable(); + channels_.set(index, value); + onChanged(); + } else { + channelsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder setChannels( + int index, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder builderForValue) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.set(index, builderForValue.build()); + onChanged(); + } else { + channelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder addChannels(org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel value) { + if (channelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChannelsIsMutable(); + channels_.add(value); + onChanged(); + } else { + channelsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder addChannels( + int index, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel value) { + if (channelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChannelsIsMutable(); + channels_.add(index, value); + onChanged(); + } else { + channelsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder addChannels( + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder builderForValue) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.add(builderForValue.build()); + onChanged(); + } else { + channelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder addChannels( + int index, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder builderForValue) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.add(index, builderForValue.build()); + onChanged(); + } else { + channelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder addAllChannels( + java.lang.Iterable values) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, channels_); + onChanged(); + } else { + channelsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder clearChannels() { + if (channelsBuilder_ == null) { + channels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + channelsBuilder_.clear(); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public Builder removeChannels(int index) { + if (channelsBuilder_ == null) { + ensureChannelsIsMutable(); + channels_.remove(index); + onChanged(); + } else { + channelsBuilder_.remove(index); + } + return this; + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder getChannelsBuilder( + int index) { + return getChannelsFieldBuilder().getBuilder(index); + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder( + int index) { + if (channelsBuilder_ == null) { + return channels_.get(index); } else { + return channelsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public java.util.List + getChannelsOrBuilderList() { + if (channelsBuilder_ != null) { + return channelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(channels_); + } + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder addChannelsBuilder() { + return getChannelsFieldBuilder().addBuilder( + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()); + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder addChannelsBuilder( + int index) { + return getChannelsFieldBuilder().addBuilder( + index, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()); + } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ + public java.util.List + getChannelsBuilderList() { + return getChannelsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder> + getChannelsFieldBuilder() { + if (channelsBuilder_ == null) { + channelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder>( + channels_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + channels_ = null; + } + return channelsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredServerPaymentChannels) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.StoredServerPaymentChannels) + private static final org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels(); + } + + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StoredServerPaymentChannels parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredServerPaymentChannels(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannels getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StoredServerPaymentChannelOrBuilder extends + // @@protoc_insertion_point(interface_extends:paymentchannels.StoredServerPaymentChannel) + com.google.protobuf.MessageOrBuilder { + + /** + * required uint64 bestValueToMe = 1; + */ + boolean hasBestValueToMe(); + /** + * required uint64 bestValueToMe = 1; + */ + long getBestValueToMe(); + + /** + * optional bytes bestValueSignature = 2; + */ + boolean hasBestValueSignature(); + /** + * optional bytes bestValueSignature = 2; + */ + com.google.protobuf.ByteString getBestValueSignature(); + + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + boolean hasRefundTransactionUnlockTimeSecs(); + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + long getRefundTransactionUnlockTimeSecs(); + + /** + * required bytes contractTransaction = 4; + */ + boolean hasContractTransaction(); + /** + * required bytes contractTransaction = 4; + */ + com.google.protobuf.ByteString getContractTransaction(); + + /** + * optional bytes clientOutput = 5; + */ + boolean hasClientOutput(); + /** + * optional bytes clientOutput = 5; + */ + com.google.protobuf.ByteString getClientOutput(); + + /** + * required bytes myKey = 6; + */ + boolean hasMyKey(); + /** + * required bytes myKey = 6; + */ + com.google.protobuf.ByteString getMyKey(); + + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + boolean hasMajorVersion(); + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + int getMajorVersion(); + + /** + *
+     * Protocol version 2 only - the P2SH hash doesn't contain the required key
+     * 
+ * + * optional bytes clientKey = 8; + */ + boolean hasClientKey(); + /** + *
+     * Protocol version 2 only - the P2SH hash doesn't contain the required key
+     * 
+ * + * optional bytes clientKey = 8; + */ + com.google.protobuf.ByteString getClientKey(); + } + /** + *
+   * A server-side payment channel in serialized form, which can be reloaded later if the server restarts
+   * 
+ * + * Protobuf type {@code paymentchannels.StoredServerPaymentChannel} + */ + public static final class StoredServerPaymentChannel extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:paymentchannels.StoredServerPaymentChannel) + StoredServerPaymentChannelOrBuilder { + // Use StoredServerPaymentChannel.newBuilder() to construct. + private StoredServerPaymentChannel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredServerPaymentChannel() { + bestValueToMe_ = 0L; + bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; + refundTransactionUnlockTimeSecs_ = 0L; + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + clientOutput_ = com.google.protobuf.ByteString.EMPTY; + myKey_ = com.google.protobuf.ByteString.EMPTY; + majorVersion_ = 1; + clientKey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredServerPaymentChannel( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + bestValueToMe_ = input.readUInt64(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + bestValueSignature_ = input.readBytes(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + refundTransactionUnlockTimeSecs_ = input.readUInt64(); + break; + } + case 34: { + bitField0_ |= 0x00000008; + contractTransaction_ = input.readBytes(); + break; + } + case 42: { + bitField0_ |= 0x00000010; + clientOutput_ = input.readBytes(); + break; + } + case 50: { + bitField0_ |= 0x00000020; + myKey_ = input.readBytes(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + majorVersion_ = input.readUInt32(); + break; + } + case 66: { + bitField0_ |= 0x00000080; + clientKey_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.class, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class); + } + + private int bitField0_; + public static final int BESTVALUETOME_FIELD_NUMBER = 1; + private long bestValueToMe_; + /** + * required uint64 bestValueToMe = 1; + */ + public boolean hasBestValueToMe() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required uint64 bestValueToMe = 1; + */ + public long getBestValueToMe() { + return bestValueToMe_; + } + + public static final int BESTVALUESIGNATURE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString bestValueSignature_; + /** + * optional bytes bestValueSignature = 2; + */ + public boolean hasBestValueSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bytes bestValueSignature = 2; + */ + public com.google.protobuf.ByteString getBestValueSignature() { + return bestValueSignature_; + } + + public static final int REFUNDTRANSACTIONUNLOCKTIMESECS_FIELD_NUMBER = 3; + private long refundTransactionUnlockTimeSecs_; + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public boolean hasRefundTransactionUnlockTimeSecs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public long getRefundTransactionUnlockTimeSecs() { + return refundTransactionUnlockTimeSecs_; + } + + public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString contractTransaction_; + /** + * required bytes contractTransaction = 4; + */ + public boolean hasContractTransaction() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes contractTransaction = 4; + */ + public com.google.protobuf.ByteString getContractTransaction() { + return contractTransaction_; + } + + public static final int CLIENTOUTPUT_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString clientOutput_; + /** + * optional bytes clientOutput = 5; + */ + public boolean hasClientOutput() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes clientOutput = 5; + */ + public com.google.protobuf.ByteString getClientOutput() { + return clientOutput_; + } + + public static final int MYKEY_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString myKey_; + /** + * required bytes myKey = 6; + */ + public boolean hasMyKey() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required bytes myKey = 6; + */ + public com.google.protobuf.ByteString getMyKey() { + return myKey_; + } + + public static final int MAJORVERSION_FIELD_NUMBER = 7; + private int majorVersion_; + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + public int getMajorVersion() { + return majorVersion_; + } + + public static final int CLIENTKEY_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString clientKey_; + /** + *
+     * Protocol version 2 only - the P2SH hash doesn't contain the required key
+     * 
+ * + * optional bytes clientKey = 8; + */ + public boolean hasClientKey() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+     * Protocol version 2 only - the P2SH hash doesn't contain the required key
+     * 
+ * + * optional bytes clientKey = 8; + */ + public com.google.protobuf.ByteString getClientKey() { + return clientKey_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasBestValueToMe()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRefundTransactionUnlockTimeSecs()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasContractTransaction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMyKey()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt64(1, bestValueToMe_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, bestValueSignature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, refundTransactionUnlockTimeSecs_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, contractTransaction_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, clientOutput_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(6, myKey_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeUInt32(7, majorVersion_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBytes(8, clientKey_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, bestValueToMe_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, bestValueSignature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, refundTransactionUnlockTimeSecs_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, contractTransaction_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, clientOutput_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, myKey_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(7, majorVersion_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, clientKey_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel)) { + return super.equals(obj); + } + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel other = (org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel) obj; + + boolean result = true; + result = result && (hasBestValueToMe() == other.hasBestValueToMe()); + if (hasBestValueToMe()) { + result = result && (getBestValueToMe() + == other.getBestValueToMe()); + } + result = result && (hasBestValueSignature() == other.hasBestValueSignature()); + if (hasBestValueSignature()) { + result = result && getBestValueSignature() + .equals(other.getBestValueSignature()); + } + result = result && (hasRefundTransactionUnlockTimeSecs() == other.hasRefundTransactionUnlockTimeSecs()); + if (hasRefundTransactionUnlockTimeSecs()) { + result = result && (getRefundTransactionUnlockTimeSecs() + == other.getRefundTransactionUnlockTimeSecs()); + } + result = result && (hasContractTransaction() == other.hasContractTransaction()); + if (hasContractTransaction()) { + result = result && getContractTransaction() + .equals(other.getContractTransaction()); + } + result = result && (hasClientOutput() == other.hasClientOutput()); + if (hasClientOutput()) { + result = result && getClientOutput() + .equals(other.getClientOutput()); + } + result = result && (hasMyKey() == other.hasMyKey()); + if (hasMyKey()) { + result = result && getMyKey() + .equals(other.getMyKey()); + } + result = result && (hasMajorVersion() == other.hasMajorVersion()); + if (hasMajorVersion()) { + result = result && (getMajorVersion() + == other.getMajorVersion()); + } + result = result && (hasClientKey() == other.hasClientKey()); + if (hasClientKey()) { + result = result && getClientKey() + .equals(other.getClientKey()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasBestValueToMe()) { + hash = (37 * hash) + BESTVALUETOME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBestValueToMe()); + } + if (hasBestValueSignature()) { + hash = (37 * hash) + BESTVALUESIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getBestValueSignature().hashCode(); + } + if (hasRefundTransactionUnlockTimeSecs()) { + hash = (37 * hash) + REFUNDTRANSACTIONUNLOCKTIMESECS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRefundTransactionUnlockTimeSecs()); + } + if (hasContractTransaction()) { + hash = (37 * hash) + CONTRACTTRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getContractTransaction().hashCode(); + } + if (hasClientOutput()) { + hash = (37 * hash) + CLIENTOUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getClientOutput().hashCode(); + } + if (hasMyKey()) { + hash = (37 * hash) + MYKEY_FIELD_NUMBER; + hash = (53 * hash) + getMyKey().hashCode(); + } + if (hasMajorVersion()) { + hash = (37 * hash) + MAJORVERSION_FIELD_NUMBER; + hash = (53 * hash) + getMajorVersion(); + } + if (hasClientKey()) { + hash = (37 * hash) + CLIENTKEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A server-side payment channel in serialized form, which can be reloaded later if the server restarts
+     * 
+ * + * Protobuf type {@code paymentchannels.StoredServerPaymentChannel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:paymentchannels.StoredServerPaymentChannel) + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.class, org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class); + } + + // Construct using org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + bestValueToMe_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + refundTransactionUnlockTimeSecs_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + clientOutput_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + myKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + majorVersion_ = 1; + bitField0_ = (bitField0_ & ~0x00000040); + clientKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel getDefaultInstanceForType() { + return org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance(); + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel build() { + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel buildPartial() { + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel result = new org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.bestValueToMe_ = bestValueToMe_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.bestValueSignature_ = bestValueSignature_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.refundTransactionUnlockTimeSecs_ = refundTransactionUnlockTimeSecs_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.contractTransaction_ = contractTransaction_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.clientOutput_ = clientOutput_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.myKey_ = myKey_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.majorVersion_ = majorVersion_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.clientKey_ = clientKey_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel) { + return mergeFrom((org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel other) { + if (other == org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()) return this; + if (other.hasBestValueToMe()) { + setBestValueToMe(other.getBestValueToMe()); + } + if (other.hasBestValueSignature()) { + setBestValueSignature(other.getBestValueSignature()); + } + if (other.hasRefundTransactionUnlockTimeSecs()) { + setRefundTransactionUnlockTimeSecs(other.getRefundTransactionUnlockTimeSecs()); + } + if (other.hasContractTransaction()) { + setContractTransaction(other.getContractTransaction()); + } + if (other.hasClientOutput()) { + setClientOutput(other.getClientOutput()); + } + if (other.hasMyKey()) { + setMyKey(other.getMyKey()); + } + if (other.hasMajorVersion()) { + setMajorVersion(other.getMajorVersion()); + } + if (other.hasClientKey()) { + setClientKey(other.getClientKey()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasBestValueToMe()) { + return false; + } + if (!hasRefundTransactionUnlockTimeSecs()) { + return false; + } + if (!hasContractTransaction()) { + return false; + } + if (!hasMyKey()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long bestValueToMe_ ; + /** + * required uint64 bestValueToMe = 1; + */ + public boolean hasBestValueToMe() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required uint64 bestValueToMe = 1; + */ + public long getBestValueToMe() { + return bestValueToMe_; + } + /** + * required uint64 bestValueToMe = 1; + */ + public Builder setBestValueToMe(long value) { + bitField0_ |= 0x00000001; + bestValueToMe_ = value; + onChanged(); + return this; + } + /** + * required uint64 bestValueToMe = 1; + */ + public Builder clearBestValueToMe() { + bitField0_ = (bitField0_ & ~0x00000001); + bestValueToMe_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes bestValueSignature = 2; + */ + public boolean hasBestValueSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bytes bestValueSignature = 2; + */ + public com.google.protobuf.ByteString getBestValueSignature() { + return bestValueSignature_; + } + /** + * optional bytes bestValueSignature = 2; + */ + public Builder setBestValueSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + bestValueSignature_ = value; + onChanged(); + return this; + } + /** + * optional bytes bestValueSignature = 2; + */ + public Builder clearBestValueSignature() { + bitField0_ = (bitField0_ & ~0x00000002); + bestValueSignature_ = getDefaultInstance().getBestValueSignature(); + onChanged(); + return this; + } + + private long refundTransactionUnlockTimeSecs_ ; + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public boolean hasRefundTransactionUnlockTimeSecs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public long getRefundTransactionUnlockTimeSecs() { + return refundTransactionUnlockTimeSecs_; + } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public Builder setRefundTransactionUnlockTimeSecs(long value) { + bitField0_ |= 0x00000004; + refundTransactionUnlockTimeSecs_ = value; + onChanged(); + return this; + } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public Builder clearRefundTransactionUnlockTimeSecs() { + bitField0_ = (bitField0_ & ~0x00000004); + refundTransactionUnlockTimeSecs_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes contractTransaction = 4; + */ + public boolean hasContractTransaction() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes contractTransaction = 4; + */ + public com.google.protobuf.ByteString getContractTransaction() { + return contractTransaction_; + } + /** + * required bytes contractTransaction = 4; + */ + public Builder setContractTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + contractTransaction_ = value; + onChanged(); + return this; + } + /** + * required bytes contractTransaction = 4; + */ + public Builder clearContractTransaction() { + bitField0_ = (bitField0_ & ~0x00000008); + contractTransaction_ = getDefaultInstance().getContractTransaction(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString clientOutput_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes clientOutput = 5; + */ + public boolean hasClientOutput() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes clientOutput = 5; + */ + public com.google.protobuf.ByteString getClientOutput() { + return clientOutput_; + } + /** + * optional bytes clientOutput = 5; + */ + public Builder setClientOutput(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + clientOutput_ = value; + onChanged(); + return this; + } + /** + * optional bytes clientOutput = 5; + */ + public Builder clearClientOutput() { + bitField0_ = (bitField0_ & ~0x00000010); + clientOutput_ = getDefaultInstance().getClientOutput(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString myKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes myKey = 6; + */ + public boolean hasMyKey() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required bytes myKey = 6; + */ + public com.google.protobuf.ByteString getMyKey() { + return myKey_; + } + /** + * required bytes myKey = 6; + */ + public Builder setMyKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + myKey_ = value; + onChanged(); + return this; + } + /** + * required bytes myKey = 6; + */ + public Builder clearMyKey() { + bitField0_ = (bitField0_ & ~0x00000020); + myKey_ = getDefaultInstance().getMyKey(); + onChanged(); + return this; + } + + private int majorVersion_ = 1; + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + public int getMajorVersion() { + return majorVersion_; + } + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + public Builder setMajorVersion(int value) { + bitField0_ |= 0x00000040; + majorVersion_ = value; + onChanged(); + return this; + } + /** + * optional uint32 majorVersion = 7 [default = 1]; + */ + public Builder clearMajorVersion() { + bitField0_ = (bitField0_ & ~0x00000040); + majorVersion_ = 1; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString clientKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Protocol version 2 only - the P2SH hash doesn't contain the required key
+       * 
+ * + * optional bytes clientKey = 8; + */ + public boolean hasClientKey() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+       * Protocol version 2 only - the P2SH hash doesn't contain the required key
+       * 
+ * + * optional bytes clientKey = 8; + */ + public com.google.protobuf.ByteString getClientKey() { + return clientKey_; + } + /** + *
+       * Protocol version 2 only - the P2SH hash doesn't contain the required key
+       * 
+ * + * optional bytes clientKey = 8; + */ + public Builder setClientKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + clientKey_ = value; + onChanged(); + return this; + } + /** + *
+       * Protocol version 2 only - the P2SH hash doesn't contain the required key
+       * 
+ * + * optional bytes clientKey = 8; + */ + public Builder clearClientKey() { + bitField0_ = (bitField0_ & ~0x00000080); + clientKey_ = getDefaultInstance().getClientKey(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredServerPaymentChannel) + } + + // @@protoc_insertion_point(class_scope:paymentchannels.StoredServerPaymentChannel) + private static final org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel(); + } + + public static org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StoredServerPaymentChannel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredServerPaymentChannel(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.protocols.channels.ServerState.StoredServerPaymentChannel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n storedserverpaymentchannel.proto\022\017paym" + + "entchannels\"\\\n\033StoredServerPaymentChanne" + + "ls\022=\n\010channels\030\001 \003(\0132+.paymentchannels.S" + + "toredServerPaymentChannel\"\346\001\n\032StoredServ" + + "erPaymentChannel\022\025\n\rbestValueToMe\030\001 \002(\004\022" + + "\032\n\022bestValueSignature\030\002 \001(\014\022\'\n\037refundTra" + + "nsactionUnlockTimeSecs\030\003 \002(\004\022\033\n\023contract" + + "Transaction\030\004 \002(\014\022\024\n\014clientOutput\030\005 \001(\014\022" + + "\r\n\005myKey\030\006 \002(\014\022\027\n\014majorVersion\030\007 \001(\r:\0011\022" + + "\021\n\tclientKey\030\010 \001(\014B.\n\037org.bitcoinj.proto", + "cols.channelsB\013ServerState" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_paymentchannels_StoredServerPaymentChannels_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_StoredServerPaymentChannels_descriptor, + new java.lang.String[] { "Channels", }); + internal_static_paymentchannels_StoredServerPaymentChannel_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_paymentchannels_StoredServerPaymentChannel_descriptor, + new java.lang.String[] { "BestValueToMe", "BestValueSignature", "RefundTransactionUnlockTimeSecs", "ContractTransaction", "ClientOutput", "MyKey", "MajorVersion", "ClientKey", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/core/src/main/java/org/bitcoinj/wallet/Protos.java b/core/src/main/java/org/bitcoinj/wallet/Protos.java new file mode 100644 index 00000000..4f92dcaf --- /dev/null +++ b/core/src/main/java/org/bitcoinj/wallet/Protos.java @@ -0,0 +1,20599 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wallet.proto + +package org.bitcoinj.wallet; + +public final class Protos { + private Protos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PeerAddressOrBuilder extends + // @@protoc_insertion_point(interface_extends:wallet.PeerAddress) + com.google.protobuf.MessageOrBuilder { + + /** + * required bytes ip_address = 1; + */ + boolean hasIpAddress(); + /** + * required bytes ip_address = 1; + */ + com.google.protobuf.ByteString getIpAddress(); + + /** + * required uint32 port = 2; + */ + boolean hasPort(); + /** + * required uint32 port = 2; + */ + int getPort(); + + /** + * required uint64 services = 3; + */ + boolean hasServices(); + /** + * required uint64 services = 3; + */ + long getServices(); + } + /** + * Protobuf type {@code wallet.PeerAddress} + */ + public static final class PeerAddress extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:wallet.PeerAddress) + PeerAddressOrBuilder { + // Use PeerAddress.newBuilder() to construct. + private PeerAddress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PeerAddress() { + ipAddress_ = com.google.protobuf.ByteString.EMPTY; + port_ = 0; + services_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PeerAddress( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + ipAddress_ = input.readBytes(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + port_ = input.readUInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + services_ = input.readUInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class); + } + + private int bitField0_; + public static final int IP_ADDRESS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString ipAddress_; + /** + * required bytes ip_address = 1; + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes ip_address = 1; + */ + public com.google.protobuf.ByteString getIpAddress() { + return ipAddress_; + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + /** + * required uint32 port = 2; + */ + public boolean hasPort() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint32 port = 2; + */ + public int getPort() { + return port_; + } + + public static final int SERVICES_FIELD_NUMBER = 3; + private long services_; + /** + * required uint64 services = 3; + */ + public boolean hasServices() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 services = 3; + */ + public long getServices() { + return services_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasIpAddress()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPort()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasServices()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, ipAddress_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt32(2, port_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, services_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, ipAddress_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, port_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, services_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.wallet.Protos.PeerAddress)) { + return super.equals(obj); + } + org.bitcoinj.wallet.Protos.PeerAddress other = (org.bitcoinj.wallet.Protos.PeerAddress) obj; + + boolean result = true; + result = result && (hasIpAddress() == other.hasIpAddress()); + if (hasIpAddress()) { + result = result && getIpAddress() + .equals(other.getIpAddress()); + } + result = result && (hasPort() == other.hasPort()); + if (hasPort()) { + result = result && (getPort() + == other.getPort()); + } + result = result && (hasServices() == other.hasServices()); + if (hasServices()) { + result = result && (getServices() + == other.getServices()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasIpAddress()) { + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + } + if (hasPort()) { + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + } + if (hasServices()) { + hash = (37 * hash) + SERVICES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getServices()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.PeerAddress prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code wallet.PeerAddress} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:wallet.PeerAddress) + org.bitcoinj.wallet.Protos.PeerAddressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.PeerAddress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + ipAddress_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + port_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + services_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; + } + + public org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.PeerAddress build() { + org.bitcoinj.wallet.Protos.PeerAddress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.PeerAddress buildPartial() { + org.bitcoinj.wallet.Protos.PeerAddress result = new org.bitcoinj.wallet.Protos.PeerAddress(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.ipAddress_ = ipAddress_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.port_ = port_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.services_ = services_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.PeerAddress) { + return mergeFrom((org.bitcoinj.wallet.Protos.PeerAddress)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.PeerAddress other) { + if (other == org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()) return this; + if (other.hasIpAddress()) { + setIpAddress(other.getIpAddress()); + } + if (other.hasPort()) { + setPort(other.getPort()); + } + if (other.hasServices()) { + setServices(other.getServices()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasIpAddress()) { + return false; + } + if (!hasPort()) { + return false; + } + if (!hasServices()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.PeerAddress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.PeerAddress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString ipAddress_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes ip_address = 1; + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes ip_address = 1; + */ + public com.google.protobuf.ByteString getIpAddress() { + return ipAddress_; + } + /** + * required bytes ip_address = 1; + */ + public Builder setIpAddress(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + ipAddress_ = value; + onChanged(); + return this; + } + /** + * required bytes ip_address = 1; + */ + public Builder clearIpAddress() { + bitField0_ = (bitField0_ & ~0x00000001); + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + + private int port_ ; + /** + * required uint32 port = 2; + */ + public boolean hasPort() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint32 port = 2; + */ + public int getPort() { + return port_; + } + /** + * required uint32 port = 2; + */ + public Builder setPort(int value) { + bitField0_ |= 0x00000002; + port_ = value; + onChanged(); + return this; + } + /** + * required uint32 port = 2; + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + + private long services_ ; + /** + * required uint64 services = 3; + */ + public boolean hasServices() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 services = 3; + */ + public long getServices() { + return services_; + } + /** + * required uint64 services = 3; + */ + public Builder setServices(long value) { + bitField0_ |= 0x00000004; + services_ = value; + onChanged(); + return this; + } + /** + * required uint64 services = 3; + */ + public Builder clearServices() { + bitField0_ = (bitField0_ & ~0x00000004); + services_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:wallet.PeerAddress) + } + + // @@protoc_insertion_point(class_scope:wallet.PeerAddress) + private static final org.bitcoinj.wallet.Protos.PeerAddress DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.wallet.Protos.PeerAddress(); + } + + public static org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PeerAddress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PeerAddress(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface EncryptedDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:wallet.EncryptedData) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ * + * required bytes initialisation_vector = 1; + */ + boolean hasInitialisationVector(); + /** + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ * + * required bytes initialisation_vector = 1; + */ + com.google.protobuf.ByteString getInitialisationVector(); + + /** + *
+     * The encrypted private key
+     * 
+ * + * required bytes encrypted_private_key = 2; + */ + boolean hasEncryptedPrivateKey(); + /** + *
+     * The encrypted private key
+     * 
+ * + * required bytes encrypted_private_key = 2; + */ + com.google.protobuf.ByteString getEncryptedPrivateKey(); + } + /** + * Protobuf type {@code wallet.EncryptedData} + */ + public static final class EncryptedData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:wallet.EncryptedData) + EncryptedDataOrBuilder { + // Use EncryptedData.newBuilder() to construct. + private EncryptedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EncryptedData() { + initialisationVector_ = com.google.protobuf.ByteString.EMPTY; + encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EncryptedData( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + initialisationVector_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + encryptedPrivateKey_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedData_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.EncryptedData.class, org.bitcoinj.wallet.Protos.EncryptedData.Builder.class); + } + + private int bitField0_; + public static final int INITIALISATION_VECTOR_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString initialisationVector_; + /** + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ * + * required bytes initialisation_vector = 1; + */ + public boolean hasInitialisationVector() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ * + * required bytes initialisation_vector = 1; + */ + public com.google.protobuf.ByteString getInitialisationVector() { + return initialisationVector_; + } + + public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString encryptedPrivateKey_; + /** + *
+     * The encrypted private key
+     * 
+ * + * required bytes encrypted_private_key = 2; + */ + public boolean hasEncryptedPrivateKey() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * The encrypted private key
+     * 
+ * + * required bytes encrypted_private_key = 2; + */ + public com.google.protobuf.ByteString getEncryptedPrivateKey() { + return encryptedPrivateKey_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasInitialisationVector()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEncryptedPrivateKey()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, initialisationVector_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, encryptedPrivateKey_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, initialisationVector_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, encryptedPrivateKey_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.wallet.Protos.EncryptedData)) { + return super.equals(obj); + } + org.bitcoinj.wallet.Protos.EncryptedData other = (org.bitcoinj.wallet.Protos.EncryptedData) obj; + + boolean result = true; + result = result && (hasInitialisationVector() == other.hasInitialisationVector()); + if (hasInitialisationVector()) { + result = result && getInitialisationVector() + .equals(other.getInitialisationVector()); + } + result = result && (hasEncryptedPrivateKey() == other.hasEncryptedPrivateKey()); + if (hasEncryptedPrivateKey()) { + result = result && getEncryptedPrivateKey() + .equals(other.getEncryptedPrivateKey()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasInitialisationVector()) { + hash = (37 * hash) + INITIALISATION_VECTOR_FIELD_NUMBER; + hash = (53 * hash) + getInitialisationVector().hashCode(); + } + if (hasEncryptedPrivateKey()) { + hash = (37 * hash) + ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getEncryptedPrivateKey().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.EncryptedData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.EncryptedData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code wallet.EncryptedData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:wallet.EncryptedData) + org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedData_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.EncryptedData.class, org.bitcoinj.wallet.Protos.EncryptedData.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.EncryptedData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + initialisationVector_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedData_descriptor; + } + + public org.bitcoinj.wallet.Protos.EncryptedData getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.EncryptedData build() { + org.bitcoinj.wallet.Protos.EncryptedData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.EncryptedData buildPartial() { + org.bitcoinj.wallet.Protos.EncryptedData result = new org.bitcoinj.wallet.Protos.EncryptedData(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.initialisationVector_ = initialisationVector_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.encryptedPrivateKey_ = encryptedPrivateKey_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.EncryptedData) { + return mergeFrom((org.bitcoinj.wallet.Protos.EncryptedData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.EncryptedData other) { + if (other == org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance()) return this; + if (other.hasInitialisationVector()) { + setInitialisationVector(other.getInitialisationVector()); + } + if (other.hasEncryptedPrivateKey()) { + setEncryptedPrivateKey(other.getEncryptedPrivateKey()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasInitialisationVector()) { + return false; + } + if (!hasEncryptedPrivateKey()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.EncryptedData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.EncryptedData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString initialisationVector_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ * + * required bytes initialisation_vector = 1; + */ + public boolean hasInitialisationVector() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ * + * required bytes initialisation_vector = 1; + */ + public com.google.protobuf.ByteString getInitialisationVector() { + return initialisationVector_; + } + /** + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ * + * required bytes initialisation_vector = 1; + */ + public Builder setInitialisationVector(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + initialisationVector_ = value; + onChanged(); + return this; + } + /** + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ * + * required bytes initialisation_vector = 1; + */ + public Builder clearInitialisationVector() { + bitField0_ = (bitField0_ & ~0x00000001); + initialisationVector_ = getDefaultInstance().getInitialisationVector(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The encrypted private key
+       * 
+ * + * required bytes encrypted_private_key = 2; + */ + public boolean hasEncryptedPrivateKey() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * The encrypted private key
+       * 
+ * + * required bytes encrypted_private_key = 2; + */ + public com.google.protobuf.ByteString getEncryptedPrivateKey() { + return encryptedPrivateKey_; + } + /** + *
+       * The encrypted private key
+       * 
+ * + * required bytes encrypted_private_key = 2; + */ + public Builder setEncryptedPrivateKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + encryptedPrivateKey_ = value; + onChanged(); + return this; + } + /** + *
+       * The encrypted private key
+       * 
+ * + * required bytes encrypted_private_key = 2; + */ + public Builder clearEncryptedPrivateKey() { + bitField0_ = (bitField0_ & ~0x00000002); + encryptedPrivateKey_ = getDefaultInstance().getEncryptedPrivateKey(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:wallet.EncryptedData) + } + + // @@protoc_insertion_point(class_scope:wallet.EncryptedData) + private static final org.bitcoinj.wallet.Protos.EncryptedData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.wallet.Protos.EncryptedData(); + } + + public static org.bitcoinj.wallet.Protos.EncryptedData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public EncryptedData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EncryptedData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.wallet.Protos.EncryptedData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeterministicKeyOrBuilder extends + // @@protoc_insertion_point(interface_extends:wallet.DeterministicKey) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+     * should just treat it as a regular ORIGINAL type key.
+     * 
+ * + * required bytes chain_code = 1; + */ + boolean hasChainCode(); + /** + *
+     * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+     * should just treat it as a regular ORIGINAL type key.
+     * 
+ * + * required bytes chain_code = 1; + */ + com.google.protobuf.ByteString getChainCode(); + + /** + *
+     * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+     * and high bit unset for public derivation.
+     * 
+ * + * repeated uint32 path = 2; + */ + java.util.List getPathList(); + /** + *
+     * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+     * and high bit unset for public derivation.
+     * 
+ * + * repeated uint32 path = 2; + */ + int getPathCount(); + /** + *
+     * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+     * and high bit unset for public derivation.
+     * 
+ * + * repeated uint32 path = 2; + */ + int getPath(int index); + + /** + *
+     * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+     * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+     * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+     * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+     * If this field is missing it means we're not issuing subkeys of this key to users.
+     * 
+ * + * optional uint32 issued_subkeys = 3; + */ + boolean hasIssuedSubkeys(); + /** + *
+     * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+     * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+     * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+     * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+     * If this field is missing it means we're not issuing subkeys of this key to users.
+     * 
+ * + * optional uint32 issued_subkeys = 3; + */ + int getIssuedSubkeys(); + + /** + * optional uint32 lookahead_size = 4; + */ + boolean hasLookaheadSize(); + /** + * optional uint32 lookahead_size = 4; + */ + int getLookaheadSize(); + + /** + *
+     **
+     * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+     * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+     * a single P2SH multisignature address
+     * 
+ * + * optional bool isFollowing = 5; + */ + boolean hasIsFollowing(); + /** + *
+     **
+     * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+     * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+     * a single P2SH multisignature address
+     * 
+ * + * optional bool isFollowing = 5; + */ + boolean getIsFollowing(); + + /** + *
+     * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+     * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+     * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + boolean hasSigsRequiredToSpend(); + /** + *
+     * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+     * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+     * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + int getSigsRequiredToSpend(); + } + /** + *
+   **
+   * Data attached to a Key message that defines the data needed by the BIP32 deterministic key hierarchy algorithm.
+   * 
+ * + * Protobuf type {@code wallet.DeterministicKey} + */ + public static final class DeterministicKey extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:wallet.DeterministicKey) + DeterministicKeyOrBuilder { + // Use DeterministicKey.newBuilder() to construct. + private DeterministicKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeterministicKey() { + chainCode_ = com.google.protobuf.ByteString.EMPTY; + path_ = java.util.Collections.emptyList(); + issuedSubkeys_ = 0; + lookaheadSize_ = 0; + isFollowing_ = false; + sigsRequiredToSpend_ = 1; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeterministicKey( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + chainCode_ = input.readBytes(); + break; + } + case 16: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + path_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + path_.add(input.readUInt32()); + break; + } + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { + path_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + path_.add(input.readUInt32()); + } + input.popLimit(limit); + break; + } + case 24: { + bitField0_ |= 0x00000002; + issuedSubkeys_ = input.readUInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000004; + lookaheadSize_ = input.readUInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000008; + isFollowing_ = input.readBool(); + break; + } + case 48: { + bitField0_ |= 0x00000010; + sigsRequiredToSpend_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + path_ = java.util.Collections.unmodifiableList(path_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_DeterministicKey_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_DeterministicKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.DeterministicKey.class, org.bitcoinj.wallet.Protos.DeterministicKey.Builder.class); + } + + private int bitField0_; + public static final int CHAIN_CODE_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString chainCode_; + /** + *
+     * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+     * should just treat it as a regular ORIGINAL type key.
+     * 
+ * + * required bytes chain_code = 1; + */ + public boolean hasChainCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+     * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+     * should just treat it as a regular ORIGINAL type key.
+     * 
+ * + * required bytes chain_code = 1; + */ + public com.google.protobuf.ByteString getChainCode() { + return chainCode_; + } + + public static final int PATH_FIELD_NUMBER = 2; + private java.util.List path_; + /** + *
+     * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+     * and high bit unset for public derivation.
+     * 
+ * + * repeated uint32 path = 2; + */ + public java.util.List + getPathList() { + return path_; + } + /** + *
+     * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+     * and high bit unset for public derivation.
+     * 
+ * + * repeated uint32 path = 2; + */ + public int getPathCount() { + return path_.size(); + } + /** + *
+     * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+     * and high bit unset for public derivation.
+     * 
+ * + * repeated uint32 path = 2; + */ + public int getPath(int index) { + return path_.get(index); + } + + public static final int ISSUED_SUBKEYS_FIELD_NUMBER = 3; + private int issuedSubkeys_; + /** + *
+     * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+     * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+     * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+     * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+     * If this field is missing it means we're not issuing subkeys of this key to users.
+     * 
+ * + * optional uint32 issued_subkeys = 3; + */ + public boolean hasIssuedSubkeys() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+     * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+     * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+     * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+     * If this field is missing it means we're not issuing subkeys of this key to users.
+     * 
+ * + * optional uint32 issued_subkeys = 3; + */ + public int getIssuedSubkeys() { + return issuedSubkeys_; + } + + public static final int LOOKAHEAD_SIZE_FIELD_NUMBER = 4; + private int lookaheadSize_; + /** + * optional uint32 lookahead_size = 4; + */ + public boolean hasLookaheadSize() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional uint32 lookahead_size = 4; + */ + public int getLookaheadSize() { + return lookaheadSize_; + } + + public static final int ISFOLLOWING_FIELD_NUMBER = 5; + private boolean isFollowing_; + /** + *
+     **
+     * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+     * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+     * a single P2SH multisignature address
+     * 
+ * + * optional bool isFollowing = 5; + */ + public boolean hasIsFollowing() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     **
+     * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+     * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+     * a single P2SH multisignature address
+     * 
+ * + * optional bool isFollowing = 5; + */ + public boolean getIsFollowing() { + return isFollowing_; + } + + public static final int SIGSREQUIREDTOSPEND_FIELD_NUMBER = 6; + private int sigsRequiredToSpend_; + /** + *
+     * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+     * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+     * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + public boolean hasSigsRequiredToSpend() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+     * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+     * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + public int getSigsRequiredToSpend() { + return sigsRequiredToSpend_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasChainCode()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, chainCode_); + } + for (int i = 0; i < path_.size(); i++) { + output.writeUInt32(2, path_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt32(3, issuedSubkeys_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt32(4, lookaheadSize_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBool(5, isFollowing_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeUInt32(6, sigsRequiredToSpend_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, chainCode_); + } + { + int dataSize = 0; + for (int i = 0; i < path_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(path_.get(i)); + } + size += dataSize; + size += 1 * getPathList().size(); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, issuedSubkeys_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, lookaheadSize_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, isFollowing_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, sigsRequiredToSpend_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.wallet.Protos.DeterministicKey)) { + return super.equals(obj); + } + org.bitcoinj.wallet.Protos.DeterministicKey other = (org.bitcoinj.wallet.Protos.DeterministicKey) obj; + + boolean result = true; + result = result && (hasChainCode() == other.hasChainCode()); + if (hasChainCode()) { + result = result && getChainCode() + .equals(other.getChainCode()); + } + result = result && getPathList() + .equals(other.getPathList()); + result = result && (hasIssuedSubkeys() == other.hasIssuedSubkeys()); + if (hasIssuedSubkeys()) { + result = result && (getIssuedSubkeys() + == other.getIssuedSubkeys()); + } + result = result && (hasLookaheadSize() == other.hasLookaheadSize()); + if (hasLookaheadSize()) { + result = result && (getLookaheadSize() + == other.getLookaheadSize()); + } + result = result && (hasIsFollowing() == other.hasIsFollowing()); + if (hasIsFollowing()) { + result = result && (getIsFollowing() + == other.getIsFollowing()); + } + result = result && (hasSigsRequiredToSpend() == other.hasSigsRequiredToSpend()); + if (hasSigsRequiredToSpend()) { + result = result && (getSigsRequiredToSpend() + == other.getSigsRequiredToSpend()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasChainCode()) { + hash = (37 * hash) + CHAIN_CODE_FIELD_NUMBER; + hash = (53 * hash) + getChainCode().hashCode(); + } + if (getPathCount() > 0) { + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPathList().hashCode(); + } + if (hasIssuedSubkeys()) { + hash = (37 * hash) + ISSUED_SUBKEYS_FIELD_NUMBER; + hash = (53 * hash) + getIssuedSubkeys(); + } + if (hasLookaheadSize()) { + hash = (37 * hash) + LOOKAHEAD_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getLookaheadSize(); + } + if (hasIsFollowing()) { + hash = (37 * hash) + ISFOLLOWING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFollowing()); + } + if (hasSigsRequiredToSpend()) { + hash = (37 * hash) + SIGSREQUIREDTOSPEND_FIELD_NUMBER; + hash = (53 * hash) + getSigsRequiredToSpend(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.DeterministicKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.DeterministicKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     **
+     * Data attached to a Key message that defines the data needed by the BIP32 deterministic key hierarchy algorithm.
+     * 
+ * + * Protobuf type {@code wallet.DeterministicKey} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:wallet.DeterministicKey) + org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_DeterministicKey_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_DeterministicKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.DeterministicKey.class, org.bitcoinj.wallet.Protos.DeterministicKey.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.DeterministicKey.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + chainCode_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + path_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + issuedSubkeys_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + lookaheadSize_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + isFollowing_ = false; + bitField0_ = (bitField0_ & ~0x00000010); + sigsRequiredToSpend_ = 1; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_DeterministicKey_descriptor; + } + + public org.bitcoinj.wallet.Protos.DeterministicKey getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.DeterministicKey build() { + org.bitcoinj.wallet.Protos.DeterministicKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.DeterministicKey buildPartial() { + org.bitcoinj.wallet.Protos.DeterministicKey result = new org.bitcoinj.wallet.Protos.DeterministicKey(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.chainCode_ = chainCode_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + path_ = java.util.Collections.unmodifiableList(path_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.path_ = path_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.issuedSubkeys_ = issuedSubkeys_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.lookaheadSize_ = lookaheadSize_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.isFollowing_ = isFollowing_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000010; + } + result.sigsRequiredToSpend_ = sigsRequiredToSpend_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.DeterministicKey) { + return mergeFrom((org.bitcoinj.wallet.Protos.DeterministicKey)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.DeterministicKey other) { + if (other == org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance()) return this; + if (other.hasChainCode()) { + setChainCode(other.getChainCode()); + } + if (!other.path_.isEmpty()) { + if (path_.isEmpty()) { + path_ = other.path_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePathIsMutable(); + path_.addAll(other.path_); + } + onChanged(); + } + if (other.hasIssuedSubkeys()) { + setIssuedSubkeys(other.getIssuedSubkeys()); + } + if (other.hasLookaheadSize()) { + setLookaheadSize(other.getLookaheadSize()); + } + if (other.hasIsFollowing()) { + setIsFollowing(other.getIsFollowing()); + } + if (other.hasSigsRequiredToSpend()) { + setSigsRequiredToSpend(other.getSigsRequiredToSpend()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasChainCode()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.DeterministicKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.DeterministicKey) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString chainCode_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+       * should just treat it as a regular ORIGINAL type key.
+       * 
+ * + * required bytes chain_code = 1; + */ + public boolean hasChainCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + *
+       * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+       * should just treat it as a regular ORIGINAL type key.
+       * 
+ * + * required bytes chain_code = 1; + */ + public com.google.protobuf.ByteString getChainCode() { + return chainCode_; + } + /** + *
+       * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+       * should just treat it as a regular ORIGINAL type key.
+       * 
+ * + * required bytes chain_code = 1; + */ + public Builder setChainCode(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + chainCode_ = value; + onChanged(); + return this; + } + /** + *
+       * Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and
+       * should just treat it as a regular ORIGINAL type key.
+       * 
+ * + * required bytes chain_code = 1; + */ + public Builder clearChainCode() { + bitField0_ = (bitField0_ & ~0x00000001); + chainCode_ = getDefaultInstance().getChainCode(); + onChanged(); + return this; + } + + private java.util.List path_ = java.util.Collections.emptyList(); + private void ensurePathIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + path_ = new java.util.ArrayList(path_); + bitField0_ |= 0x00000002; + } + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public java.util.List + getPathList() { + return java.util.Collections.unmodifiableList(path_); + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public int getPathCount() { + return path_.size(); + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public int getPath(int index) { + return path_.get(index); + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public Builder setPath( + int index, int value) { + ensurePathIsMutable(); + path_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public Builder addPath(int value) { + ensurePathIsMutable(); + path_.add(value); + onChanged(); + return this; + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public Builder addAllPath( + java.lang.Iterable values) { + ensurePathIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, path_); + onChanged(); + return this; + } + /** + *
+       * The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation
+       * and high bit unset for public derivation.
+       * 
+ * + * repeated uint32 path = 2; + */ + public Builder clearPath() { + path_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private int issuedSubkeys_ ; + /** + *
+       * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+       * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+       * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+       * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+       * If this field is missing it means we're not issuing subkeys of this key to users.
+       * 
+ * + * optional uint32 issued_subkeys = 3; + */ + public boolean hasIssuedSubkeys() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+       * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+       * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+       * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+       * If this field is missing it means we're not issuing subkeys of this key to users.
+       * 
+ * + * optional uint32 issued_subkeys = 3; + */ + public int getIssuedSubkeys() { + return issuedSubkeys_; + } + /** + *
+       * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+       * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+       * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+       * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+       * If this field is missing it means we're not issuing subkeys of this key to users.
+       * 
+ * + * optional uint32 issued_subkeys = 3; + */ + public Builder setIssuedSubkeys(int value) { + bitField0_ |= 0x00000004; + issuedSubkeys_ = value; + onChanged(); + return this; + } + /** + *
+       * How many children of this key have been issued, that is, given to the user when they requested a fresh key?
+       * For the parents of keys being handed out, this is always less than the true number of children: the difference is
+       * called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of
+       * this wallet - for instance when restoring from backup or if the seed was shared between devices.
+       * If this field is missing it means we're not issuing subkeys of this key to users.
+       * 
+ * + * optional uint32 issued_subkeys = 3; + */ + public Builder clearIssuedSubkeys() { + bitField0_ = (bitField0_ & ~0x00000004); + issuedSubkeys_ = 0; + onChanged(); + return this; + } + + private int lookaheadSize_ ; + /** + * optional uint32 lookahead_size = 4; + */ + public boolean hasLookaheadSize() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional uint32 lookahead_size = 4; + */ + public int getLookaheadSize() { + return lookaheadSize_; + } + /** + * optional uint32 lookahead_size = 4; + */ + public Builder setLookaheadSize(int value) { + bitField0_ |= 0x00000008; + lookaheadSize_ = value; + onChanged(); + return this; + } + /** + * optional uint32 lookahead_size = 4; + */ + public Builder clearLookaheadSize() { + bitField0_ = (bitField0_ & ~0x00000008); + lookaheadSize_ = 0; + onChanged(); + return this; + } + + private boolean isFollowing_ ; + /** + *
+       **
+       * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+       * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+       * a single P2SH multisignature address
+       * 
+ * + * optional bool isFollowing = 5; + */ + public boolean hasIsFollowing() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       **
+       * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+       * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+       * a single P2SH multisignature address
+       * 
+ * + * optional bool isFollowing = 5; + */ + public boolean getIsFollowing() { + return isFollowing_; + } + /** + *
+       **
+       * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+       * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+       * a single P2SH multisignature address
+       * 
+ * + * optional bool isFollowing = 5; + */ + public Builder setIsFollowing(boolean value) { + bitField0_ |= 0x00000010; + isFollowing_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain.
+       * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce
+       * a single P2SH multisignature address
+       * 
+ * + * optional bool isFollowing = 5; + */ + public Builder clearIsFollowing() { + bitField0_ = (bitField0_ & ~0x00000010); + isFollowing_ = false; + onChanged(); + return this; + } + + private int sigsRequiredToSpend_ = 1; + /** + *
+       * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+       * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+       * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + public boolean hasSigsRequiredToSpend() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+       * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+       * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+       * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + public int getSigsRequiredToSpend() { + return sigsRequiredToSpend_; + } + /** + *
+       * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+       * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+       * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + public Builder setSigsRequiredToSpend(int value) { + bitField0_ |= 0x00000020; + sigsRequiredToSpend_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain
+       * and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1.
+       * 
+ * + * optional uint32 sigsRequiredToSpend = 6 [default = 1]; + */ + public Builder clearSigsRequiredToSpend() { + bitField0_ = (bitField0_ & ~0x00000020); + sigsRequiredToSpend_ = 1; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:wallet.DeterministicKey) + } + + // @@protoc_insertion_point(class_scope:wallet.DeterministicKey) + private static final org.bitcoinj.wallet.Protos.DeterministicKey DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.wallet.Protos.DeterministicKey(); + } + + public static org.bitcoinj.wallet.Protos.DeterministicKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeterministicKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeterministicKey(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.wallet.Protos.DeterministicKey getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KeyOrBuilder extends + // @@protoc_insertion_point(interface_extends:wallet.Key) + com.google.protobuf.MessageOrBuilder { + + /** + * required .wallet.Key.Type type = 1; + */ + boolean hasType(); + /** + * required .wallet.Key.Type type = 1; + */ + org.bitcoinj.wallet.Protos.Key.Type getType(); + + /** + *
+     * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+     * If the secret is encrypted, or this is a "watching entry" then this is missing.
+     * 
+ * + * optional bytes secret_bytes = 2; + */ + boolean hasSecretBytes(); + /** + *
+     * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+     * If the secret is encrypted, or this is a "watching entry" then this is missing.
+     * 
+ * + * optional bytes secret_bytes = 2; + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + *
+     * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+     * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + boolean hasEncryptedData(); + /** + *
+     * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+     * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + org.bitcoinj.wallet.Protos.EncryptedData getEncryptedData(); + /** + *
+     * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+     * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder getEncryptedDataOrBuilder(); + + /** + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+     * 
+ * + * optional bytes public_key = 3; + */ + boolean hasPublicKey(); + /** + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+     * 
+ * + * optional bytes public_key = 3; + */ + com.google.protobuf.ByteString getPublicKey(); + + /** + *
+     * User-provided label associated with the key.
+     * 
+ * + * optional string label = 4; + */ + boolean hasLabel(); + /** + *
+     * User-provided label associated with the key.
+     * 
+ * + * optional string label = 4; + */ + java.lang.String getLabel(); + /** + *
+     * User-provided label associated with the key.
+     * 
+ * + * optional string label = 4; + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+     * optional is that keys derived from a parent don't have this data.
+     * 
+ * + * optional int64 creation_timestamp = 5; + */ + boolean hasCreationTimestamp(); + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+     * optional is that keys derived from a parent don't have this data.
+     * 
+ * + * optional int64 creation_timestamp = 5; + */ + long getCreationTimestamp(); + + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + boolean hasDeterministicKey(); + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + org.bitcoinj.wallet.Protos.DeterministicKey getDeterministicKey(); + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder getDeterministicKeyOrBuilder(); + + /** + *
+     * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+     * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * optional bytes deterministic_seed = 8; + */ + boolean hasDeterministicSeed(); + /** + *
+     * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+     * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * optional bytes deterministic_seed = 8; + */ + com.google.protobuf.ByteString getDeterministicSeed(); + + /** + *
+     * Encrypted version of the seed
+     * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + boolean hasEncryptedDeterministicSeed(); + /** + *
+     * Encrypted version of the seed
+     * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + org.bitcoinj.wallet.Protos.EncryptedData getEncryptedDeterministicSeed(); + /** + *
+     * Encrypted version of the seed
+     * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder getEncryptedDeterministicSeedOrBuilder(); + + /** + *
+     * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + java.util.List getAccountPathList(); + /** + *
+     * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + int getAccountPathCount(); + /** + *
+     * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + int getAccountPath(int index); + } + /** + *
+   **
+   * A key used to control Bitcoin spending.
+   * Either the private key, the public key or both may be present.  It is recommended that
+   * if the private key is provided that the public key is provided too because deriving it is slow.
+   * If only the public key is provided, the key can only be used to watch the blockchain and verify
+   * transactions, and not for spending.
+   * 
+ * + * Protobuf type {@code wallet.Key} + */ + public static final class Key extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:wallet.Key) + KeyOrBuilder { + // Use Key.newBuilder() to construct. + private Key(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Key() { + type_ = 1; + secretBytes_ = com.google.protobuf.ByteString.EMPTY; + publicKey_ = com.google.protobuf.ByteString.EMPTY; + label_ = ""; + creationTimestamp_ = 0L; + deterministicSeed_ = com.google.protobuf.ByteString.EMPTY; + accountPath_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Key( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Key.Type value = org.bitcoinj.wallet.Protos.Key.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = rawValue; + } + break; + } + case 18: { + bitField0_ |= 0x00000002; + secretBytes_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000008; + publicKey_ = input.readBytes(); + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + label_ = bs; + break; + } + case 40: { + bitField0_ |= 0x00000020; + creationTimestamp_ = input.readInt64(); + break; + } + case 50: { + org.bitcoinj.wallet.Protos.EncryptedData.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = encryptedData_.toBuilder(); + } + encryptedData_ = input.readMessage(org.bitcoinj.wallet.Protos.EncryptedData.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptedData_); + encryptedData_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 58: { + org.bitcoinj.wallet.Protos.DeterministicKey.Builder subBuilder = null; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + subBuilder = deterministicKey_.toBuilder(); + } + deterministicKey_ = input.readMessage(org.bitcoinj.wallet.Protos.DeterministicKey.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deterministicKey_); + deterministicKey_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000040; + break; + } + case 66: { + bitField0_ |= 0x00000080; + deterministicSeed_ = input.readBytes(); + break; + } + case 74: { + org.bitcoinj.wallet.Protos.EncryptedData.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = encryptedDeterministicSeed_.toBuilder(); + } + encryptedDeterministicSeed_ = input.readMessage(org.bitcoinj.wallet.Protos.EncryptedData.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptedDeterministicSeed_); + encryptedDeterministicSeed_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + case 80: { + if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { + accountPath_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + accountPath_.add(input.readUInt32()); + break; + } + case 82: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000200) == 0x00000200) && input.getBytesUntilLimit() > 0) { + accountPath_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + while (input.getBytesUntilLimit() > 0) { + accountPath_.add(input.readUInt32()); + } + input.popLimit(limit); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) { + accountPath_ = java.util.Collections.unmodifiableList(accountPath_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class); + } + + /** + * Protobuf enum {@code wallet.Key.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       ** Unencrypted - Original bitcoin secp256k1 curve 
+       * 
+ * + * ORIGINAL = 1; + */ + ORIGINAL(1), + /** + *
+       ** Encrypted with Scrypt and AES - Original bitcoin secp256k1 curve 
+       * 
+ * + * ENCRYPTED_SCRYPT_AES = 2; + */ + ENCRYPTED_SCRYPT_AES(2), + /** + *
+       **
+       * Not really a key, but rather contains the mnemonic phrase for a deterministic key hierarchy in the private_key field.
+       * The label and public_key fields are missing. Creation timestamp will exist.
+       * 
+ * + * DETERMINISTIC_MNEMONIC = 3; + */ + DETERMINISTIC_MNEMONIC(3), + /** + *
+       **
+       * A key that was derived deterministically. Note that the root seed that created it may NOT be present in the
+       * wallet, for the case of watching wallets. A deterministic key may or may not have the private key bytes present.
+       * However the public key bytes and the deterministic_key field are guaranteed to exist. In a wallet where there
+       * is a path from this key up to a key that has (possibly encrypted) private bytes, it's expected that the private
+       * key can be rederived on the fly.
+       * 
+ * + * DETERMINISTIC_KEY = 4; + */ + DETERMINISTIC_KEY(4), + ; + + /** + *
+       ** Unencrypted - Original bitcoin secp256k1 curve 
+       * 
+ * + * ORIGINAL = 1; + */ + public static final int ORIGINAL_VALUE = 1; + /** + *
+       ** Encrypted with Scrypt and AES - Original bitcoin secp256k1 curve 
+       * 
+ * + * ENCRYPTED_SCRYPT_AES = 2; + */ + public static final int ENCRYPTED_SCRYPT_AES_VALUE = 2; + /** + *
+       **
+       * Not really a key, but rather contains the mnemonic phrase for a deterministic key hierarchy in the private_key field.
+       * The label and public_key fields are missing. Creation timestamp will exist.
+       * 
+ * + * DETERMINISTIC_MNEMONIC = 3; + */ + public static final int DETERMINISTIC_MNEMONIC_VALUE = 3; + /** + *
+       **
+       * A key that was derived deterministically. Note that the root seed that created it may NOT be present in the
+       * wallet, for the case of watching wallets. A deterministic key may or may not have the private key bytes present.
+       * However the public key bytes and the deterministic_key field are guaranteed to exist. In a wallet where there
+       * is a path from this key up to a key that has (possibly encrypted) private bytes, it's expected that the private
+       * key can be rederived on the fly.
+       * 
+ * + * DETERMINISTIC_KEY = 4; + */ + public static final int DETERMINISTIC_KEY_VALUE = 4; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + public static Type forNumber(int value) { + switch (value) { + case 1: return ORIGINAL; + case 2: return ENCRYPTED_SCRYPT_AES; + case 3: return DETERMINISTIC_MNEMONIC; + case 4: return DETERMINISTIC_KEY; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.Key.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:wallet.Key.Type) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * required .wallet.Key.Type type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .wallet.Key.Type type = 1; + */ + public org.bitcoinj.wallet.Protos.Key.Type getType() { + org.bitcoinj.wallet.Protos.Key.Type result = org.bitcoinj.wallet.Protos.Key.Type.valueOf(type_); + return result == null ? org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL : result; + } + + public static final int SECRET_BYTES_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString secretBytes_; + /** + *
+     * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+     * If the secret is encrypted, or this is a "watching entry" then this is missing.
+     * 
+ * + * optional bytes secret_bytes = 2; + */ + public boolean hasSecretBytes() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+     * If the secret is encrypted, or this is a "watching entry" then this is missing.
+     * 
+ * + * optional bytes secret_bytes = 2; + */ + public com.google.protobuf.ByteString getSecretBytes() { + return secretBytes_; + } + + public static final int ENCRYPTED_DATA_FIELD_NUMBER = 6; + private org.bitcoinj.wallet.Protos.EncryptedData encryptedData_; + /** + *
+     * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+     * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public boolean hasEncryptedData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+     * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public org.bitcoinj.wallet.Protos.EncryptedData getEncryptedData() { + return encryptedData_ == null ? org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedData_; + } + /** + *
+     * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+     * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder getEncryptedDataOrBuilder() { + return encryptedData_ == null ? org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedData_; + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString publicKey_; + /** + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+     * 
+ * + * optional bytes public_key = 3; + */ + public boolean hasPublicKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+     * 
+ * + * optional bytes public_key = 3; + */ + public com.google.protobuf.ByteString getPublicKey() { + return publicKey_; + } + + public static final int LABEL_FIELD_NUMBER = 4; + private volatile java.lang.Object label_; + /** + *
+     * User-provided label associated with the key.
+     * 
+ * + * optional string label = 4; + */ + public boolean hasLabel() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * User-provided label associated with the key.
+     * 
+ * + * optional string label = 4; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + label_ = s; + } + return s; + } + } + /** + *
+     * User-provided label associated with the key.
+     * 
+ * + * optional string label = 4; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 5; + private long creationTimestamp_; + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+     * optional is that keys derived from a parent don't have this data.
+     * 
+ * + * optional int64 creation_timestamp = 5; + */ + public boolean hasCreationTimestamp() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+     * optional is that keys derived from a parent don't have this data.
+     * 
+ * + * optional int64 creation_timestamp = 5; + */ + public long getCreationTimestamp() { + return creationTimestamp_; + } + + public static final int DETERMINISTIC_KEY_FIELD_NUMBER = 7; + private org.bitcoinj.wallet.Protos.DeterministicKey deterministicKey_; + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public boolean hasDeterministicKey() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public org.bitcoinj.wallet.Protos.DeterministicKey getDeterministicKey() { + return deterministicKey_ == null ? org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance() : deterministicKey_; + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder getDeterministicKeyOrBuilder() { + return deterministicKey_ == null ? org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance() : deterministicKey_; + } + + public static final int DETERMINISTIC_SEED_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString deterministicSeed_; + /** + *
+     * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+     * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * optional bytes deterministic_seed = 8; + */ + public boolean hasDeterministicSeed() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+     * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+     * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * optional bytes deterministic_seed = 8; + */ + public com.google.protobuf.ByteString getDeterministicSeed() { + return deterministicSeed_; + } + + public static final int ENCRYPTED_DETERMINISTIC_SEED_FIELD_NUMBER = 9; + private org.bitcoinj.wallet.Protos.EncryptedData encryptedDeterministicSeed_; + /** + *
+     * Encrypted version of the seed
+     * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public boolean hasEncryptedDeterministicSeed() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + *
+     * Encrypted version of the seed
+     * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public org.bitcoinj.wallet.Protos.EncryptedData getEncryptedDeterministicSeed() { + return encryptedDeterministicSeed_ == null ? org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedDeterministicSeed_; + } + /** + *
+     * Encrypted version of the seed
+     * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder getEncryptedDeterministicSeedOrBuilder() { + return encryptedDeterministicSeed_ == null ? org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedDeterministicSeed_; + } + + public static final int ACCOUNT_PATH_FIELD_NUMBER = 10; + private java.util.List accountPath_; + /** + *
+     * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public java.util.List + getAccountPathList() { + return accountPath_; + } + /** + *
+     * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public int getAccountPathCount() { + return accountPath_.size(); + } + /** + *
+     * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+     * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public int getAccountPath(int index) { + return accountPath_.get(index); + } + private int accountPathMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasType()) { + memoizedIsInitialized = 0; + return false; + } + if (hasEncryptedData()) { + if (!getEncryptedData().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDeterministicKey()) { + if (!getDeterministicKey().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasEncryptedDeterministicSeed()) { + if (!getEncryptedDeterministicSeed().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, secretBytes_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(3, publicKey_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, label_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt64(5, creationTimestamp_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(6, getEncryptedData()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeMessage(7, getDeterministicKey()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBytes(8, deterministicSeed_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeMessage(9, getEncryptedDeterministicSeed()); + } + if (getAccountPathList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(accountPathMemoizedSerializedSize); + } + for (int i = 0; i < accountPath_.size(); i++) { + output.writeUInt32NoTag(accountPath_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, secretBytes_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, publicKey_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, label_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, creationTimestamp_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getEncryptedData()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getDeterministicKey()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, deterministicSeed_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getEncryptedDeterministicSeed()); + } + { + int dataSize = 0; + for (int i = 0; i < accountPath_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(accountPath_.get(i)); + } + size += dataSize; + if (!getAccountPathList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + accountPathMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.wallet.Protos.Key)) { + return super.equals(obj); + } + org.bitcoinj.wallet.Protos.Key other = (org.bitcoinj.wallet.Protos.Key) obj; + + boolean result = true; + result = result && (hasType() == other.hasType()); + if (hasType()) { + result = result && type_ == other.type_; + } + result = result && (hasSecretBytes() == other.hasSecretBytes()); + if (hasSecretBytes()) { + result = result && getSecretBytes() + .equals(other.getSecretBytes()); + } + result = result && (hasEncryptedData() == other.hasEncryptedData()); + if (hasEncryptedData()) { + result = result && getEncryptedData() + .equals(other.getEncryptedData()); + } + result = result && (hasPublicKey() == other.hasPublicKey()); + if (hasPublicKey()) { + result = result && getPublicKey() + .equals(other.getPublicKey()); + } + result = result && (hasLabel() == other.hasLabel()); + if (hasLabel()) { + result = result && getLabel() + .equals(other.getLabel()); + } + result = result && (hasCreationTimestamp() == other.hasCreationTimestamp()); + if (hasCreationTimestamp()) { + result = result && (getCreationTimestamp() + == other.getCreationTimestamp()); + } + result = result && (hasDeterministicKey() == other.hasDeterministicKey()); + if (hasDeterministicKey()) { + result = result && getDeterministicKey() + .equals(other.getDeterministicKey()); + } + result = result && (hasDeterministicSeed() == other.hasDeterministicSeed()); + if (hasDeterministicSeed()) { + result = result && getDeterministicSeed() + .equals(other.getDeterministicSeed()); + } + result = result && (hasEncryptedDeterministicSeed() == other.hasEncryptedDeterministicSeed()); + if (hasEncryptedDeterministicSeed()) { + result = result && getEncryptedDeterministicSeed() + .equals(other.getEncryptedDeterministicSeed()); + } + result = result && getAccountPathList() + .equals(other.getAccountPathList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (hasSecretBytes()) { + hash = (37 * hash) + SECRET_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getSecretBytes().hashCode(); + } + if (hasEncryptedData()) { + hash = (37 * hash) + ENCRYPTED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getEncryptedData().hashCode(); + } + if (hasPublicKey()) { + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + } + if (hasLabel()) { + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + } + if (hasCreationTimestamp()) { + hash = (37 * hash) + CREATION_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreationTimestamp()); + } + if (hasDeterministicKey()) { + hash = (37 * hash) + DETERMINISTIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getDeterministicKey().hashCode(); + } + if (hasDeterministicSeed()) { + hash = (37 * hash) + DETERMINISTIC_SEED_FIELD_NUMBER; + hash = (53 * hash) + getDeterministicSeed().hashCode(); + } + if (hasEncryptedDeterministicSeed()) { + hash = (37 * hash) + ENCRYPTED_DETERMINISTIC_SEED_FIELD_NUMBER; + hash = (53 * hash) + getEncryptedDeterministicSeed().hashCode(); + } + if (getAccountPathCount() > 0) { + hash = (37 * hash) + ACCOUNT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getAccountPathList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Key prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     **
+     * A key used to control Bitcoin spending.
+     * Either the private key, the public key or both may be present.  It is recommended that
+     * if the private key is provided that the public key is provided too because deriving it is slow.
+     * If only the public key is provided, the key can only be used to watch the blockchain and verify
+     * transactions, and not for spending.
+     * 
+ * + * Protobuf type {@code wallet.Key} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:wallet.Key) + org.bitcoinj.wallet.Protos.KeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.Key.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEncryptedDataFieldBuilder(); + getDeterministicKeyFieldBuilder(); + getEncryptedDeterministicSeedFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + type_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + secretBytes_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (encryptedDataBuilder_ == null) { + encryptedData_ = null; + } else { + encryptedDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + publicKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + label_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + creationTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000020); + if (deterministicKeyBuilder_ == null) { + deterministicKey_ = null; + } else { + deterministicKeyBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + deterministicSeed_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + if (encryptedDeterministicSeedBuilder_ == null) { + encryptedDeterministicSeed_ = null; + } else { + encryptedDeterministicSeedBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + accountPath_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; + } + + public org.bitcoinj.wallet.Protos.Key getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.Key.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.Key build() { + org.bitcoinj.wallet.Protos.Key result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.Key buildPartial() { + org.bitcoinj.wallet.Protos.Key result = new org.bitcoinj.wallet.Protos.Key(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.secretBytes_ = secretBytes_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (encryptedDataBuilder_ == null) { + result.encryptedData_ = encryptedData_; + } else { + result.encryptedData_ = encryptedDataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.publicKey_ = publicKey_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.label_ = label_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.creationTimestamp_ = creationTimestamp_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + if (deterministicKeyBuilder_ == null) { + result.deterministicKey_ = deterministicKey_; + } else { + result.deterministicKey_ = deterministicKeyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.deterministicSeed_ = deterministicSeed_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + if (encryptedDeterministicSeedBuilder_ == null) { + result.encryptedDeterministicSeed_ = encryptedDeterministicSeed_; + } else { + result.encryptedDeterministicSeed_ = encryptedDeterministicSeedBuilder_.build(); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + accountPath_ = java.util.Collections.unmodifiableList(accountPath_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.accountPath_ = accountPath_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.Key) { + return mergeFrom((org.bitcoinj.wallet.Protos.Key)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Key other) { + if (other == org.bitcoinj.wallet.Protos.Key.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasSecretBytes()) { + setSecretBytes(other.getSecretBytes()); + } + if (other.hasEncryptedData()) { + mergeEncryptedData(other.getEncryptedData()); + } + if (other.hasPublicKey()) { + setPublicKey(other.getPublicKey()); + } + if (other.hasLabel()) { + bitField0_ |= 0x00000010; + label_ = other.label_; + onChanged(); + } + if (other.hasCreationTimestamp()) { + setCreationTimestamp(other.getCreationTimestamp()); + } + if (other.hasDeterministicKey()) { + mergeDeterministicKey(other.getDeterministicKey()); + } + if (other.hasDeterministicSeed()) { + setDeterministicSeed(other.getDeterministicSeed()); + } + if (other.hasEncryptedDeterministicSeed()) { + mergeEncryptedDeterministicSeed(other.getEncryptedDeterministicSeed()); + } + if (!other.accountPath_.isEmpty()) { + if (accountPath_.isEmpty()) { + accountPath_ = other.accountPath_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureAccountPathIsMutable(); + accountPath_.addAll(other.accountPath_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasType()) { + return false; + } + if (hasEncryptedData()) { + if (!getEncryptedData().isInitialized()) { + return false; + } + } + if (hasDeterministicKey()) { + if (!getDeterministicKey().isInitialized()) { + return false; + } + } + if (hasEncryptedDeterministicSeed()) { + if (!getEncryptedDeterministicSeed().isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.Key parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.Key) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int type_ = 1; + /** + * required .wallet.Key.Type type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .wallet.Key.Type type = 1; + */ + public org.bitcoinj.wallet.Protos.Key.Type getType() { + org.bitcoinj.wallet.Protos.Key.Type result = org.bitcoinj.wallet.Protos.Key.Type.valueOf(type_); + return result == null ? org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL : result; + } + /** + * required .wallet.Key.Type type = 1; + */ + public Builder setType(org.bitcoinj.wallet.Protos.Key.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * required .wallet.Key.Type type = 1; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 1; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString secretBytes_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+       * If the secret is encrypted, or this is a "watching entry" then this is missing.
+       * 
+ * + * optional bytes secret_bytes = 2; + */ + public boolean hasSecretBytes() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+       * If the secret is encrypted, or this is a "watching entry" then this is missing.
+       * 
+ * + * optional bytes secret_bytes = 2; + */ + public com.google.protobuf.ByteString getSecretBytes() { + return secretBytes_; + } + /** + *
+       * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+       * If the secret is encrypted, or this is a "watching entry" then this is missing.
+       * 
+ * + * optional bytes secret_bytes = 2; + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + secretBytes_ = value; + onChanged(); + return this; + } + /** + *
+       * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.
+       * If the secret is encrypted, or this is a "watching entry" then this is missing.
+       * 
+ * + * optional bytes secret_bytes = 2; + */ + public Builder clearSecretBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + secretBytes_ = getDefaultInstance().getSecretBytes(); + onChanged(); + return this; + } + + private org.bitcoinj.wallet.Protos.EncryptedData encryptedData_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.EncryptedData, org.bitcoinj.wallet.Protos.EncryptedData.Builder, org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder> encryptedDataBuilder_; + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public boolean hasEncryptedData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public org.bitcoinj.wallet.Protos.EncryptedData getEncryptedData() { + if (encryptedDataBuilder_ == null) { + return encryptedData_ == null ? org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedData_; + } else { + return encryptedDataBuilder_.getMessage(); + } + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public Builder setEncryptedData(org.bitcoinj.wallet.Protos.EncryptedData value) { + if (encryptedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptedData_ = value; + onChanged(); + } else { + encryptedDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public Builder setEncryptedData( + org.bitcoinj.wallet.Protos.EncryptedData.Builder builderForValue) { + if (encryptedDataBuilder_ == null) { + encryptedData_ = builderForValue.build(); + onChanged(); + } else { + encryptedDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public Builder mergeEncryptedData(org.bitcoinj.wallet.Protos.EncryptedData value) { + if (encryptedDataBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + encryptedData_ != null && + encryptedData_ != org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance()) { + encryptedData_ = + org.bitcoinj.wallet.Protos.EncryptedData.newBuilder(encryptedData_).mergeFrom(value).buildPartial(); + } else { + encryptedData_ = value; + } + onChanged(); + } else { + encryptedDataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public Builder clearEncryptedData() { + if (encryptedDataBuilder_ == null) { + encryptedData_ = null; + onChanged(); + } else { + encryptedDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public org.bitcoinj.wallet.Protos.EncryptedData.Builder getEncryptedDataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEncryptedDataFieldBuilder().getBuilder(); + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + public org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder getEncryptedDataOrBuilder() { + if (encryptedDataBuilder_ != null) { + return encryptedDataBuilder_.getMessageOrBuilder(); + } else { + return encryptedData_ == null ? + org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedData_; + } + } + /** + *
+       * If the secret data is encrypted, then secret_bytes is missing and this field is set.
+       * 
+ * + * optional .wallet.EncryptedData encrypted_data = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.EncryptedData, org.bitcoinj.wallet.Protos.EncryptedData.Builder, org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder> + getEncryptedDataFieldBuilder() { + if (encryptedDataBuilder_ == null) { + encryptedDataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.EncryptedData, org.bitcoinj.wallet.Protos.EncryptedData.Builder, org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder>( + getEncryptedData(), + getParentForChildren(), + isClean()); + encryptedData_ = null; + } + return encryptedDataBuilder_; + } + + private com.google.protobuf.ByteString publicKey_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+       * 
+ * + * optional bytes public_key = 3; + */ + public boolean hasPublicKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+       * 
+ * + * optional bytes public_key = 3; + */ + public com.google.protobuf.ByteString getPublicKey() { + return publicKey_; + } + /** + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+       * 
+ * + * optional bytes public_key = 3; + */ + public Builder setPublicKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + publicKey_ = value; + onChanged(); + return this; + } + /** + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing.
+       * 
+ * + * optional bytes public_key = 3; + */ + public Builder clearPublicKey() { + bitField0_ = (bitField0_ & ~0x00000008); + publicKey_ = getDefaultInstance().getPublicKey(); + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+       * User-provided label associated with the key.
+       * 
+ * + * optional string label = 4; + */ + public boolean hasLabel() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       * User-provided label associated with the key.
+       * 
+ * + * optional string label = 4; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + label_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * User-provided label associated with the key.
+       * 
+ * + * optional string label = 4; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * User-provided label associated with the key.
+       * 
+ * + * optional string label = 4; + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + label_ = value; + onChanged(); + return this; + } + /** + *
+       * User-provided label associated with the key.
+       * 
+ * + * optional string label = 4; + */ + public Builder clearLabel() { + bitField0_ = (bitField0_ & ~0x00000010); + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+       * User-provided label associated with the key.
+       * 
+ * + * optional string label = 4; + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + label_ = value; + onChanged(); + return this; + } + + private long creationTimestamp_ ; + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+       * optional is that keys derived from a parent don't have this data.
+       * 
+ * + * optional int64 creation_timestamp = 5; + */ + public boolean hasCreationTimestamp() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+       * optional is that keys derived from a parent don't have this data.
+       * 
+ * + * optional int64 creation_timestamp = 5; + */ + public long getCreationTimestamp() { + return creationTimestamp_; + } + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+       * optional is that keys derived from a parent don't have this data.
+       * 
+ * + * optional int64 creation_timestamp = 5; + */ + public Builder setCreationTimestamp(long value) { + bitField0_ |= 0x00000020; + creationTimestamp_ = value; + onChanged(); + return this; + } + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's
+       * optional is that keys derived from a parent don't have this data.
+       * 
+ * + * optional int64 creation_timestamp = 5; + */ + public Builder clearCreationTimestamp() { + bitField0_ = (bitField0_ & ~0x00000020); + creationTimestamp_ = 0L; + onChanged(); + return this; + } + + private org.bitcoinj.wallet.Protos.DeterministicKey deterministicKey_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.DeterministicKey, org.bitcoinj.wallet.Protos.DeterministicKey.Builder, org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder> deterministicKeyBuilder_; + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public boolean hasDeterministicKey() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public org.bitcoinj.wallet.Protos.DeterministicKey getDeterministicKey() { + if (deterministicKeyBuilder_ == null) { + return deterministicKey_ == null ? org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance() : deterministicKey_; + } else { + return deterministicKeyBuilder_.getMessage(); + } + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public Builder setDeterministicKey(org.bitcoinj.wallet.Protos.DeterministicKey value) { + if (deterministicKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deterministicKey_ = value; + onChanged(); + } else { + deterministicKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public Builder setDeterministicKey( + org.bitcoinj.wallet.Protos.DeterministicKey.Builder builderForValue) { + if (deterministicKeyBuilder_ == null) { + deterministicKey_ = builderForValue.build(); + onChanged(); + } else { + deterministicKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public Builder mergeDeterministicKey(org.bitcoinj.wallet.Protos.DeterministicKey value) { + if (deterministicKeyBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040) && + deterministicKey_ != null && + deterministicKey_ != org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance()) { + deterministicKey_ = + org.bitcoinj.wallet.Protos.DeterministicKey.newBuilder(deterministicKey_).mergeFrom(value).buildPartial(); + } else { + deterministicKey_ = value; + } + onChanged(); + } else { + deterministicKeyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public Builder clearDeterministicKey() { + if (deterministicKeyBuilder_ == null) { + deterministicKey_ = null; + onChanged(); + } else { + deterministicKeyBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public org.bitcoinj.wallet.Protos.DeterministicKey.Builder getDeterministicKeyBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getDeterministicKeyFieldBuilder().getBuilder(); + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + public org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder getDeterministicKeyOrBuilder() { + if (deterministicKeyBuilder_ != null) { + return deterministicKeyBuilder_.getMessageOrBuilder(); + } else { + return deterministicKey_ == null ? + org.bitcoinj.wallet.Protos.DeterministicKey.getDefaultInstance() : deterministicKey_; + } + } + /** + * optional .wallet.DeterministicKey deterministic_key = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.DeterministicKey, org.bitcoinj.wallet.Protos.DeterministicKey.Builder, org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder> + getDeterministicKeyFieldBuilder() { + if (deterministicKeyBuilder_ == null) { + deterministicKeyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.DeterministicKey, org.bitcoinj.wallet.Protos.DeterministicKey.Builder, org.bitcoinj.wallet.Protos.DeterministicKeyOrBuilder>( + getDeterministicKey(), + getParentForChildren(), + isClean()); + deterministicKey_ = null; + } + return deterministicKeyBuilder_; + } + + private com.google.protobuf.ByteString deterministicSeed_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+       * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * optional bytes deterministic_seed = 8; + */ + public boolean hasDeterministicSeed() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + *
+       * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+       * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * optional bytes deterministic_seed = 8; + */ + public com.google.protobuf.ByteString getDeterministicSeed() { + return deterministicSeed_; + } + /** + *
+       * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+       * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * optional bytes deterministic_seed = 8; + */ + public Builder setDeterministicSeed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + deterministicSeed_ = value; + onChanged(); + return this; + } + /** + *
+       * The seed for a deterministic key hierarchy.  Derived from the mnemonic,
+       * but cached here for quick startup.  Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * optional bytes deterministic_seed = 8; + */ + public Builder clearDeterministicSeed() { + bitField0_ = (bitField0_ & ~0x00000080); + deterministicSeed_ = getDefaultInstance().getDeterministicSeed(); + onChanged(); + return this; + } + + private org.bitcoinj.wallet.Protos.EncryptedData encryptedDeterministicSeed_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.EncryptedData, org.bitcoinj.wallet.Protos.EncryptedData.Builder, org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder> encryptedDeterministicSeedBuilder_; + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public boolean hasEncryptedDeterministicSeed() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public org.bitcoinj.wallet.Protos.EncryptedData getEncryptedDeterministicSeed() { + if (encryptedDeterministicSeedBuilder_ == null) { + return encryptedDeterministicSeed_ == null ? org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedDeterministicSeed_; + } else { + return encryptedDeterministicSeedBuilder_.getMessage(); + } + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public Builder setEncryptedDeterministicSeed(org.bitcoinj.wallet.Protos.EncryptedData value) { + if (encryptedDeterministicSeedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptedDeterministicSeed_ = value; + onChanged(); + } else { + encryptedDeterministicSeedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public Builder setEncryptedDeterministicSeed( + org.bitcoinj.wallet.Protos.EncryptedData.Builder builderForValue) { + if (encryptedDeterministicSeedBuilder_ == null) { + encryptedDeterministicSeed_ = builderForValue.build(); + onChanged(); + } else { + encryptedDeterministicSeedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + return this; + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public Builder mergeEncryptedDeterministicSeed(org.bitcoinj.wallet.Protos.EncryptedData value) { + if (encryptedDeterministicSeedBuilder_ == null) { + if (((bitField0_ & 0x00000100) == 0x00000100) && + encryptedDeterministicSeed_ != null && + encryptedDeterministicSeed_ != org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance()) { + encryptedDeterministicSeed_ = + org.bitcoinj.wallet.Protos.EncryptedData.newBuilder(encryptedDeterministicSeed_).mergeFrom(value).buildPartial(); + } else { + encryptedDeterministicSeed_ = value; + } + onChanged(); + } else { + encryptedDeterministicSeedBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public Builder clearEncryptedDeterministicSeed() { + if (encryptedDeterministicSeedBuilder_ == null) { + encryptedDeterministicSeed_ = null; + onChanged(); + } else { + encryptedDeterministicSeedBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public org.bitcoinj.wallet.Protos.EncryptedData.Builder getEncryptedDeterministicSeedBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getEncryptedDeterministicSeedFieldBuilder().getBuilder(); + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + public org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder getEncryptedDeterministicSeedOrBuilder() { + if (encryptedDeterministicSeedBuilder_ != null) { + return encryptedDeterministicSeedBuilder_.getMessageOrBuilder(); + } else { + return encryptedDeterministicSeed_ == null ? + org.bitcoinj.wallet.Protos.EncryptedData.getDefaultInstance() : encryptedDeterministicSeed_; + } + } + /** + *
+       * Encrypted version of the seed
+       * 
+ * + * optional .wallet.EncryptedData encrypted_deterministic_seed = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.EncryptedData, org.bitcoinj.wallet.Protos.EncryptedData.Builder, org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder> + getEncryptedDeterministicSeedFieldBuilder() { + if (encryptedDeterministicSeedBuilder_ == null) { + encryptedDeterministicSeedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.bitcoinj.wallet.Protos.EncryptedData, org.bitcoinj.wallet.Protos.EncryptedData.Builder, org.bitcoinj.wallet.Protos.EncryptedDataOrBuilder>( + getEncryptedDeterministicSeed(), + getParentForChildren(), + isClean()); + encryptedDeterministicSeed_ = null; + } + return encryptedDeterministicSeedBuilder_; + } + + private java.util.List accountPath_ = java.util.Collections.emptyList(); + private void ensureAccountPathIsMutable() { + if (!((bitField0_ & 0x00000200) == 0x00000200)) { + accountPath_ = new java.util.ArrayList(accountPath_); + bitField0_ |= 0x00000200; + } + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public java.util.List + getAccountPathList() { + return java.util.Collections.unmodifiableList(accountPath_); + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public int getAccountPathCount() { + return accountPath_.size(); + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public int getAccountPath(int index) { + return accountPath_.get(index); + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public Builder setAccountPath( + int index, int value) { + ensureAccountPathIsMutable(); + accountPath_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public Builder addAccountPath(int value) { + ensureAccountPathIsMutable(); + accountPath_.add(value); + onChanged(); + return this; + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public Builder addAllAccountPath( + java.lang.Iterable values) { + ensureAccountPathIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, accountPath_); + onChanged(); + return this; + } + /** + *
+       * The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
+       * 
+ * + * repeated uint32 account_path = 10 [packed = true]; + */ + public Builder clearAccountPath() { + accountPath_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:wallet.Key) + } + + // @@protoc_insertion_point(class_scope:wallet.Key) + private static final org.bitcoinj.wallet.Protos.Key DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.wallet.Protos.Key(); + } + + public static org.bitcoinj.wallet.Protos.Key getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Key parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Key(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.bitcoinj.wallet.Protos.Key getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ScriptOrBuilder extends + // @@protoc_insertion_point(interface_extends:wallet.Script) + com.google.protobuf.MessageOrBuilder { + + /** + * required bytes program = 1; + */ + boolean hasProgram(); + /** + * required bytes program = 1; + */ + com.google.protobuf.ByteString getProgram(); + + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+     * when watching for scripts on the blockchain.
+     * 
+ * + * required int64 creation_timestamp = 2; + */ + boolean hasCreationTimestamp(); + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+     * when watching for scripts on the blockchain.
+     * 
+ * + * required int64 creation_timestamp = 2; + */ + long getCreationTimestamp(); + } + /** + * Protobuf type {@code wallet.Script} + */ + public static final class Script extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:wallet.Script) + ScriptOrBuilder { + // Use Script.newBuilder() to construct. + private Script(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Script() { + program_ = com.google.protobuf.ByteString.EMPTY; + creationTimestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Script( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + program_ = input.readBytes(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + creationTimestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Script_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Script_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Script.class, org.bitcoinj.wallet.Protos.Script.Builder.class); + } + + private int bitField0_; + public static final int PROGRAM_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString program_; + /** + * required bytes program = 1; + */ + public boolean hasProgram() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes program = 1; + */ + public com.google.protobuf.ByteString getProgram() { + return program_; + } + + public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 2; + private long creationTimestamp_; + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+     * when watching for scripts on the blockchain.
+     * 
+ * + * required int64 creation_timestamp = 2; + */ + public boolean hasCreationTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+     * when watching for scripts on the blockchain.
+     * 
+ * + * required int64 creation_timestamp = 2; + */ + public long getCreationTimestamp() { + return creationTimestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasProgram()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCreationTimestamp()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, program_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, creationTimestamp_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, program_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, creationTimestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.bitcoinj.wallet.Protos.Script)) { + return super.equals(obj); + } + org.bitcoinj.wallet.Protos.Script other = (org.bitcoinj.wallet.Protos.Script) obj; + + boolean result = true; + result = result && (hasProgram() == other.hasProgram()); + if (hasProgram()) { + result = result && getProgram() + .equals(other.getProgram()); + } + result = result && (hasCreationTimestamp() == other.hasCreationTimestamp()); + if (hasCreationTimestamp()) { + result = result && (getCreationTimestamp() + == other.getCreationTimestamp()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasProgram()) { + hash = (37 * hash) + PROGRAM_FIELD_NUMBER; + hash = (53 * hash) + getProgram().hashCode(); + } + if (hasCreationTimestamp()) { + hash = (37 * hash) + CREATION_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreationTimestamp()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.bitcoinj.wallet.Protos.Script parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Script parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.Script parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.bitcoinj.wallet.Protos.Script parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Script prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code wallet.Script} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:wallet.Script) + org.bitcoinj.wallet.Protos.ScriptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Script_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Script_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Script.class, org.bitcoinj.wallet.Protos.Script.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.Script.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + program_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + creationTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Script_descriptor; + } + + public org.bitcoinj.wallet.Protos.Script getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.Script.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.Script build() { + org.bitcoinj.wallet.Protos.Script result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.Script buildPartial() { + org.bitcoinj.wallet.Protos.Script result = new org.bitcoinj.wallet.Protos.Script(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.program_ = program_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.creationTimestamp_ = creationTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.Script) { + return mergeFrom((org.bitcoinj.wallet.Protos.Script)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Script other) { + if (other == org.bitcoinj.wallet.Protos.Script.getDefaultInstance()) return this; + if (other.hasProgram()) { + setProgram(other.getProgram()); + } + if (other.hasCreationTimestamp()) { + setCreationTimestamp(other.getCreationTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasProgram()) { + return false; + } + if (!hasCreationTimestamp()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.Script parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.Script) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString program_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes program = 1; + */ + public boolean hasProgram() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes program = 1; + */ + public com.google.protobuf.ByteString getProgram() { + return program_; + } + /** + * required bytes program = 1; + */ + public Builder setProgram(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + program_ = value; + onChanged(); + return this; + } + /** + * required bytes program = 1; + */ + public Builder clearProgram() { + bitField0_ = (bitField0_ & ~0x00000001); + program_ = getDefaultInstance().getProgram(); + onChanged(); + return this; + } + + private long creationTimestamp_ ; + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+       * when watching for scripts on the blockchain.
+       * 
+ * + * required int64 creation_timestamp = 2; + */ + public boolean hasCreationTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+       * when watching for scripts on the blockchain.
+       * 
+ * + * required int64 creation_timestamp = 2; + */ + public long getCreationTimestamp() { + return creationTimestamp_; + } + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+       * when watching for scripts on the blockchain.
+       * 
+ * + * required int64 creation_timestamp = 2; + */ + public Builder setCreationTimestamp(long value) { + bitField0_ |= 0x00000002; + creationTimestamp_ = value; + onChanged(); + return this; + } + /** + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point
+       * when watching for scripts on the blockchain.
+       * 
+ * + * required int64 creation_timestamp = 2; + */ + public Builder clearCreationTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + creationTimestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:wallet.Script) + } + + // @@protoc_insertion_point(class_scope:wallet.Script) + private static final org.bitcoinj.wallet.Protos.Script DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.bitcoinj.wallet.Protos.Script(); + } + + public static org.bitcoinj.wallet.Protos.Script getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser