From 775f5241e3dc056d8def43f886a89bf117d96851 Mon Sep 17 00:00:00 2001 From: Miron Cuperman Date: Wed, 11 Jan 2012 13:34:14 -0800 Subject: [PATCH] Allow building without protobuf-compiler installed --- README | 21 +- pom.xml | 70 +- .../protobuf/org/bitcoinj/wallet/Protos.java | 5022 +++++++++++++++++ 3 files changed, 5075 insertions(+), 38 deletions(-) create mode 100644 src/main/java/com/google/bitcoin/protobuf/org/bitcoinj/wallet/Protos.java diff --git a/README b/README index 53f2e0c5..5053fea6 100644 --- a/README +++ b/README @@ -2,14 +2,6 @@ To get started, ensure you have the latest JDK installed, and download Maven fro http://maven.apache.org/ -and install the protobuf compiler package version 2.4.x: - - Debian/Ubuntu: apt-get install protobuf-compiler - - Windows: http://code.google.com/p/protobuf/downloads/list - - OSX: install from ports? - Then run "mvn clean package" to compile the software. You can also run "mvn site:site" to generate a website with useful information like JavaDocs. The outputs are under the target/ directory. @@ -27,6 +19,15 @@ If you get a SocketDisconnectedException, the node you've connected to has its m (unfortunately the default is too low). Connect to a node that has a bigger send buffer, settable by passing -maxsendbuffer=25600 to the Bitcoin C++ software. -For the convenience of Eclipse users, you can copy dependency jars to target/dependency using: +To regenerate the protobuf Java sources from src/bitcoin.proto, install the protobuf compiler package version 2.4.x: + + Debian/Ubuntu: apt-get install protobuf-compiler + + Windows: http://code.google.com/p/protobuf/downloads/list + + OSX: install from ports? + +and regenerate: + + mvn clean package -DupdateProtobuf - mvn dependency:copy-dependencies diff --git a/pom.xml b/pom.xml index 78a7f0a7..074bce3a 100644 --- a/pom.xml +++ b/pom.xml @@ -147,6 +147,48 @@ + + update-protobuf + + + updateProtobuf + true + + + + + + maven-antrun-plugin + + + compile-protoc + generate-sources + + + + + + + + + + + + + + + + + + run + + + + + + + + @@ -213,34 +255,6 @@ - - maven-antrun-plugin - - - compile-protoc - generate-sources - - - - - - - - - - - - - - - - - - run - - - - org.codehaus.mojo build-helper-maven-plugin diff --git a/src/main/java/com/google/bitcoin/protobuf/org/bitcoinj/wallet/Protos.java b/src/main/java/com/google/bitcoin/protobuf/org/bitcoinj/wallet/Protos.java new file mode 100644 index 00000000..0ad38497 --- /dev/null +++ b/src/main/java/com/google/bitcoin/protobuf/org/bitcoinj/wallet/Protos.java @@ -0,0 +1,5022 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bitcoin.proto + +package org.bitcoinj.wallet; + +public final class Protos { + private Protos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface KeyOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bytes private_key = 1; + boolean hasPrivateKey(); + com.google.protobuf.ByteString getPrivateKey(); + + // required .wallet.Key.Type type = 2; + boolean hasType(); + org.bitcoinj.wallet.Protos.Key.Type getType(); + + // optional string label = 3; + boolean hasLabel(); + String getLabel(); + + // optional int64 creation_timestamp = 4; + boolean hasCreationTimestamp(); + long getCreationTimestamp(); + } + public static final class Key extends + com.google.protobuf.GeneratedMessage + implements KeyOrBuilder { + // Use Key.newBuilder() to construct. + private Key(Builder builder) { + super(builder); + } + private Key(boolean noInit) {} + + private static final Key defaultInstance; + public static Key getDefaultInstance() { + return defaultInstance; + } + + public Key getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable; + } + + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + ORIGINAL(0, 1), + ; + + public static final int ORIGINAL_VALUE = 1; + + + public final int getNumber() { return value; } + + public static Type valueOf(int value) { + switch (value) { + case 1: return ORIGINAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + 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 = { + ORIGINAL, + }; + + 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 index; + private final int value; + + private Type(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:wallet.Key.Type) + } + + private int bitField0_; + // required bytes private_key = 1; + public static final int PRIVATE_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString privateKey_; + public boolean hasPrivateKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public com.google.protobuf.ByteString getPrivateKey() { + return privateKey_; + } + + // required .wallet.Key.Type type = 2; + public static final int TYPE_FIELD_NUMBER = 2; + private org.bitcoinj.wallet.Protos.Key.Type type_; + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public org.bitcoinj.wallet.Protos.Key.Type getType() { + return type_; + } + + // optional string label = 3; + public static final int LABEL_FIELD_NUMBER = 3; + private java.lang.Object label_; + public boolean hasLabel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (com.google.protobuf.Internal.isValidUtf8(bs)) { + label_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional int64 creation_timestamp = 4; + public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 4; + private long creationTimestamp_; + public boolean hasCreationTimestamp() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public long getCreationTimestamp() { + return creationTimestamp_; + } + + private void initFields() { + privateKey_ = com.google.protobuf.ByteString.EMPTY; + type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; + label_ = ""; + creationTimestamp_ = 0L; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasPrivateKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasType()) { + 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.writeBytes(1, privateKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, type_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getLabelBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, creationTimestamp_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, privateKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, type_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getLabelBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, creationTimestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Key parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Key prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements 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.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable; + } + + // Construct using org.bitcoinj.wallet.Protos.Key.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + privateKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; + bitField0_ = (bitField0_ & ~0x00000002); + label_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + creationTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.Key.getDescriptor(); + } + + 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; + } + + private org.bitcoinj.wallet.Protos.Key buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + org.bitcoinj.wallet.Protos.Key result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + 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.privateKey_ = privateKey_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.label_ = label_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.creationTimestamp_ = creationTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + 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.hasPrivateKey()) { + setPrivateKey(other.getPrivateKey()); + } + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasLabel()) { + setLabel(other.getLabel()); + } + if (other.hasCreationTimestamp()) { + setCreationTimestamp(other.getCreationTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasPrivateKey()) { + + return false; + } + if (!hasType()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + privateKey_ = input.readBytes(); + break; + } + case 16: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Key.Type value = org.bitcoinj.wallet.Protos.Key.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + type_ = value; + } + break; + } + case 26: { + bitField0_ |= 0x00000004; + label_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + creationTimestamp_ = input.readInt64(); + break; + } + } + } + } + + private int bitField0_; + + // required bytes private_key = 1; + private com.google.protobuf.ByteString privateKey_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasPrivateKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public com.google.protobuf.ByteString getPrivateKey() { + return privateKey_; + } + public Builder setPrivateKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + privateKey_ = value; + onChanged(); + return this; + } + public Builder clearPrivateKey() { + bitField0_ = (bitField0_ & ~0x00000001); + privateKey_ = getDefaultInstance().getPrivateKey(); + onChanged(); + return this; + } + + // required .wallet.Key.Type type = 2; + private org.bitcoinj.wallet.Protos.Key.Type type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public org.bitcoinj.wallet.Protos.Key.Type getType() { + return type_; + } + public Builder setType(org.bitcoinj.wallet.Protos.Key.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value; + onChanged(); + return this; + } + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; + onChanged(); + return this; + } + + // optional string label = 3; + private java.lang.Object label_ = ""; + public boolean hasLabel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + label_ = s; + return s; + } else { + return (String) ref; + } + } + public Builder setLabel(String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + label_ = value; + onChanged(); + return this; + } + public Builder clearLabel() { + bitField0_ = (bitField0_ & ~0x00000004); + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + void setLabel(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000004; + label_ = value; + onChanged(); + } + + // optional int64 creation_timestamp = 4; + private long creationTimestamp_ ; + public boolean hasCreationTimestamp() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public long getCreationTimestamp() { + return creationTimestamp_; + } + public Builder setCreationTimestamp(long value) { + bitField0_ |= 0x00000008; + creationTimestamp_ = value; + onChanged(); + return this; + } + public Builder clearCreationTimestamp() { + bitField0_ = (bitField0_ & ~0x00000008); + creationTimestamp_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.Key) + } + + static { + defaultInstance = new Key(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.Key) + } + + public interface TransactionInputOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bytes transaction_out_point_hash = 1; + boolean hasTransactionOutPointHash(); + com.google.protobuf.ByteString getTransactionOutPointHash(); + + // required int32 transaction_out_point_index = 2; + boolean hasTransactionOutPointIndex(); + int getTransactionOutPointIndex(); + + // required bytes script_bytes = 3; + boolean hasScriptBytes(); + com.google.protobuf.ByteString getScriptBytes(); + + // optional uint32 sequence = 4; + boolean hasSequence(); + int getSequence(); + } + public static final class TransactionInput extends + com.google.protobuf.GeneratedMessage + implements TransactionInputOrBuilder { + // Use TransactionInput.newBuilder() to construct. + private TransactionInput(Builder builder) { + super(builder); + } + private TransactionInput(boolean noInit) {} + + private static final TransactionInput defaultInstance; + public static TransactionInput getDefaultInstance() { + return defaultInstance; + } + + public TransactionInput getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable; + } + + private int bitField0_; + // required bytes transaction_out_point_hash = 1; + public static final int TRANSACTION_OUT_POINT_HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString transactionOutPointHash_; + public boolean hasTransactionOutPointHash() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public com.google.protobuf.ByteString getTransactionOutPointHash() { + return transactionOutPointHash_; + } + + // required int32 transaction_out_point_index = 2; + public static final int TRANSACTION_OUT_POINT_INDEX_FIELD_NUMBER = 2; + private int transactionOutPointIndex_; + public boolean hasTransactionOutPointIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public int getTransactionOutPointIndex() { + return transactionOutPointIndex_; + } + + // required bytes script_bytes = 3; + public static final int SCRIPT_BYTES_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString scriptBytes_; + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public com.google.protobuf.ByteString getScriptBytes() { + return scriptBytes_; + } + + // optional uint32 sequence = 4; + public static final int SEQUENCE_FIELD_NUMBER = 4; + private int sequence_; + public boolean hasSequence() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public int getSequence() { + return sequence_; + } + + private void initFields() { + transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; + transactionOutPointIndex_ = 0; + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + sequence_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasTransactionOutPointHash()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTransactionOutPointIndex()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasScriptBytes()) { + 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.writeBytes(1, transactionOutPointHash_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, transactionOutPointIndex_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, scriptBytes_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeUInt32(4, sequence_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, transactionOutPointHash_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, transactionOutPointIndex_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, scriptBytes_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, sequence_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionInput prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.TransactionInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable; + } + + // Construct using org.bitcoinj.wallet.Protos.TransactionInput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + transactionOutPointIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + sequence_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.TransactionInput.getDescriptor(); + } + + public org.bitcoinj.wallet.Protos.TransactionInput getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.TransactionInput build() { + org.bitcoinj.wallet.Protos.TransactionInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + private org.bitcoinj.wallet.Protos.TransactionInput buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + org.bitcoinj.wallet.Protos.TransactionInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return result; + } + + public org.bitcoinj.wallet.Protos.TransactionInput buildPartial() { + org.bitcoinj.wallet.Protos.TransactionInput result = new org.bitcoinj.wallet.Protos.TransactionInput(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.transactionOutPointHash_ = transactionOutPointHash_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.transactionOutPointIndex_ = transactionOutPointIndex_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.scriptBytes_ = scriptBytes_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.sequence_ = sequence_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.TransactionInput) { + return mergeFrom((org.bitcoinj.wallet.Protos.TransactionInput)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionInput other) { + if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this; + if (other.hasTransactionOutPointHash()) { + setTransactionOutPointHash(other.getTransactionOutPointHash()); + } + if (other.hasTransactionOutPointIndex()) { + setTransactionOutPointIndex(other.getTransactionOutPointIndex()); + } + if (other.hasScriptBytes()) { + setScriptBytes(other.getScriptBytes()); + } + if (other.hasSequence()) { + setSequence(other.getSequence()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasTransactionOutPointHash()) { + + return false; + } + if (!hasTransactionOutPointIndex()) { + + return false; + } + if (!hasScriptBytes()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + transactionOutPointHash_ = input.readBytes(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + transactionOutPointIndex_ = input.readInt32(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + scriptBytes_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + sequence_ = input.readUInt32(); + break; + } + } + } + } + + private int bitField0_; + + // required bytes transaction_out_point_hash = 1; + private com.google.protobuf.ByteString transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasTransactionOutPointHash() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public com.google.protobuf.ByteString getTransactionOutPointHash() { + return transactionOutPointHash_; + } + public Builder setTransactionOutPointHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + transactionOutPointHash_ = value; + onChanged(); + return this; + } + public Builder clearTransactionOutPointHash() { + bitField0_ = (bitField0_ & ~0x00000001); + transactionOutPointHash_ = getDefaultInstance().getTransactionOutPointHash(); + onChanged(); + return this; + } + + // required int32 transaction_out_point_index = 2; + private int transactionOutPointIndex_ ; + public boolean hasTransactionOutPointIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public int getTransactionOutPointIndex() { + return transactionOutPointIndex_; + } + public Builder setTransactionOutPointIndex(int value) { + bitField0_ |= 0x00000002; + transactionOutPointIndex_ = value; + onChanged(); + return this; + } + public Builder clearTransactionOutPointIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + transactionOutPointIndex_ = 0; + onChanged(); + return this; + } + + // required bytes script_bytes = 3; + private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public com.google.protobuf.ByteString getScriptBytes() { + return scriptBytes_; + } + public Builder setScriptBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + scriptBytes_ = value; + onChanged(); + return this; + } + public Builder clearScriptBytes() { + bitField0_ = (bitField0_ & ~0x00000004); + scriptBytes_ = getDefaultInstance().getScriptBytes(); + onChanged(); + return this; + } + + // optional uint32 sequence = 4; + private int sequence_ ; + public boolean hasSequence() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public int getSequence() { + return sequence_; + } + public Builder setSequence(int value) { + bitField0_ |= 0x00000008; + sequence_ = value; + onChanged(); + return this; + } + public Builder clearSequence() { + bitField0_ = (bitField0_ & ~0x00000008); + sequence_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.TransactionInput) + } + + static { + defaultInstance = new TransactionInput(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.TransactionInput) + } + + public interface TransactionOutputOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required int64 value = 1; + boolean hasValue(); + long getValue(); + + // required bytes script_bytes = 2; + boolean hasScriptBytes(); + com.google.protobuf.ByteString getScriptBytes(); + + // optional bytes spent_by_transaction_hash = 3; + boolean hasSpentByTransactionHash(); + com.google.protobuf.ByteString getSpentByTransactionHash(); + + // optional int32 spent_by_transaction_index = 4; + boolean hasSpentByTransactionIndex(); + int getSpentByTransactionIndex(); + } + public static final class TransactionOutput extends + com.google.protobuf.GeneratedMessage + implements TransactionOutputOrBuilder { + // Use TransactionOutput.newBuilder() to construct. + private TransactionOutput(Builder builder) { + super(builder); + } + private TransactionOutput(boolean noInit) {} + + private static final TransactionOutput defaultInstance; + public static TransactionOutput getDefaultInstance() { + return defaultInstance; + } + + public TransactionOutput getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable; + } + + private int bitField0_; + // required int64 value = 1; + public static final int VALUE_FIELD_NUMBER = 1; + private long value_; + public boolean hasValue() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public long getValue() { + return value_; + } + + // required bytes script_bytes = 2; + public static final int SCRIPT_BYTES_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString scriptBytes_; + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getScriptBytes() { + return scriptBytes_; + } + + // optional bytes spent_by_transaction_hash = 3; + public static final int SPENT_BY_TRANSACTION_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString spentByTransactionHash_; + public boolean hasSpentByTransactionHash() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public com.google.protobuf.ByteString getSpentByTransactionHash() { + return spentByTransactionHash_; + } + + // optional int32 spent_by_transaction_index = 4; + public static final int SPENT_BY_TRANSACTION_INDEX_FIELD_NUMBER = 4; + private int spentByTransactionIndex_; + public boolean hasSpentByTransactionIndex() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public int getSpentByTransactionIndex() { + return spentByTransactionIndex_; + } + + private void initFields() { + value_ = 0L; + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + spentByTransactionIndex_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasScriptBytes()) { + 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.writeInt64(1, value_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, scriptBytes_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, spentByTransactionHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, spentByTransactionIndex_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, value_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, scriptBytes_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, spentByTransactionHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, spentByTransactionIndex_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionOutput prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable; + } + + // Construct using org.bitcoinj.wallet.Protos.TransactionOutput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + value_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + spentByTransactionIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.TransactionOutput.getDescriptor(); + } + + public org.bitcoinj.wallet.Protos.TransactionOutput getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.TransactionOutput build() { + org.bitcoinj.wallet.Protos.TransactionOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + private org.bitcoinj.wallet.Protos.TransactionOutput buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + org.bitcoinj.wallet.Protos.TransactionOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return result; + } + + public org.bitcoinj.wallet.Protos.TransactionOutput buildPartial() { + org.bitcoinj.wallet.Protos.TransactionOutput result = new org.bitcoinj.wallet.Protos.TransactionOutput(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.value_ = value_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.scriptBytes_ = scriptBytes_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.spentByTransactionHash_ = spentByTransactionHash_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.spentByTransactionIndex_ = spentByTransactionIndex_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.TransactionOutput) { + return mergeFrom((org.bitcoinj.wallet.Protos.TransactionOutput)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) { + if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this; + if (other.hasValue()) { + setValue(other.getValue()); + } + if (other.hasScriptBytes()) { + setScriptBytes(other.getScriptBytes()); + } + if (other.hasSpentByTransactionHash()) { + setSpentByTransactionHash(other.getSpentByTransactionHash()); + } + if (other.hasSpentByTransactionIndex()) { + setSpentByTransactionIndex(other.getSpentByTransactionIndex()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasValue()) { + + return false; + } + if (!hasScriptBytes()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + value_ = input.readInt64(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + scriptBytes_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + spentByTransactionHash_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + spentByTransactionIndex_ = input.readInt32(); + break; + } + } + } + } + + private int bitField0_; + + // required int64 value = 1; + private long value_ ; + public boolean hasValue() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public long getValue() { + return value_; + } + public Builder setValue(long value) { + bitField0_ |= 0x00000001; + value_ = value; + onChanged(); + return this; + } + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0L; + onChanged(); + return this; + } + + // required bytes script_bytes = 2; + private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getScriptBytes() { + return scriptBytes_; + } + public Builder setScriptBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + scriptBytes_ = value; + onChanged(); + return this; + } + public Builder clearScriptBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + scriptBytes_ = getDefaultInstance().getScriptBytes(); + onChanged(); + return this; + } + + // optional bytes spent_by_transaction_hash = 3; + private com.google.protobuf.ByteString spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasSpentByTransactionHash() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public com.google.protobuf.ByteString getSpentByTransactionHash() { + return spentByTransactionHash_; + } + public Builder setSpentByTransactionHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + spentByTransactionHash_ = value; + onChanged(); + return this; + } + public Builder clearSpentByTransactionHash() { + bitField0_ = (bitField0_ & ~0x00000004); + spentByTransactionHash_ = getDefaultInstance().getSpentByTransactionHash(); + onChanged(); + return this; + } + + // optional int32 spent_by_transaction_index = 4; + private int spentByTransactionIndex_ ; + public boolean hasSpentByTransactionIndex() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public int getSpentByTransactionIndex() { + return spentByTransactionIndex_; + } + public Builder setSpentByTransactionIndex(int value) { + bitField0_ |= 0x00000008; + spentByTransactionIndex_ = value; + onChanged(); + return this; + } + public Builder clearSpentByTransactionIndex() { + bitField0_ = (bitField0_ & ~0x00000008); + spentByTransactionIndex_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.TransactionOutput) + } + + static { + defaultInstance = new TransactionOutput(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.TransactionOutput) + } + + public interface TransactionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required int32 version = 1; + boolean hasVersion(); + int getVersion(); + + // required bytes hash = 2; + boolean hasHash(); + com.google.protobuf.ByteString getHash(); + + // required .wallet.Transaction.Pool pool = 3; + boolean hasPool(); + org.bitcoinj.wallet.Protos.Transaction.Pool getPool(); + + // optional uint32 lock_time = 4; + boolean hasLockTime(); + int getLockTime(); + + // optional int64 updated_at = 5; + boolean hasUpdatedAt(); + long getUpdatedAt(); + + // repeated .wallet.TransactionInput transaction_input = 6; + java.util.List + getTransactionInputList(); + org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index); + int getTransactionInputCount(); + java.util.List + getTransactionInputOrBuilderList(); + org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder( + int index); + + // repeated .wallet.TransactionOutput transaction_output = 7; + java.util.List + getTransactionOutputList(); + org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index); + int getTransactionOutputCount(); + java.util.List + getTransactionOutputOrBuilderList(); + org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder( + int index); + + // repeated bytes block_hash = 8; + java.util.List getBlockHashList(); + int getBlockHashCount(); + com.google.protobuf.ByteString getBlockHash(int index); + } + public static final class Transaction extends + com.google.protobuf.GeneratedMessage + implements TransactionOrBuilder { + // Use Transaction.newBuilder() to construct. + private Transaction(Builder builder) { + super(builder); + } + private Transaction(boolean noInit) {} + + private static final Transaction defaultInstance; + public static Transaction getDefaultInstance() { + return defaultInstance; + } + + public Transaction getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable; + } + + public enum Pool + implements com.google.protobuf.ProtocolMessageEnum { + UNSPENT(0, 0), + SPENT(1, 1), + INACTIVE(2, 2), + DEAD(3, 3), + PENDING(4, 16), + PENDING_INACTIVE(5, 18), + ; + + public static final int UNSPENT_VALUE = 0; + public static final int SPENT_VALUE = 1; + public static final int INACTIVE_VALUE = 2; + public static final int DEAD_VALUE = 3; + public static final int PENDING_VALUE = 16; + public static final int PENDING_INACTIVE_VALUE = 18; + + + public final int getNumber() { return value; } + + public static Pool valueOf(int value) { + switch (value) { + case 0: return UNSPENT; + case 1: return SPENT; + case 2: return INACTIVE; + case 3: return DEAD; + case 16: return PENDING; + case 18: return PENDING_INACTIVE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Pool findValueByNumber(int number) { + return Pool.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.Transaction.getDescriptor().getEnumTypes().get(0); + } + + private static final Pool[] VALUES = { + UNSPENT, SPENT, INACTIVE, DEAD, PENDING, PENDING_INACTIVE, + }; + + public static Pool 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 index; + private final int value; + + private Pool(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:wallet.Transaction.Pool) + } + + private int bitField0_; + // required int32 version = 1; + public static final int VERSION_FIELD_NUMBER = 1; + private int version_; + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public int getVersion() { + return version_; + } + + // required bytes hash = 2; + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + public boolean hasHash() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getHash() { + return hash_; + } + + // required .wallet.Transaction.Pool pool = 3; + public static final int POOL_FIELD_NUMBER = 3; + private org.bitcoinj.wallet.Protos.Transaction.Pool pool_; + public boolean hasPool() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public org.bitcoinj.wallet.Protos.Transaction.Pool getPool() { + return pool_; + } + + // optional uint32 lock_time = 4; + public static final int LOCK_TIME_FIELD_NUMBER = 4; + private int lockTime_; + public boolean hasLockTime() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public int getLockTime() { + return lockTime_; + } + + // optional int64 updated_at = 5; + public static final int UPDATED_AT_FIELD_NUMBER = 5; + private long updatedAt_; + public boolean hasUpdatedAt() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + public long getUpdatedAt() { + return updatedAt_; + } + + // repeated .wallet.TransactionInput transaction_input = 6; + public static final int TRANSACTION_INPUT_FIELD_NUMBER = 6; + private java.util.List transactionInput_; + public java.util.List getTransactionInputList() { + return transactionInput_; + } + public java.util.List + getTransactionInputOrBuilderList() { + return transactionInput_; + } + public int getTransactionInputCount() { + return transactionInput_.size(); + } + public org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index) { + return transactionInput_.get(index); + } + public org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder( + int index) { + return transactionInput_.get(index); + } + + // repeated .wallet.TransactionOutput transaction_output = 7; + public static final int TRANSACTION_OUTPUT_FIELD_NUMBER = 7; + private java.util.List transactionOutput_; + public java.util.List getTransactionOutputList() { + return transactionOutput_; + } + public java.util.List + getTransactionOutputOrBuilderList() { + return transactionOutput_; + } + public int getTransactionOutputCount() { + return transactionOutput_.size(); + } + public org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index) { + return transactionOutput_.get(index); + } + public org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder( + int index) { + return transactionOutput_.get(index); + } + + // repeated bytes block_hash = 8; + public static final int BLOCK_HASH_FIELD_NUMBER = 8; + private java.util.List blockHash_; + public java.util.List + getBlockHashList() { + return blockHash_; + } + public int getBlockHashCount() { + return blockHash_.size(); + } + public com.google.protobuf.ByteString getBlockHash(int index) { + return blockHash_.get(index); + } + + private void initFields() { + version_ = 0; + hash_ = com.google.protobuf.ByteString.EMPTY; + pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT; + lockTime_ = 0; + updatedAt_ = 0L; + transactionInput_ = java.util.Collections.emptyList(); + transactionOutput_ = java.util.Collections.emptyList(); + blockHash_ = java.util.Collections.emptyList();; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasHash()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPool()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getTransactionInputCount(); i++) { + if (!getTransactionInput(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTransactionOutputCount(); i++) { + if (!getTransactionOutput(i).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.writeInt32(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, hash_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, pool_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeUInt32(4, lockTime_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt64(5, updatedAt_); + } + for (int i = 0; i < transactionInput_.size(); i++) { + output.writeMessage(6, transactionInput_.get(i)); + } + for (int i = 0; i < transactionOutput_.size(); i++) { + output.writeMessage(7, transactionOutput_.get(i)); + } + for (int i = 0; i < blockHash_.size(); i++) { + output.writeBytes(8, blockHash_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, hash_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, pool_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, lockTime_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, updatedAt_); + } + for (int i = 0; i < transactionInput_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, transactionInput_.get(i)); + } + for (int i = 0; i < transactionOutput_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, transactionOutput_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < blockHash_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(blockHash_.get(i)); + } + size += dataSize; + size += 1 * getBlockHashList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Transaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Transaction prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.TransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable; + } + + // Construct using org.bitcoinj.wallet.Protos.Transaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getTransactionInputFieldBuilder(); + getTransactionOutputFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + version_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + hash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT; + bitField0_ = (bitField0_ & ~0x00000004); + lockTime_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + updatedAt_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + if (transactionInputBuilder_ == null) { + transactionInput_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + transactionInputBuilder_.clear(); + } + if (transactionOutputBuilder_ == null) { + transactionOutput_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + transactionOutputBuilder_.clear(); + } + blockHash_ = java.util.Collections.emptyList();; + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.Transaction.getDescriptor(); + } + + public org.bitcoinj.wallet.Protos.Transaction getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.Transaction build() { + org.bitcoinj.wallet.Protos.Transaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + private org.bitcoinj.wallet.Protos.Transaction buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + org.bitcoinj.wallet.Protos.Transaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return result; + } + + public org.bitcoinj.wallet.Protos.Transaction buildPartial() { + org.bitcoinj.wallet.Protos.Transaction result = new org.bitcoinj.wallet.Protos.Transaction(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.hash_ = hash_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.pool_ = pool_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.lockTime_ = lockTime_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.updatedAt_ = updatedAt_; + if (transactionInputBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { + transactionInput_ = java.util.Collections.unmodifiableList(transactionInput_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.transactionInput_ = transactionInput_; + } else { + result.transactionInput_ = transactionInputBuilder_.build(); + } + if (transactionOutputBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { + transactionOutput_ = java.util.Collections.unmodifiableList(transactionOutput_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.transactionOutput_ = transactionOutput_; + } else { + result.transactionOutput_ = transactionOutputBuilder_.build(); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + blockHash_ = java.util.Collections.unmodifiableList(blockHash_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.blockHash_ = blockHash_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.Transaction) { + return mergeFrom((org.bitcoinj.wallet.Protos.Transaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Transaction other) { + if (other == org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()) return this; + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasHash()) { + setHash(other.getHash()); + } + if (other.hasPool()) { + setPool(other.getPool()); + } + if (other.hasLockTime()) { + setLockTime(other.getLockTime()); + } + if (other.hasUpdatedAt()) { + setUpdatedAt(other.getUpdatedAt()); + } + if (transactionInputBuilder_ == null) { + if (!other.transactionInput_.isEmpty()) { + if (transactionInput_.isEmpty()) { + transactionInput_ = other.transactionInput_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTransactionInputIsMutable(); + transactionInput_.addAll(other.transactionInput_); + } + onChanged(); + } + } else { + if (!other.transactionInput_.isEmpty()) { + if (transactionInputBuilder_.isEmpty()) { + transactionInputBuilder_.dispose(); + transactionInputBuilder_ = null; + transactionInput_ = other.transactionInput_; + bitField0_ = (bitField0_ & ~0x00000020); + transactionInputBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTransactionInputFieldBuilder() : null; + } else { + transactionInputBuilder_.addAllMessages(other.transactionInput_); + } + } + } + if (transactionOutputBuilder_ == null) { + if (!other.transactionOutput_.isEmpty()) { + if (transactionOutput_.isEmpty()) { + transactionOutput_ = other.transactionOutput_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureTransactionOutputIsMutable(); + transactionOutput_.addAll(other.transactionOutput_); + } + onChanged(); + } + } else { + if (!other.transactionOutput_.isEmpty()) { + if (transactionOutputBuilder_.isEmpty()) { + transactionOutputBuilder_.dispose(); + transactionOutputBuilder_ = null; + transactionOutput_ = other.transactionOutput_; + bitField0_ = (bitField0_ & ~0x00000040); + transactionOutputBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTransactionOutputFieldBuilder() : null; + } else { + transactionOutputBuilder_.addAllMessages(other.transactionOutput_); + } + } + } + if (!other.blockHash_.isEmpty()) { + if (blockHash_.isEmpty()) { + blockHash_ = other.blockHash_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureBlockHashIsMutable(); + blockHash_.addAll(other.blockHash_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasVersion()) { + + return false; + } + if (!hasHash()) { + + return false; + } + if (!hasPool()) { + + return false; + } + for (int i = 0; i < getTransactionInputCount(); i++) { + if (!getTransactionInput(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTransactionOutputCount(); i++) { + if (!getTransactionOutput(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readInt32(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + hash_ = input.readBytes(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Transaction.Pool value = org.bitcoinj.wallet.Protos.Transaction.Pool.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + pool_ = value; + } + break; + } + case 32: { + bitField0_ |= 0x00000008; + lockTime_ = input.readUInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + updatedAt_ = input.readInt64(); + break; + } + case 50: { + org.bitcoinj.wallet.Protos.TransactionInput.Builder subBuilder = org.bitcoinj.wallet.Protos.TransactionInput.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addTransactionInput(subBuilder.buildPartial()); + break; + } + case 58: { + org.bitcoinj.wallet.Protos.TransactionOutput.Builder subBuilder = org.bitcoinj.wallet.Protos.TransactionOutput.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addTransactionOutput(subBuilder.buildPartial()); + break; + } + case 66: { + ensureBlockHashIsMutable(); + blockHash_.add(input.readBytes()); + break; + } + } + } + } + + private int bitField0_; + + // required int32 version = 1; + private int version_ ; + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public int getVersion() { + return version_; + } + public Builder setVersion(int value) { + bitField0_ |= 0x00000001; + version_ = value; + onChanged(); + return this; + } + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + onChanged(); + return this; + } + + // required bytes hash = 2; + private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasHash() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getHash() { + return hash_; + } + public Builder setHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + hash_ = value; + onChanged(); + return this; + } + public Builder clearHash() { + bitField0_ = (bitField0_ & ~0x00000002); + hash_ = getDefaultInstance().getHash(); + onChanged(); + return this; + } + + // required .wallet.Transaction.Pool pool = 3; + private org.bitcoinj.wallet.Protos.Transaction.Pool pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT; + public boolean hasPool() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public org.bitcoinj.wallet.Protos.Transaction.Pool getPool() { + return pool_; + } + public Builder setPool(org.bitcoinj.wallet.Protos.Transaction.Pool value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + pool_ = value; + onChanged(); + return this; + } + public Builder clearPool() { + bitField0_ = (bitField0_ & ~0x00000004); + pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT; + onChanged(); + return this; + } + + // optional uint32 lock_time = 4; + private int lockTime_ ; + public boolean hasLockTime() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public int getLockTime() { + return lockTime_; + } + public Builder setLockTime(int value) { + bitField0_ |= 0x00000008; + lockTime_ = value; + onChanged(); + return this; + } + public Builder clearLockTime() { + bitField0_ = (bitField0_ & ~0x00000008); + lockTime_ = 0; + onChanged(); + return this; + } + + // optional int64 updated_at = 5; + private long updatedAt_ ; + public boolean hasUpdatedAt() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + public long getUpdatedAt() { + return updatedAt_; + } + public Builder setUpdatedAt(long value) { + bitField0_ |= 0x00000010; + updatedAt_ = value; + onChanged(); + return this; + } + public Builder clearUpdatedAt() { + bitField0_ = (bitField0_ & ~0x00000010); + updatedAt_ = 0L; + onChanged(); + return this; + } + + // repeated .wallet.TransactionInput transaction_input = 6; + private java.util.List transactionInput_ = + java.util.Collections.emptyList(); + private void ensureTransactionInputIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + transactionInput_ = new java.util.ArrayList(transactionInput_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder> transactionInputBuilder_; + + public java.util.List getTransactionInputList() { + if (transactionInputBuilder_ == null) { + return java.util.Collections.unmodifiableList(transactionInput_); + } else { + return transactionInputBuilder_.getMessageList(); + } + } + public int getTransactionInputCount() { + if (transactionInputBuilder_ == null) { + return transactionInput_.size(); + } else { + return transactionInputBuilder_.getCount(); + } + } + public org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index) { + if (transactionInputBuilder_ == null) { + return transactionInput_.get(index); + } else { + return transactionInputBuilder_.getMessage(index); + } + } + public Builder setTransactionInput( + int index, org.bitcoinj.wallet.Protos.TransactionInput value) { + if (transactionInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionInputIsMutable(); + transactionInput_.set(index, value); + onChanged(); + } else { + transactionInputBuilder_.setMessage(index, value); + } + return this; + } + public Builder setTransactionInput( + int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { + if (transactionInputBuilder_ == null) { + ensureTransactionInputIsMutable(); + transactionInput_.set(index, builderForValue.build()); + onChanged(); + } else { + transactionInputBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + public Builder addTransactionInput(org.bitcoinj.wallet.Protos.TransactionInput value) { + if (transactionInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionInputIsMutable(); + transactionInput_.add(value); + onChanged(); + } else { + transactionInputBuilder_.addMessage(value); + } + return this; + } + public Builder addTransactionInput( + int index, org.bitcoinj.wallet.Protos.TransactionInput value) { + if (transactionInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionInputIsMutable(); + transactionInput_.add(index, value); + onChanged(); + } else { + transactionInputBuilder_.addMessage(index, value); + } + return this; + } + public Builder addTransactionInput( + org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { + if (transactionInputBuilder_ == null) { + ensureTransactionInputIsMutable(); + transactionInput_.add(builderForValue.build()); + onChanged(); + } else { + transactionInputBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addTransactionInput( + int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { + if (transactionInputBuilder_ == null) { + ensureTransactionInputIsMutable(); + transactionInput_.add(index, builderForValue.build()); + onChanged(); + } else { + transactionInputBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + public Builder addAllTransactionInput( + java.lang.Iterable values) { + if (transactionInputBuilder_ == null) { + ensureTransactionInputIsMutable(); + super.addAll(values, transactionInput_); + onChanged(); + } else { + transactionInputBuilder_.addAllMessages(values); + } + return this; + } + public Builder clearTransactionInput() { + if (transactionInputBuilder_ == null) { + transactionInput_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + transactionInputBuilder_.clear(); + } + return this; + } + public Builder removeTransactionInput(int index) { + if (transactionInputBuilder_ == null) { + ensureTransactionInputIsMutable(); + transactionInput_.remove(index); + onChanged(); + } else { + transactionInputBuilder_.remove(index); + } + return this; + } + public org.bitcoinj.wallet.Protos.TransactionInput.Builder getTransactionInputBuilder( + int index) { + return getTransactionInputFieldBuilder().getBuilder(index); + } + public org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder( + int index) { + if (transactionInputBuilder_ == null) { + return transactionInput_.get(index); } else { + return transactionInputBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getTransactionInputOrBuilderList() { + if (transactionInputBuilder_ != null) { + return transactionInputBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transactionInput_); + } + } + public org.bitcoinj.wallet.Protos.TransactionInput.Builder addTransactionInputBuilder() { + return getTransactionInputFieldBuilder().addBuilder( + org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()); + } + public org.bitcoinj.wallet.Protos.TransactionInput.Builder addTransactionInputBuilder( + int index) { + return getTransactionInputFieldBuilder().addBuilder( + index, org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()); + } + public java.util.List + getTransactionInputBuilderList() { + return getTransactionInputFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder> + getTransactionInputFieldBuilder() { + if (transactionInputBuilder_ == null) { + transactionInputBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder>( + transactionInput_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + transactionInput_ = null; + } + return transactionInputBuilder_; + } + + // repeated .wallet.TransactionOutput transaction_output = 7; + private java.util.List transactionOutput_ = + java.util.Collections.emptyList(); + private void ensureTransactionOutputIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + transactionOutput_ = new java.util.ArrayList(transactionOutput_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder> transactionOutputBuilder_; + + public java.util.List getTransactionOutputList() { + if (transactionOutputBuilder_ == null) { + return java.util.Collections.unmodifiableList(transactionOutput_); + } else { + return transactionOutputBuilder_.getMessageList(); + } + } + public int getTransactionOutputCount() { + if (transactionOutputBuilder_ == null) { + return transactionOutput_.size(); + } else { + return transactionOutputBuilder_.getCount(); + } + } + public org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index) { + if (transactionOutputBuilder_ == null) { + return transactionOutput_.get(index); + } else { + return transactionOutputBuilder_.getMessage(index); + } + } + public Builder setTransactionOutput( + int index, org.bitcoinj.wallet.Protos.TransactionOutput value) { + if (transactionOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionOutputIsMutable(); + transactionOutput_.set(index, value); + onChanged(); + } else { + transactionOutputBuilder_.setMessage(index, value); + } + return this; + } + public Builder setTransactionOutput( + int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { + if (transactionOutputBuilder_ == null) { + ensureTransactionOutputIsMutable(); + transactionOutput_.set(index, builderForValue.build()); + onChanged(); + } else { + transactionOutputBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + public Builder addTransactionOutput(org.bitcoinj.wallet.Protos.TransactionOutput value) { + if (transactionOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionOutputIsMutable(); + transactionOutput_.add(value); + onChanged(); + } else { + transactionOutputBuilder_.addMessage(value); + } + return this; + } + public Builder addTransactionOutput( + int index, org.bitcoinj.wallet.Protos.TransactionOutput value) { + if (transactionOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionOutputIsMutable(); + transactionOutput_.add(index, value); + onChanged(); + } else { + transactionOutputBuilder_.addMessage(index, value); + } + return this; + } + public Builder addTransactionOutput( + org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { + if (transactionOutputBuilder_ == null) { + ensureTransactionOutputIsMutable(); + transactionOutput_.add(builderForValue.build()); + onChanged(); + } else { + transactionOutputBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addTransactionOutput( + int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { + if (transactionOutputBuilder_ == null) { + ensureTransactionOutputIsMutable(); + transactionOutput_.add(index, builderForValue.build()); + onChanged(); + } else { + transactionOutputBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + public Builder addAllTransactionOutput( + java.lang.Iterable values) { + if (transactionOutputBuilder_ == null) { + ensureTransactionOutputIsMutable(); + super.addAll(values, transactionOutput_); + onChanged(); + } else { + transactionOutputBuilder_.addAllMessages(values); + } + return this; + } + public Builder clearTransactionOutput() { + if (transactionOutputBuilder_ == null) { + transactionOutput_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + transactionOutputBuilder_.clear(); + } + return this; + } + public Builder removeTransactionOutput(int index) { + if (transactionOutputBuilder_ == null) { + ensureTransactionOutputIsMutable(); + transactionOutput_.remove(index); + onChanged(); + } else { + transactionOutputBuilder_.remove(index); + } + return this; + } + public org.bitcoinj.wallet.Protos.TransactionOutput.Builder getTransactionOutputBuilder( + int index) { + return getTransactionOutputFieldBuilder().getBuilder(index); + } + public org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder( + int index) { + if (transactionOutputBuilder_ == null) { + return transactionOutput_.get(index); } else { + return transactionOutputBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getTransactionOutputOrBuilderList() { + if (transactionOutputBuilder_ != null) { + return transactionOutputBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transactionOutput_); + } + } + public org.bitcoinj.wallet.Protos.TransactionOutput.Builder addTransactionOutputBuilder() { + return getTransactionOutputFieldBuilder().addBuilder( + org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()); + } + public org.bitcoinj.wallet.Protos.TransactionOutput.Builder addTransactionOutputBuilder( + int index) { + return getTransactionOutputFieldBuilder().addBuilder( + index, org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()); + } + public java.util.List + getTransactionOutputBuilderList() { + return getTransactionOutputFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder> + getTransactionOutputFieldBuilder() { + if (transactionOutputBuilder_ == null) { + transactionOutputBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder>( + transactionOutput_, + ((bitField0_ & 0x00000040) == 0x00000040), + getParentForChildren(), + isClean()); + transactionOutput_ = null; + } + return transactionOutputBuilder_; + } + + // repeated bytes block_hash = 8; + private java.util.List blockHash_ = java.util.Collections.emptyList();; + private void ensureBlockHashIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + blockHash_ = new java.util.ArrayList(blockHash_); + bitField0_ |= 0x00000080; + } + } + public java.util.List + getBlockHashList() { + return java.util.Collections.unmodifiableList(blockHash_); + } + public int getBlockHashCount() { + return blockHash_.size(); + } + public com.google.protobuf.ByteString getBlockHash(int index) { + return blockHash_.get(index); + } + public Builder setBlockHash( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlockHashIsMutable(); + blockHash_.set(index, value); + onChanged(); + return this; + } + public Builder addBlockHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlockHashIsMutable(); + blockHash_.add(value); + onChanged(); + return this; + } + public Builder addAllBlockHash( + java.lang.Iterable values) { + ensureBlockHashIsMutable(); + super.addAll(values, blockHash_); + onChanged(); + return this; + } + public Builder clearBlockHash() { + blockHash_ = java.util.Collections.emptyList();; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.Transaction) + } + + static { + defaultInstance = new Transaction(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.Transaction) + } + + public interface ExtensionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string id = 1; + boolean hasId(); + String getId(); + + // required bytes data = 2; + boolean hasData(); + com.google.protobuf.ByteString getData(); + + // required bool mandatory = 3; + boolean hasMandatory(); + boolean getMandatory(); + } + public static final class Extension extends + com.google.protobuf.GeneratedMessage + implements ExtensionOrBuilder { + // Use Extension.newBuilder() to construct. + private Extension(Builder builder) { + super(builder); + } + private Extension(boolean noInit) {} + + private static final Extension defaultInstance; + public static Extension getDefaultInstance() { + return defaultInstance; + } + + public Extension getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable; + } + + private int bitField0_; + // required string id = 1; + public static final int ID_FIELD_NUMBER = 1; + private java.lang.Object id_; + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getId() { + java.lang.Object ref = id_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (com.google.protobuf.Internal.isValidUtf8(bs)) { + id_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required bytes data = 2; + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + public boolean hasData() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getData() { + return data_; + } + + // required bool mandatory = 3; + public static final int MANDATORY_FIELD_NUMBER = 3; + private boolean mandatory_; + public boolean hasMandatory() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public boolean getMandatory() { + return mandatory_; + } + + private void initFields() { + id_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + mandatory_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasData()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMandatory()) { + 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.writeBytes(1, getIdBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, data_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, mandatory_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getIdBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, mandatory_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Extension prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.ExtensionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable; + } + + // Construct using org.bitcoinj.wallet.Protos.Extension.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + id_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + data_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + mandatory_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.Extension.getDescriptor(); + } + + public org.bitcoinj.wallet.Protos.Extension getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.Extension.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.Extension build() { + org.bitcoinj.wallet.Protos.Extension result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + private org.bitcoinj.wallet.Protos.Extension buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + org.bitcoinj.wallet.Protos.Extension result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return result; + } + + public org.bitcoinj.wallet.Protos.Extension buildPartial() { + org.bitcoinj.wallet.Protos.Extension result = new org.bitcoinj.wallet.Protos.Extension(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.data_ = data_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.mandatory_ = mandatory_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.Extension) { + return mergeFrom((org.bitcoinj.wallet.Protos.Extension)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Extension other) { + if (other == org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasData()) { + setData(other.getData()); + } + if (other.hasMandatory()) { + setMandatory(other.getMandatory()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + + return false; + } + if (!hasData()) { + + return false; + } + if (!hasMandatory()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + id_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + data_ = input.readBytes(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + mandatory_ = input.readBool(); + break; + } + } + } + } + + private int bitField0_; + + // required string id = 1; + private java.lang.Object id_ = ""; + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + id_ = s; + return s; + } else { + return (String) ref; + } + } + public Builder setId(String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + void setId(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + } + + // required bytes data = 2; + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasData() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getData() { + return data_; + } + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + data_ = value; + onChanged(); + return this; + } + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000002); + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + // required bool mandatory = 3; + private boolean mandatory_ ; + public boolean hasMandatory() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public boolean getMandatory() { + return mandatory_; + } + public Builder setMandatory(boolean value) { + bitField0_ |= 0x00000004; + mandatory_ = value; + onChanged(); + return this; + } + public Builder clearMandatory() { + bitField0_ = (bitField0_ & ~0x00000004); + mandatory_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.Extension) + } + + static { + defaultInstance = new Extension(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.Extension) + } + + public interface WalletOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string network_identifier = 1; + boolean hasNetworkIdentifier(); + String getNetworkIdentifier(); + + // optional bytes last_seen_block_hash = 2; + boolean hasLastSeenBlockHash(); + com.google.protobuf.ByteString getLastSeenBlockHash(); + + // repeated .wallet.Key key = 3; + java.util.List + getKeyList(); + org.bitcoinj.wallet.Protos.Key getKey(int index); + int getKeyCount(); + java.util.List + getKeyOrBuilderList(); + org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder( + int index); + + // repeated .wallet.Transaction transaction = 4; + java.util.List + getTransactionList(); + org.bitcoinj.wallet.Protos.Transaction getTransaction(int index); + int getTransactionCount(); + java.util.List + getTransactionOrBuilderList(); + org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder( + int index); + + // repeated .wallet.Extension extension = 10; + java.util.List + getExtensionList(); + org.bitcoinj.wallet.Protos.Extension getExtension(int index); + int getExtensionCount(); + java.util.List + getExtensionOrBuilderList(); + org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder( + int index); + } + public static final class Wallet extends + com.google.protobuf.GeneratedMessage + implements WalletOrBuilder { + // Use Wallet.newBuilder() to construct. + private Wallet(Builder builder) { + super(builder); + } + private Wallet(boolean noInit) {} + + private static final Wallet defaultInstance; + public static Wallet getDefaultInstance() { + return defaultInstance; + } + + public Wallet getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable; + } + + private int bitField0_; + // required string network_identifier = 1; + public static final int NETWORK_IDENTIFIER_FIELD_NUMBER = 1; + private java.lang.Object networkIdentifier_; + public boolean hasNetworkIdentifier() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getNetworkIdentifier() { + java.lang.Object ref = networkIdentifier_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (com.google.protobuf.Internal.isValidUtf8(bs)) { + networkIdentifier_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getNetworkIdentifierBytes() { + java.lang.Object ref = networkIdentifier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + networkIdentifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional bytes last_seen_block_hash = 2; + public static final int LAST_SEEN_BLOCK_HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString lastSeenBlockHash_; + public boolean hasLastSeenBlockHash() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getLastSeenBlockHash() { + return lastSeenBlockHash_; + } + + // repeated .wallet.Key key = 3; + public static final int KEY_FIELD_NUMBER = 3; + private java.util.List key_; + public java.util.List getKeyList() { + return key_; + } + public java.util.List + getKeyOrBuilderList() { + return key_; + } + public int getKeyCount() { + return key_.size(); + } + public org.bitcoinj.wallet.Protos.Key getKey(int index) { + return key_.get(index); + } + public org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder( + int index) { + return key_.get(index); + } + + // repeated .wallet.Transaction transaction = 4; + public static final int TRANSACTION_FIELD_NUMBER = 4; + private java.util.List transaction_; + public java.util.List getTransactionList() { + return transaction_; + } + public java.util.List + getTransactionOrBuilderList() { + return transaction_; + } + public int getTransactionCount() { + return transaction_.size(); + } + public org.bitcoinj.wallet.Protos.Transaction getTransaction(int index) { + return transaction_.get(index); + } + public org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder( + int index) { + return transaction_.get(index); + } + + // repeated .wallet.Extension extension = 10; + public static final int EXTENSION_FIELD_NUMBER = 10; + private java.util.List extension_; + public java.util.List getExtensionList() { + return extension_; + } + public java.util.List + getExtensionOrBuilderList() { + return extension_; + } + public int getExtensionCount() { + return extension_.size(); + } + public org.bitcoinj.wallet.Protos.Extension getExtension(int index) { + return extension_.get(index); + } + public org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder( + int index) { + return extension_.get(index); + } + + private void initFields() { + networkIdentifier_ = ""; + lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY; + key_ = java.util.Collections.emptyList(); + transaction_ = java.util.Collections.emptyList(); + extension_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasNetworkIdentifier()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getKeyCount(); i++) { + if (!getKey(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTransactionCount(); i++) { + if (!getTransaction(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getExtensionCount(); i++) { + if (!getExtension(i).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.writeBytes(1, getNetworkIdentifierBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, lastSeenBlockHash_); + } + for (int i = 0; i < key_.size(); i++) { + output.writeMessage(3, key_.get(i)); + } + for (int i = 0; i < transaction_.size(); i++) { + output.writeMessage(4, transaction_.get(i)); + } + for (int i = 0; i < extension_.size(); i++) { + output.writeMessage(10, extension_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getNetworkIdentifierBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, lastSeenBlockHash_); + } + for (int i = 0; i < key_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, key_.get(i)); + } + for (int i = 0; i < transaction_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, transaction_.get(i)); + } + for (int i = 0; i < extension_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, extension_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Wallet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Wallet prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.WalletOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable; + } + + // Construct using org.bitcoinj.wallet.Protos.Wallet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getKeyFieldBuilder(); + getTransactionFieldBuilder(); + getExtensionFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + networkIdentifier_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (keyBuilder_ == null) { + key_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + keyBuilder_.clear(); + } + if (transactionBuilder_ == null) { + transaction_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + transactionBuilder_.clear(); + } + if (extensionBuilder_ == null) { + extension_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + extensionBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.Wallet.getDescriptor(); + } + + public org.bitcoinj.wallet.Protos.Wallet getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.Wallet.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.Wallet build() { + org.bitcoinj.wallet.Protos.Wallet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + private org.bitcoinj.wallet.Protos.Wallet buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + org.bitcoinj.wallet.Protos.Wallet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return result; + } + + public org.bitcoinj.wallet.Protos.Wallet buildPartial() { + org.bitcoinj.wallet.Protos.Wallet result = new org.bitcoinj.wallet.Protos.Wallet(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.networkIdentifier_ = networkIdentifier_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.lastSeenBlockHash_ = lastSeenBlockHash_; + if (keyBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + key_ = java.util.Collections.unmodifiableList(key_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.key_ = key_; + } else { + result.key_ = keyBuilder_.build(); + } + if (transactionBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + transaction_ = java.util.Collections.unmodifiableList(transaction_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.transaction_ = transaction_; + } else { + result.transaction_ = transactionBuilder_.build(); + } + if (extensionBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + extension_ = java.util.Collections.unmodifiableList(extension_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.extension_ = extension_; + } else { + result.extension_ = extensionBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.Wallet) { + return mergeFrom((org.bitcoinj.wallet.Protos.Wallet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Wallet other) { + if (other == org.bitcoinj.wallet.Protos.Wallet.getDefaultInstance()) return this; + if (other.hasNetworkIdentifier()) { + setNetworkIdentifier(other.getNetworkIdentifier()); + } + if (other.hasLastSeenBlockHash()) { + setLastSeenBlockHash(other.getLastSeenBlockHash()); + } + if (keyBuilder_ == null) { + if (!other.key_.isEmpty()) { + if (key_.isEmpty()) { + key_ = other.key_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureKeyIsMutable(); + key_.addAll(other.key_); + } + onChanged(); + } + } else { + if (!other.key_.isEmpty()) { + if (keyBuilder_.isEmpty()) { + keyBuilder_.dispose(); + keyBuilder_ = null; + key_ = other.key_; + bitField0_ = (bitField0_ & ~0x00000004); + keyBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getKeyFieldBuilder() : null; + } else { + keyBuilder_.addAllMessages(other.key_); + } + } + } + if (transactionBuilder_ == null) { + if (!other.transaction_.isEmpty()) { + if (transaction_.isEmpty()) { + transaction_ = other.transaction_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureTransactionIsMutable(); + transaction_.addAll(other.transaction_); + } + onChanged(); + } + } else { + if (!other.transaction_.isEmpty()) { + if (transactionBuilder_.isEmpty()) { + transactionBuilder_.dispose(); + transactionBuilder_ = null; + transaction_ = other.transaction_; + bitField0_ = (bitField0_ & ~0x00000008); + transactionBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTransactionFieldBuilder() : null; + } else { + transactionBuilder_.addAllMessages(other.transaction_); + } + } + } + if (extensionBuilder_ == null) { + if (!other.extension_.isEmpty()) { + if (extension_.isEmpty()) { + extension_ = other.extension_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureExtensionIsMutable(); + extension_.addAll(other.extension_); + } + onChanged(); + } + } else { + if (!other.extension_.isEmpty()) { + if (extensionBuilder_.isEmpty()) { + extensionBuilder_.dispose(); + extensionBuilder_ = null; + extension_ = other.extension_; + bitField0_ = (bitField0_ & ~0x00000010); + extensionBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getExtensionFieldBuilder() : null; + } else { + extensionBuilder_.addAllMessages(other.extension_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasNetworkIdentifier()) { + + return false; + } + for (int i = 0; i < getKeyCount(); i++) { + if (!getKey(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTransactionCount(); i++) { + if (!getTransaction(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getExtensionCount(); i++) { + if (!getExtension(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + networkIdentifier_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + lastSeenBlockHash_ = input.readBytes(); + break; + } + case 26: { + org.bitcoinj.wallet.Protos.Key.Builder subBuilder = org.bitcoinj.wallet.Protos.Key.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addKey(subBuilder.buildPartial()); + break; + } + case 34: { + org.bitcoinj.wallet.Protos.Transaction.Builder subBuilder = org.bitcoinj.wallet.Protos.Transaction.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addTransaction(subBuilder.buildPartial()); + break; + } + case 82: { + org.bitcoinj.wallet.Protos.Extension.Builder subBuilder = org.bitcoinj.wallet.Protos.Extension.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addExtension(subBuilder.buildPartial()); + break; + } + } + } + } + + private int bitField0_; + + // required string network_identifier = 1; + private java.lang.Object networkIdentifier_ = ""; + public boolean hasNetworkIdentifier() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getNetworkIdentifier() { + java.lang.Object ref = networkIdentifier_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + networkIdentifier_ = s; + return s; + } else { + return (String) ref; + } + } + public Builder setNetworkIdentifier(String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + networkIdentifier_ = value; + onChanged(); + return this; + } + public Builder clearNetworkIdentifier() { + bitField0_ = (bitField0_ & ~0x00000001); + networkIdentifier_ = getDefaultInstance().getNetworkIdentifier(); + onChanged(); + return this; + } + void setNetworkIdentifier(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000001; + networkIdentifier_ = value; + onChanged(); + } + + // optional bytes last_seen_block_hash = 2; + private com.google.protobuf.ByteString lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY; + public boolean hasLastSeenBlockHash() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.google.protobuf.ByteString getLastSeenBlockHash() { + return lastSeenBlockHash_; + } + public Builder setLastSeenBlockHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + lastSeenBlockHash_ = value; + onChanged(); + return this; + } + public Builder clearLastSeenBlockHash() { + bitField0_ = (bitField0_ & ~0x00000002); + lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); + onChanged(); + return this; + } + + // repeated .wallet.Key key = 3; + private java.util.List key_ = + java.util.Collections.emptyList(); + private void ensureKeyIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + key_ = new java.util.ArrayList(key_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder> keyBuilder_; + + public java.util.List getKeyList() { + if (keyBuilder_ == null) { + return java.util.Collections.unmodifiableList(key_); + } else { + return keyBuilder_.getMessageList(); + } + } + public int getKeyCount() { + if (keyBuilder_ == null) { + return key_.size(); + } else { + return keyBuilder_.getCount(); + } + } + public org.bitcoinj.wallet.Protos.Key getKey(int index) { + if (keyBuilder_ == null) { + return key_.get(index); + } else { + return keyBuilder_.getMessage(index); + } + } + public Builder setKey( + int index, org.bitcoinj.wallet.Protos.Key value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeyIsMutable(); + key_.set(index, value); + onChanged(); + } else { + keyBuilder_.setMessage(index, value); + } + return this; + } + public Builder setKey( + int index, org.bitcoinj.wallet.Protos.Key.Builder builderForValue) { + if (keyBuilder_ == null) { + ensureKeyIsMutable(); + key_.set(index, builderForValue.build()); + onChanged(); + } else { + keyBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + public Builder addKey(org.bitcoinj.wallet.Protos.Key value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeyIsMutable(); + key_.add(value); + onChanged(); + } else { + keyBuilder_.addMessage(value); + } + return this; + } + public Builder addKey( + int index, org.bitcoinj.wallet.Protos.Key value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeyIsMutable(); + key_.add(index, value); + onChanged(); + } else { + keyBuilder_.addMessage(index, value); + } + return this; + } + public Builder addKey( + org.bitcoinj.wallet.Protos.Key.Builder builderForValue) { + if (keyBuilder_ == null) { + ensureKeyIsMutable(); + key_.add(builderForValue.build()); + onChanged(); + } else { + keyBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addKey( + int index, org.bitcoinj.wallet.Protos.Key.Builder builderForValue) { + if (keyBuilder_ == null) { + ensureKeyIsMutable(); + key_.add(index, builderForValue.build()); + onChanged(); + } else { + keyBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + public Builder addAllKey( + java.lang.Iterable values) { + if (keyBuilder_ == null) { + ensureKeyIsMutable(); + super.addAll(values, key_); + onChanged(); + } else { + keyBuilder_.addAllMessages(values); + } + return this; + } + public Builder clearKey() { + if (keyBuilder_ == null) { + key_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + keyBuilder_.clear(); + } + return this; + } + public Builder removeKey(int index) { + if (keyBuilder_ == null) { + ensureKeyIsMutable(); + key_.remove(index); + onChanged(); + } else { + keyBuilder_.remove(index); + } + return this; + } + public org.bitcoinj.wallet.Protos.Key.Builder getKeyBuilder( + int index) { + return getKeyFieldBuilder().getBuilder(index); + } + public org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder( + int index) { + if (keyBuilder_ == null) { + return key_.get(index); } else { + return keyBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getKeyOrBuilderList() { + if (keyBuilder_ != null) { + return keyBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(key_); + } + } + public org.bitcoinj.wallet.Protos.Key.Builder addKeyBuilder() { + return getKeyFieldBuilder().addBuilder( + org.bitcoinj.wallet.Protos.Key.getDefaultInstance()); + } + public org.bitcoinj.wallet.Protos.Key.Builder addKeyBuilder( + int index) { + return getKeyFieldBuilder().addBuilder( + index, org.bitcoinj.wallet.Protos.Key.getDefaultInstance()); + } + public java.util.List + getKeyBuilderList() { + return getKeyFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder> + getKeyFieldBuilder() { + if (keyBuilder_ == null) { + keyBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder>( + key_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + key_ = null; + } + return keyBuilder_; + } + + // repeated .wallet.Transaction transaction = 4; + private java.util.List transaction_ = + java.util.Collections.emptyList(); + private void ensureTransactionIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + transaction_ = new java.util.ArrayList(transaction_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder> transactionBuilder_; + + public java.util.List getTransactionList() { + if (transactionBuilder_ == null) { + return java.util.Collections.unmodifiableList(transaction_); + } else { + return transactionBuilder_.getMessageList(); + } + } + public int getTransactionCount() { + if (transactionBuilder_ == null) { + return transaction_.size(); + } else { + return transactionBuilder_.getCount(); + } + } + public org.bitcoinj.wallet.Protos.Transaction getTransaction(int index) { + if (transactionBuilder_ == null) { + return transaction_.get(index); + } else { + return transactionBuilder_.getMessage(index); + } + } + public Builder setTransaction( + int index, org.bitcoinj.wallet.Protos.Transaction value) { + if (transactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionIsMutable(); + transaction_.set(index, value); + onChanged(); + } else { + transactionBuilder_.setMessage(index, value); + } + return this; + } + public Builder setTransaction( + int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { + if (transactionBuilder_ == null) { + ensureTransactionIsMutable(); + transaction_.set(index, builderForValue.build()); + onChanged(); + } else { + transactionBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + public Builder addTransaction(org.bitcoinj.wallet.Protos.Transaction value) { + if (transactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionIsMutable(); + transaction_.add(value); + onChanged(); + } else { + transactionBuilder_.addMessage(value); + } + return this; + } + public Builder addTransaction( + int index, org.bitcoinj.wallet.Protos.Transaction value) { + if (transactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionIsMutable(); + transaction_.add(index, value); + onChanged(); + } else { + transactionBuilder_.addMessage(index, value); + } + return this; + } + public Builder addTransaction( + org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { + if (transactionBuilder_ == null) { + ensureTransactionIsMutable(); + transaction_.add(builderForValue.build()); + onChanged(); + } else { + transactionBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addTransaction( + int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { + if (transactionBuilder_ == null) { + ensureTransactionIsMutable(); + transaction_.add(index, builderForValue.build()); + onChanged(); + } else { + transactionBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + public Builder addAllTransaction( + java.lang.Iterable values) { + if (transactionBuilder_ == null) { + ensureTransactionIsMutable(); + super.addAll(values, transaction_); + onChanged(); + } else { + transactionBuilder_.addAllMessages(values); + } + return this; + } + public Builder clearTransaction() { + if (transactionBuilder_ == null) { + transaction_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + transactionBuilder_.clear(); + } + return this; + } + public Builder removeTransaction(int index) { + if (transactionBuilder_ == null) { + ensureTransactionIsMutable(); + transaction_.remove(index); + onChanged(); + } else { + transactionBuilder_.remove(index); + } + return this; + } + public org.bitcoinj.wallet.Protos.Transaction.Builder getTransactionBuilder( + int index) { + return getTransactionFieldBuilder().getBuilder(index); + } + public org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder( + int index) { + if (transactionBuilder_ == null) { + return transaction_.get(index); } else { + return transactionBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getTransactionOrBuilderList() { + if (transactionBuilder_ != null) { + return transactionBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transaction_); + } + } + public org.bitcoinj.wallet.Protos.Transaction.Builder addTransactionBuilder() { + return getTransactionFieldBuilder().addBuilder( + org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()); + } + public org.bitcoinj.wallet.Protos.Transaction.Builder addTransactionBuilder( + int index) { + return getTransactionFieldBuilder().addBuilder( + index, org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()); + } + public java.util.List + getTransactionBuilderList() { + return getTransactionFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder> + getTransactionFieldBuilder() { + if (transactionBuilder_ == null) { + transactionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder>( + transaction_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + transaction_ = null; + } + return transactionBuilder_; + } + + // repeated .wallet.Extension extension = 10; + private java.util.List extension_ = + java.util.Collections.emptyList(); + private void ensureExtensionIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + extension_ = new java.util.ArrayList(extension_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder> extensionBuilder_; + + public java.util.List getExtensionList() { + if (extensionBuilder_ == null) { + return java.util.Collections.unmodifiableList(extension_); + } else { + return extensionBuilder_.getMessageList(); + } + } + public int getExtensionCount() { + if (extensionBuilder_ == null) { + return extension_.size(); + } else { + return extensionBuilder_.getCount(); + } + } + public org.bitcoinj.wallet.Protos.Extension getExtension(int index) { + if (extensionBuilder_ == null) { + return extension_.get(index); + } else { + return extensionBuilder_.getMessage(index); + } + } + public Builder setExtension( + int index, org.bitcoinj.wallet.Protos.Extension value) { + if (extensionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionIsMutable(); + extension_.set(index, value); + onChanged(); + } else { + extensionBuilder_.setMessage(index, value); + } + return this; + } + public Builder setExtension( + int index, org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) { + if (extensionBuilder_ == null) { + ensureExtensionIsMutable(); + extension_.set(index, builderForValue.build()); + onChanged(); + } else { + extensionBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) { + if (extensionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionIsMutable(); + extension_.add(value); + onChanged(); + } else { + extensionBuilder_.addMessage(value); + } + return this; + } + public Builder addExtension( + int index, org.bitcoinj.wallet.Protos.Extension value) { + if (extensionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionIsMutable(); + extension_.add(index, value); + onChanged(); + } else { + extensionBuilder_.addMessage(index, value); + } + return this; + } + public Builder addExtension( + org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) { + if (extensionBuilder_ == null) { + ensureExtensionIsMutable(); + extension_.add(builderForValue.build()); + onChanged(); + } else { + extensionBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addExtension( + int index, org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) { + if (extensionBuilder_ == null) { + ensureExtensionIsMutable(); + extension_.add(index, builderForValue.build()); + onChanged(); + } else { + extensionBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + public Builder addAllExtension( + java.lang.Iterable values) { + if (extensionBuilder_ == null) { + ensureExtensionIsMutable(); + super.addAll(values, extension_); + onChanged(); + } else { + extensionBuilder_.addAllMessages(values); + } + return this; + } + public Builder clearExtension() { + if (extensionBuilder_ == null) { + extension_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + extensionBuilder_.clear(); + } + return this; + } + public Builder removeExtension(int index) { + if (extensionBuilder_ == null) { + ensureExtensionIsMutable(); + extension_.remove(index); + onChanged(); + } else { + extensionBuilder_.remove(index); + } + return this; + } + public org.bitcoinj.wallet.Protos.Extension.Builder getExtensionBuilder( + int index) { + return getExtensionFieldBuilder().getBuilder(index); + } + public org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder( + int index) { + if (extensionBuilder_ == null) { + return extension_.get(index); } else { + return extensionBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getExtensionOrBuilderList() { + if (extensionBuilder_ != null) { + return extensionBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(extension_); + } + } + public org.bitcoinj.wallet.Protos.Extension.Builder addExtensionBuilder() { + return getExtensionFieldBuilder().addBuilder( + org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()); + } + public org.bitcoinj.wallet.Protos.Extension.Builder addExtensionBuilder( + int index) { + return getExtensionFieldBuilder().addBuilder( + index, org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()); + } + public java.util.List + getExtensionBuilderList() { + return getExtensionFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder> + getExtensionFieldBuilder() { + if (extensionBuilder_ == null) { + extensionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder>( + extension_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + extension_ = null; + } + return extensionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:wallet.Wallet) + } + + static { + defaultInstance = new Wallet(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.Wallet) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_wallet_Key_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_wallet_Key_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_wallet_TransactionInput_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_wallet_TransactionInput_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_wallet_TransactionOutput_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_wallet_TransactionOutput_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_wallet_Transaction_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_wallet_Transaction_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_wallet_Extension_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_wallet_Extension_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_wallet_Wallet_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_wallet_Wallet_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\rbitcoin.proto\022\006wallet\"{\n\003Key\022\023\n\013privat" + + "e_key\030\001 \002(\014\022\036\n\004type\030\002 \002(\0162\020.wallet.Key.T" + + "ype\022\r\n\005label\030\003 \001(\t\022\032\n\022creation_timestamp" + + "\030\004 \001(\003\"\024\n\004Type\022\014\n\010ORIGINAL\020\001\"\203\001\n\020Transac" + + "tionInput\022\"\n\032transaction_out_point_hash\030" + + "\001 \002(\014\022#\n\033transaction_out_point_index\030\002 \002" + + "(\005\022\024\n\014script_bytes\030\003 \002(\014\022\020\n\010sequence\030\004 \001" + + "(\r\"\177\n\021TransactionOutput\022\r\n\005value\030\001 \002(\003\022\024" + + "\n\014script_bytes\030\002 \002(\014\022!\n\031spent_by_transac" + + "tion_hash\030\003 \001(\014\022\"\n\032spent_by_transaction_", + "index\030\004 \001(\005\"\326\002\n\013Transaction\022\017\n\007version\030\001" + + " \002(\005\022\014\n\004hash\030\002 \002(\014\022&\n\004pool\030\003 \002(\0162\030.walle" + + "t.Transaction.Pool\022\021\n\tlock_time\030\004 \001(\r\022\022\n" + + "\nupdated_at\030\005 \001(\003\0223\n\021transaction_input\030\006" + + " \003(\0132\030.wallet.TransactionInput\0225\n\022transa" + + "ction_output\030\007 \003(\0132\031.wallet.TransactionO" + + "utput\022\022\n\nblock_hash\030\010 \003(\014\"Y\n\004Pool\022\013\n\007UNS" + + "PENT\020\000\022\t\n\005SPENT\020\001\022\014\n\010INACTIVE\020\002\022\010\n\004DEAD\020" + + "\003\022\013\n\007PENDING\020\020\022\024\n\020PENDING_INACTIVE\020\022\"8\n\t" + + "Extension\022\n\n\002id\030\001 \002(\t\022\014\n\004data\030\002 \002(\014\022\021\n\tm", + "andatory\030\003 \002(\010\"\254\001\n\006Wallet\022\032\n\022network_ide" + + "ntifier\030\001 \002(\t\022\034\n\024last_seen_block_hash\030\002 " + + "\001(\014\022\030\n\003key\030\003 \003(\0132\013.wallet.Key\022(\n\013transac" + + "tion\030\004 \003(\0132\023.wallet.Transaction\022$\n\texten" + + "sion\030\n \003(\0132\021.wallet.ExtensionB\035\n\023org.bit" + + "coinj.walletB\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; + internal_static_wallet_Key_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_wallet_Key_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_wallet_Key_descriptor, + new java.lang.String[] { "PrivateKey", "Type", "Label", "CreationTimestamp", }, + org.bitcoinj.wallet.Protos.Key.class, + org.bitcoinj.wallet.Protos.Key.Builder.class); + internal_static_wallet_TransactionInput_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_wallet_TransactionInput_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_wallet_TransactionInput_descriptor, + new java.lang.String[] { "TransactionOutPointHash", "TransactionOutPointIndex", "ScriptBytes", "Sequence", }, + org.bitcoinj.wallet.Protos.TransactionInput.class, + org.bitcoinj.wallet.Protos.TransactionInput.Builder.class); + internal_static_wallet_TransactionOutput_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_wallet_TransactionOutput_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_wallet_TransactionOutput_descriptor, + new java.lang.String[] { "Value", "ScriptBytes", "SpentByTransactionHash", "SpentByTransactionIndex", }, + org.bitcoinj.wallet.Protos.TransactionOutput.class, + org.bitcoinj.wallet.Protos.TransactionOutput.Builder.class); + internal_static_wallet_Transaction_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_wallet_Transaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_wallet_Transaction_descriptor, + new java.lang.String[] { "Version", "Hash", "Pool", "LockTime", "UpdatedAt", "TransactionInput", "TransactionOutput", "BlockHash", }, + org.bitcoinj.wallet.Protos.Transaction.class, + org.bitcoinj.wallet.Protos.Transaction.Builder.class); + internal_static_wallet_Extension_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_wallet_Extension_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_wallet_Extension_descriptor, + new java.lang.String[] { "Id", "Data", "Mandatory", }, + org.bitcoinj.wallet.Protos.Extension.class, + org.bitcoinj.wallet.Protos.Extension.Builder.class); + internal_static_wallet_Wallet_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_wallet_Wallet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_wallet_Wallet_descriptor, + new java.lang.String[] { "NetworkIdentifier", "LastSeenBlockHash", "Key", "Transaction", "Extension", }, + org.bitcoinj.wallet.Protos.Wallet.class, + org.bitcoinj.wallet.Protos.Wallet.Builder.class); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +}