diff --git a/fabric-chaincode-integration-test/build.gradle b/fabric-chaincode-integration-test/build.gradle index 7f52d439..b87f9ed7 100644 --- a/fabric-chaincode-integration-test/build.gradle +++ b/fabric-chaincode-integration-test/build.gradle @@ -1,8 +1,7 @@ dependencies { compile project(':fabric-chaincode-docker') testCompile 'org.testcontainers:testcontainers:1.10.3' - testCompile 'org.hyperledger.fabric-sdk-java:fabric-sdk-java:1.4.1' - compile project(':fabric-chaincode-shim') + testCompile 'org.hyperledger.fabric-sdk-java:fabric-sdk-java:1.4.4' } task getLatestDockerImages{ diff --git a/fabric-chaincode-integration-test/src/test/java/org/hyperleder/fabric/shim/integration/FirstNetworkIntegrationTest.java b/fabric-chaincode-integration-test/src/test/java/org/hyperleder/fabric/shim/integration/FirstNetworkIntegrationTest.java index cb277e06..22e2858a 100644 --- a/fabric-chaincode-integration-test/src/test/java/org/hyperleder/fabric/shim/integration/FirstNetworkIntegrationTest.java +++ b/fabric-chaincode-integration-test/src/test/java/org/hyperleder/fabric/shim/integration/FirstNetworkIntegrationTest.java @@ -18,10 +18,8 @@ import java.util.List; import java.util.stream.Collectors; -import com.github.dockerjava.api.exception.ConflictException; -import com.google.protobuf.ByteString; - import org.hamcrest.Matchers; +import org.hyperledger.fabric.sdk.ChaincodeResponse; import org.hyperledger.fabric.sdk.Channel; import org.hyperledger.fabric.sdk.HFClient; import org.hyperledger.fabric.sdk.InstallProposalRequest; @@ -36,7 +34,6 @@ import org.hyperledger.fabric.sdk.exception.ProposalException; import org.hyperledger.fabric.sdk.exception.TransactionException; import org.hyperledger.fabric.sdk.security.CryptoSuite; -import org.hyperledger.fabric.shim.Chaincode; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -44,6 +41,9 @@ import org.junit.Test; import org.testcontainers.containers.DockerComposeContainer; +import com.github.dockerjava.api.exception.ConflictException; +import com.google.protobuf.ByteString; + public class FirstNetworkIntegrationTest { @ClassRule @@ -338,7 +338,7 @@ private void executeAndValidateQueryOnAccount(HFClient client, Channel channel, .stream() .filter(peer -> peer.getName().contains(peerName)) .collect(Collectors.toList()), - Matchers.is(Chaincode.Response.Status.SUCCESS.getCode()), + Matchers.is(ChaincodeResponse.Status.SUCCESS.getStatus()), Matchers.anything(), Matchers.is(ByteString.copyFrom(expectedAmount, StandardCharsets.UTF_8)) ); @@ -394,7 +394,7 @@ private void executeAndValidateQueryOnAccountNewPM(HFClient client, Channel chan .stream() .filter(peer -> peer.getName().contains(peerName)) .collect(Collectors.toList()), - Matchers.is(Chaincode.Response.Status.SUCCESS.getCode()), + Matchers.is(ChaincodeResponse.Status.SUCCESS.getStatus()), Matchers.anything(), Matchers.is(ByteString.copyFrom(expectedAmount, StandardCharsets.UTF_8)) ); diff --git a/fabric-chaincode-protos/build.gradle b/fabric-chaincode-protos/build.gradle index 34196217..e098c82f 100644 --- a/fabric-chaincode-protos/build.gradle +++ b/fabric-chaincode-protos/build.gradle @@ -32,7 +32,9 @@ def protoFiles = ['protos/common/common.proto' : "$protosDir 'protos/msp/identities.proto' : "$protosDir/msp/identities.proto", 'protos/peer/transaction.proto' : "$protosDir/peer/transaction.proto", 'protos/msp/msp_principal.proto' : "$protosDir/msp/msp_principal.proto", - 'protos/common/policies.proto' : "$protosDir/common/policies.proto"] + 'protos/common/policies.proto' : "$protosDir/common/policies.proto", + 'protos/token/operations.proto' : "$protosDir/token/operations.proto", + 'protos/token/transaction.proto' : "$protosDir/token/transaction.proto"] buildscript { repositories { diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/Common.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/Common.java index 47624e1b..8e0d2a30 100644 --- a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/Common.java +++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/Common.java @@ -455,11 +455,22 @@ public enum BlockMetadataIndex /** *
      * Block metadata array position to store operational metadata for orderers
+     *e.g. For Kafka, this is where we store the last offset written to the local ledger 
      * 
* - * ORDERER = 3; + * ORDERER = 3 [deprecated = true]; */ + @java.lang.Deprecated ORDERER(3), + /** + *
+     * Block metadata array position to store the hash of TRANSACTIONS_FILTER, State Updates,
+     *and the COMMIT_HASH of the previous block 
+     * 
+ * + * COMMIT_HASH = 4; + */ + COMMIT_HASH(4), UNRECOGNIZED(-1), ; @@ -490,11 +501,21 @@ public enum BlockMetadataIndex /** *
      * Block metadata array position to store operational metadata for orderers
+     *e.g. For Kafka, this is where we store the last offset written to the local ledger 
      * 
* - * ORDERER = 3; + * ORDERER = 3 [deprecated = true]; */ public static final int ORDERER_VALUE = 3; + /** + *
+     * Block metadata array position to store the hash of TRANSACTIONS_FILTER, State Updates,
+     *and the COMMIT_HASH of the previous block 
+     * 
+ * + * COMMIT_HASH = 4; + */ + public static final int COMMIT_HASH_VALUE = 4; public final int getNumber() { @@ -519,6 +540,7 @@ public static BlockMetadataIndex forNumber(int value) { case 1: return LAST_CONFIG; case 2: return TRANSACTIONS_FILTER; case 3: return ORDERER; + case 4: return COMMIT_HASH; default: return null; } } @@ -8786,6 +8808,640 @@ public org.hyperledger.fabric.protos.common.Common.BlockMetadata getDefaultInsta } + public interface OrdererBlockMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:common.OrdererBlockMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .common.LastConfig last_config = 1; + */ + boolean hasLastConfig(); + /** + * optional .common.LastConfig last_config = 1; + */ + org.hyperledger.fabric.protos.common.Common.LastConfig getLastConfig(); + /** + * optional .common.LastConfig last_config = 1; + */ + org.hyperledger.fabric.protos.common.Common.LastConfigOrBuilder getLastConfigOrBuilder(); + + /** + * optional bytes consenter_metadata = 2; + */ + com.google.protobuf.ByteString getConsenterMetadata(); + } + /** + *
+   * OrdererBlockMetadata defines metadata that is set by the ordering service.
+   * 
+ * + * Protobuf type {@code common.OrdererBlockMetadata} + */ + public static final class OrdererBlockMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:common.OrdererBlockMetadata) + OrdererBlockMetadataOrBuilder { + // Use OrdererBlockMetadata.newBuilder() to construct. + private OrdererBlockMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private OrdererBlockMetadata() { + consenterMetadata_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private OrdererBlockMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.common.Common.LastConfig.Builder subBuilder = null; + if (lastConfig_ != null) { + subBuilder = lastConfig_.toBuilder(); + } + lastConfig_ = input.readMessage(org.hyperledger.fabric.protos.common.Common.LastConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastConfig_); + lastConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + + consenterMetadata_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.common.Common.internal_static_common_OrdererBlockMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.common.Common.internal_static_common_OrdererBlockMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.class, org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.Builder.class); + } + + public static final int LAST_CONFIG_FIELD_NUMBER = 1; + private org.hyperledger.fabric.protos.common.Common.LastConfig lastConfig_; + /** + * optional .common.LastConfig last_config = 1; + */ + public boolean hasLastConfig() { + return lastConfig_ != null; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public org.hyperledger.fabric.protos.common.Common.LastConfig getLastConfig() { + return lastConfig_ == null ? org.hyperledger.fabric.protos.common.Common.LastConfig.getDefaultInstance() : lastConfig_; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public org.hyperledger.fabric.protos.common.Common.LastConfigOrBuilder getLastConfigOrBuilder() { + return getLastConfig(); + } + + public static final int CONSENTER_METADATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString consenterMetadata_; + /** + * optional bytes consenter_metadata = 2; + */ + public com.google.protobuf.ByteString getConsenterMetadata() { + return consenterMetadata_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (lastConfig_ != null) { + output.writeMessage(1, getLastConfig()); + } + if (!consenterMetadata_.isEmpty()) { + output.writeBytes(2, consenterMetadata_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (lastConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLastConfig()); + } + if (!consenterMetadata_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, consenterMetadata_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata other = (org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata) obj; + + boolean result = true; + result = result && (hasLastConfig() == other.hasLastConfig()); + if (hasLastConfig()) { + result = result && getLastConfig() + .equals(other.getLastConfig()); + } + result = result && getConsenterMetadata() + .equals(other.getConsenterMetadata()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasLastConfig()) { + hash = (37 * hash) + LAST_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getLastConfig().hashCode(); + } + hash = (37 * hash) + CONSENTER_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getConsenterMetadata().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * OrdererBlockMetadata defines metadata that is set by the ordering service.
+     * 
+ * + * Protobuf type {@code common.OrdererBlockMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:common.OrdererBlockMetadata) + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.common.Common.internal_static_common_OrdererBlockMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.common.Common.internal_static_common_OrdererBlockMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.class, org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (lastConfigBuilder_ == null) { + lastConfig_ = null; + } else { + lastConfig_ = null; + lastConfigBuilder_ = null; + } + consenterMetadata_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.common.Common.internal_static_common_OrdererBlockMetadata_descriptor; + } + + public org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata build() { + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata buildPartial() { + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata result = new org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata(this); + if (lastConfigBuilder_ == null) { + result.lastConfig_ = lastConfig_; + } else { + result.lastConfig_ = lastConfigBuilder_.build(); + } + result.consenterMetadata_ = consenterMetadata_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata) { + return mergeFrom((org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata other) { + if (other == org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata.getDefaultInstance()) return this; + if (other.hasLastConfig()) { + mergeLastConfig(other.getLastConfig()); + } + if (other.getConsenterMetadata() != com.google.protobuf.ByteString.EMPTY) { + setConsenterMetadata(other.getConsenterMetadata()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private org.hyperledger.fabric.protos.common.Common.LastConfig lastConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.common.Common.LastConfig, org.hyperledger.fabric.protos.common.Common.LastConfig.Builder, org.hyperledger.fabric.protos.common.Common.LastConfigOrBuilder> lastConfigBuilder_; + /** + * optional .common.LastConfig last_config = 1; + */ + public boolean hasLastConfig() { + return lastConfigBuilder_ != null || lastConfig_ != null; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public org.hyperledger.fabric.protos.common.Common.LastConfig getLastConfig() { + if (lastConfigBuilder_ == null) { + return lastConfig_ == null ? org.hyperledger.fabric.protos.common.Common.LastConfig.getDefaultInstance() : lastConfig_; + } else { + return lastConfigBuilder_.getMessage(); + } + } + /** + * optional .common.LastConfig last_config = 1; + */ + public Builder setLastConfig(org.hyperledger.fabric.protos.common.Common.LastConfig value) { + if (lastConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastConfig_ = value; + onChanged(); + } else { + lastConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public Builder setLastConfig( + org.hyperledger.fabric.protos.common.Common.LastConfig.Builder builderForValue) { + if (lastConfigBuilder_ == null) { + lastConfig_ = builderForValue.build(); + onChanged(); + } else { + lastConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public Builder mergeLastConfig(org.hyperledger.fabric.protos.common.Common.LastConfig value) { + if (lastConfigBuilder_ == null) { + if (lastConfig_ != null) { + lastConfig_ = + org.hyperledger.fabric.protos.common.Common.LastConfig.newBuilder(lastConfig_).mergeFrom(value).buildPartial(); + } else { + lastConfig_ = value; + } + onChanged(); + } else { + lastConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public Builder clearLastConfig() { + if (lastConfigBuilder_ == null) { + lastConfig_ = null; + onChanged(); + } else { + lastConfig_ = null; + lastConfigBuilder_ = null; + } + + return this; + } + /** + * optional .common.LastConfig last_config = 1; + */ + public org.hyperledger.fabric.protos.common.Common.LastConfig.Builder getLastConfigBuilder() { + + onChanged(); + return getLastConfigFieldBuilder().getBuilder(); + } + /** + * optional .common.LastConfig last_config = 1; + */ + public org.hyperledger.fabric.protos.common.Common.LastConfigOrBuilder getLastConfigOrBuilder() { + if (lastConfigBuilder_ != null) { + return lastConfigBuilder_.getMessageOrBuilder(); + } else { + return lastConfig_ == null ? + org.hyperledger.fabric.protos.common.Common.LastConfig.getDefaultInstance() : lastConfig_; + } + } + /** + * optional .common.LastConfig last_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.common.Common.LastConfig, org.hyperledger.fabric.protos.common.Common.LastConfig.Builder, org.hyperledger.fabric.protos.common.Common.LastConfigOrBuilder> + getLastConfigFieldBuilder() { + if (lastConfigBuilder_ == null) { + lastConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.common.Common.LastConfig, org.hyperledger.fabric.protos.common.Common.LastConfig.Builder, org.hyperledger.fabric.protos.common.Common.LastConfigOrBuilder>( + getLastConfig(), + getParentForChildren(), + isClean()); + lastConfig_ = null; + } + return lastConfigBuilder_; + } + + private com.google.protobuf.ByteString consenterMetadata_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes consenter_metadata = 2; + */ + public com.google.protobuf.ByteString getConsenterMetadata() { + return consenterMetadata_; + } + /** + * optional bytes consenter_metadata = 2; + */ + public Builder setConsenterMetadata(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + consenterMetadata_ = value; + onChanged(); + return this; + } + /** + * optional bytes consenter_metadata = 2; + */ + public Builder clearConsenterMetadata() { + + consenterMetadata_ = getDefaultInstance().getConsenterMetadata(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:common.OrdererBlockMetadata) + } + + // @@protoc_insertion_point(class_scope:common.OrdererBlockMetadata) + private static final org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata(); + } + + public static org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public OrdererBlockMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OrdererBlockMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.common.Common.OrdererBlockMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_common_LastConfig_descriptor; private static final @@ -8846,6 +9502,11 @@ public org.hyperledger.fabric.protos.common.Common.BlockMetadata getDefaultInsta private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_common_BlockMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_common_OrdererBlockMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_common_OrdererBlockMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -8877,21 +9538,24 @@ public org.hyperledger.fabric.protos.common.Common.BlockMetadata getDefaultInsta "lockHeader\022\016\n\006number\030\001 \001(\004\022\025\n\rprevious_h", "ash\030\002 \001(\014\022\021\n\tdata_hash\030\003 \001(\014\"\031\n\tBlockDat" + "a\022\014\n\004data\030\001 \003(\014\"!\n\rBlockMetadata\022\020\n\010meta" + - "data\030\001 \003(\014*\300\001\n\006Status\022\013\n\007UNKNOWN\020\000\022\014\n\007SU" + - "CCESS\020\310\001\022\020\n\013BAD_REQUEST\020\220\003\022\016\n\tFORBIDDEN\020" + - "\223\003\022\016\n\tNOT_FOUND\020\224\003\022\035\n\030REQUEST_ENTITY_TOO" + - "_LARGE\020\235\003\022\032\n\025INTERNAL_SERVER_ERROR\020\364\003\022\024\n" + - "\017NOT_IMPLEMENTED\020\365\003\022\030\n\023SERVICE_UNAVAILAB" + - "LE\020\367\003*\312\001\n\nHeaderType\022\013\n\007MESSAGE\020\000\022\n\n\006CON" + - "FIG\020\001\022\021\n\rCONFIG_UPDATE\020\002\022\030\n\024ENDORSER_TRA" + - "NSACTION\020\003\022\027\n\023ORDERER_TRANSACTION\020\004\022\025\n\021D", - "ELIVER_SEEK_INFO\020\005\022\025\n\021CHAINCODE_PACKAGE\020" + - "\006\022\030\n\024PEER_ADMIN_OPERATION\020\010\022\025\n\021TOKEN_TRA" + - "NSACTION\020\t*[\n\022BlockMetadataIndex\022\016\n\nSIGN" + - "ATURES\020\000\022\017\n\013LAST_CONFIG\020\001\022\027\n\023TRANSACTION" + - "S_FILTER\020\002\022\013\n\007ORDERER\020\003BS\n$org.hyperledg" + - "er.fabric.protos.commonZ+github.com/hype" + - "rledger/fabric/protos/commonb\006proto3" + "data\030\001 \003(\014\"[\n\024OrdererBlockMetadata\022\'\n\013la" + + "st_config\030\001 \001(\0132\022.common.LastConfig\022\032\n\022c" + + "onsenter_metadata\030\002 \001(\014*\300\001\n\006Status\022\013\n\007UN" + + "KNOWN\020\000\022\014\n\007SUCCESS\020\310\001\022\020\n\013BAD_REQUEST\020\220\003\022" + + "\016\n\tFORBIDDEN\020\223\003\022\016\n\tNOT_FOUND\020\224\003\022\035\n\030REQUE" + + "ST_ENTITY_TOO_LARGE\020\235\003\022\032\n\025INTERNAL_SERVE" + + "R_ERROR\020\364\003\022\024\n\017NOT_IMPLEMENTED\020\365\003\022\030\n\023SERV" + + "ICE_UNAVAILABLE\020\367\003*\312\001\n\nHeaderType\022\013\n\007MES", + "SAGE\020\000\022\n\n\006CONFIG\020\001\022\021\n\rCONFIG_UPDATE\020\002\022\030\n" + + "\024ENDORSER_TRANSACTION\020\003\022\027\n\023ORDERER_TRANS" + + "ACTION\020\004\022\025\n\021DELIVER_SEEK_INFO\020\005\022\025\n\021CHAIN" + + "CODE_PACKAGE\020\006\022\030\n\024PEER_ADMIN_OPERATION\020\010" + + "\022\025\n\021TOKEN_TRANSACTION\020\t*p\n\022BlockMetadata" + + "Index\022\016\n\nSIGNATURES\020\000\022\017\n\013LAST_CONFIG\020\001\022\027" + + "\n\023TRANSACTIONS_FILTER\020\002\022\017\n\007ORDERER\020\003\032\002\010\001" + + "\022\017\n\013COMMIT_HASH\020\004BS\n$org.hyperledger.fab" + + "ric.protos.commonZ+github.com/hyperledge" + + "r/fabric/protos/commonb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -8978,6 +9642,12 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_common_BlockMetadata_descriptor, new java.lang.String[] { "Metadata", }); + internal_static_common_OrdererBlockMetadata_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_common_OrdererBlockMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_common_OrdererBlockMetadata_descriptor, + new java.lang.String[] { "LastConfig", "ConsenterMetadata", }); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/MspPrincipal.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/MspPrincipal.java index 8097574a..9da16f2b 100644 --- a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/MspPrincipal.java +++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/common/MspPrincipal.java @@ -1886,6 +1886,14 @@ public enum MSPRoleType * PEER = 3; */ PEER(3), + /** + *
+       * Represents an MSP Orderer
+       * 
+ * + * ORDERER = 4; + */ + ORDERER(4), UNRECOGNIZED(-1), ; @@ -1921,6 +1929,14 @@ public enum MSPRoleType * PEER = 3; */ public static final int PEER_VALUE = 3; + /** + *
+       * Represents an MSP Orderer
+       * 
+ * + * ORDERER = 4; + */ + public static final int ORDERER_VALUE = 4; public final int getNumber() { @@ -1945,6 +1961,7 @@ public static MSPRoleType forNumber(int value) { case 1: return ADMIN; case 2: return CLIENT; case 3: return PEER; + case 4: return ORDERER; default: return null; } } @@ -4050,19 +4067,19 @@ public org.hyperledger.fabric.protos.common.MspPrincipal.CombinedPrincipal getDe "ITY\020\002\022\r\n\tANONYMITY\020\003\022\014\n\010COMBINED\020\004\"q\n\020Or" + "ganizationUnit\022\026\n\016msp_identifier\030\001 \001(\t\022&" + "\n\036organizational_unit_identifier\030\002 \001(\t\022\035" + - "\n\025certifiers_identifier\030\003 \001(\014\"\210\001\n\007MSPRol" + + "\n\025certifiers_identifier\030\003 \001(\014\"\225\001\n\007MSPRol" + "e\022\026\n\016msp_identifier\030\001 \001(\t\022)\n\004role\030\002 \001(\0162", - "\033.common.MSPRole.MSPRoleType\":\n\013MSPRoleT" + + "\033.common.MSPRole.MSPRoleType\"G\n\013MSPRoleT" + "ype\022\n\n\006MEMBER\020\000\022\t\n\005ADMIN\020\001\022\n\n\006CLIENT\020\002\022\010" + - "\n\004PEER\020\003\"\235\001\n\024MSPIdentityAnonymity\022M\n\016ano" + - "nymity_type\030\001 \001(\01625.common.MSPIdentityAn" + - "onymity.MSPIdentityAnonymityType\"6\n\030MSPI" + - "dentityAnonymityType\022\013\n\007NOMINAL\020\000\022\r\n\tANO" + - "NYMOUS\020\001\"=\n\021CombinedPrincipal\022(\n\nprincip" + - "als\030\001 \003(\0132\024.common.MSPPrincipalBP\n$org.h" + - "yperledger.fabric.protos.commonZ(github." + - "com/hyperledger/fabric/protos/mspb\006proto", - "3" + "\n\004PEER\020\003\022\013\n\007ORDERER\020\004\"\235\001\n\024MSPIdentityAno" + + "nymity\022M\n\016anonymity_type\030\001 \001(\01625.common." + + "MSPIdentityAnonymity.MSPIdentityAnonymit" + + "yType\"6\n\030MSPIdentityAnonymityType\022\013\n\007NOM" + + "INAL\020\000\022\r\n\tANONYMOUS\020\001\"=\n\021CombinedPrincip" + + "al\022(\n\nprincipals\030\001 \003(\0132\024.common.MSPPrinc" + + "ipalBP\n$org.hyperledger.fabric.protos.co" + + "mmonZ(github.com/hyperledger/fabric/prot", + "os/mspb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/Chaincode.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/Chaincode.java index 43e894e2..fce1c576 100644 --- a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/Chaincode.java +++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/Chaincode.java @@ -14,108 +14,6 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } - /** - *
-   * Confidentiality Levels
-   * 
- * - * Protobuf enum {@code protos.ConfidentialityLevel} - */ - public enum ConfidentialityLevel - implements com.google.protobuf.ProtocolMessageEnum { - /** - * PUBLIC = 0; - */ - PUBLIC(0), - /** - * CONFIDENTIAL = 1; - */ - CONFIDENTIAL(1), - UNRECOGNIZED(-1), - ; - - /** - * PUBLIC = 0; - */ - public static final int PUBLIC_VALUE = 0; - /** - * CONFIDENTIAL = 1; - */ - public static final int CONFIDENTIAL_VALUE = 1; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ConfidentialityLevel valueOf(int value) { - return forNumber(value); - } - - public static ConfidentialityLevel forNumber(int value) { - switch (value) { - case 0: return PUBLIC; - case 1: return CONFIDENTIAL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - ConfidentialityLevel> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ConfidentialityLevel findValueByNumber(int number) { - return ConfidentialityLevel.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.hyperledger.fabric.protos.peer.Chaincode.getDescriptor().getEnumTypes().get(0); - } - - private static final ConfidentialityLevel[] VALUES = values(); - - public static ConfidentialityLevel valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private ConfidentialityLevel(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:protos.ConfidentialityLevel) - } - public interface ChaincodeIDOrBuilder extends // @@protoc_insertion_point(interface_extends:protos.ChaincodeID) com.google.protobuf.MessageOrBuilder { @@ -1080,6 +978,18 @@ com.google.protobuf.ByteString getDecorationsOrDefault( com.google.protobuf.ByteString getDecorationsOrThrow( java.lang.String key); + + /** + *
+     * is_init is used for the application to signal that an invocation is to be routed
+     * to the legacy 'Init' function for compatibility with chaincodes which handled
+     * Init in the old way.  New applications should manage their initialized state
+     * themselves.
+     * 
+ * + * optional bool is_init = 3; + */ + boolean getIsInit(); } /** *
@@ -1100,6 +1010,7 @@ private ChaincodeInput(com.google.protobuf.GeneratedMessageV3.Builder builder
     }
     private ChaincodeInput() {
       args_ = java.util.Collections.emptyList();
+      isInit_ = false;
     }
 
     @java.lang.Override
@@ -1147,6 +1058,11 @@ private ChaincodeInput(
               decorations_.getMutableMap().put(decorations.getKey(), decorations.getValue());
               break;
             }
+            case 24: {
+
+              isInit_ = input.readBool();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -1184,6 +1100,7 @@ protected com.google.protobuf.MapField internalGetMapField(
               org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput.class, org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput.Builder.class);
     }
 
+    private int bitField0_;
     public static final int ARGS_FIELD_NUMBER = 1;
     private java.util.List args_;
     /**
@@ -1282,6 +1199,22 @@ public com.google.protobuf.ByteString getDecorationsOrThrow(
       return map.get(key);
     }
 
+    public static final int IS_INIT_FIELD_NUMBER = 3;
+    private boolean isInit_;
+    /**
+     * 
+     * is_init is used for the application to signal that an invocation is to be routed
+     * to the legacy 'Init' function for compatibility with chaincodes which handled
+     * Init in the old way.  New applications should manage their initialized state
+     * themselves.
+     * 
+ * + * optional bool is_init = 3; + */ + public boolean getIsInit() { + return isInit_; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -1306,6 +1239,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) .build(); output.writeMessage(2, decorations); } + if (isInit_ != false) { + output.writeBool(3, isInit_); + } } public int getSerializedSize() { @@ -1332,6 +1268,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, decorations); } + if (isInit_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, isInit_); + } memoizedSize = size; return size; } @@ -1352,6 +1292,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getArgsList()); result = result && internalGetDecorations().equals( other.internalGetDecorations()); + result = result && (getIsInit() + == other.getIsInit()); return result; } @@ -1370,6 +1312,9 @@ public int hashCode() { hash = (37 * hash) + DECORATIONS_FIELD_NUMBER; hash = (53 * hash) + internalGetDecorations().hashCode(); } + hash = (37 * hash) + IS_INIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsInit()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1519,6 +1464,8 @@ public Builder clear() { args_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); internalGetMutableDecorations().clear(); + isInit_ = false; + return this; } @@ -1542,6 +1489,7 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput build() { public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput buildPartial() { org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput result = new org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput(this); int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { args_ = java.util.Collections.unmodifiableList(args_); bitField0_ = (bitField0_ & ~0x00000001); @@ -1549,6 +1497,8 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeInput buildPartial( result.args_ = args_; result.decorations_ = internalGetDecorations(); result.decorations_.makeImmutable(); + result.isInit_ = isInit_; + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -1602,6 +1552,9 @@ public Builder mergeFrom(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeI } internalGetMutableDecorations().mergeFrom( other.internalGetDecorations()); + if (other.getIsInit() != false) { + setIsInit(other.getIsInit()); + } onChanged(); return this; } @@ -1819,6 +1772,53 @@ public Builder putAllDecorations( getMutableDecorations().putAll(values); return this; } + + private boolean isInit_ ; + /** + *
+       * is_init is used for the application to signal that an invocation is to be routed
+       * to the legacy 'Init' function for compatibility with chaincodes which handled
+       * Init in the old way.  New applications should manage their initialized state
+       * themselves.
+       * 
+ * + * optional bool is_init = 3; + */ + public boolean getIsInit() { + return isInit_; + } + /** + *
+       * is_init is used for the application to signal that an invocation is to be routed
+       * to the legacy 'Init' function for compatibility with chaincodes which handled
+       * Init in the old way.  New applications should manage their initialized state
+       * themselves.
+       * 
+ * + * optional bool is_init = 3; + */ + public Builder setIsInit(boolean value) { + + isInit_ = value; + onChanged(); + return this; + } + /** + *
+       * is_init is used for the application to signal that an invocation is to be routed
+       * to the legacy 'Init' function for compatibility with chaincodes which handled
+       * Init in the old way.  New applications should manage their initialized state
+       * themselves.
+       * 
+ * + * optional bool is_init = 3; + */ + public Builder clearIsInit() { + + isInit_ = false; + onChanged(); + return this; + } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; @@ -2933,15 +2933,6 @@ public interface ChaincodeDeploymentSpecOrBuilder extends * optional bytes code_package = 3; */ com.google.protobuf.ByteString getCodePackage(); - - /** - * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4; - */ - int getExecEnvValue(); - /** - * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4; - */ - org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment getExecEnv(); } /** *
@@ -2961,7 +2952,6 @@ private ChaincodeDeploymentSpec(com.google.protobuf.GeneratedMessageV3.BuilderDOCKER = 0;
-       */
-      DOCKER(0),
-      /**
-       * SYSTEM = 1;
-       */
-      SYSTEM(1),
-      UNRECOGNIZED(-1),
-      ;
-
-      /**
-       * DOCKER = 0;
-       */
-      public static final int DOCKER_VALUE = 0;
-      /**
-       * SYSTEM = 1;
-       */
-      public static final int SYSTEM_VALUE = 1;
-
-
-      public final int getNumber() {
-        if (this == UNRECOGNIZED) {
-          throw new java.lang.IllegalArgumentException(
-              "Can't get the number of an unknown enum value.");
-        }
-        return value;
-      }
-
-      /**
-       * @deprecated Use {@link #forNumber(int)} instead.
-       */
-      @java.lang.Deprecated
-      public static ExecutionEnvironment valueOf(int value) {
-        return forNumber(value);
-      }
-
-      public static ExecutionEnvironment forNumber(int value) {
-        switch (value) {
-          case 0: return DOCKER;
-          case 1: return SYSTEM;
-          default: return null;
-        }
-      }
-
-      public static com.google.protobuf.Internal.EnumLiteMap
-          internalGetValueMap() {
-        return internalValueMap;
-      }
-      private static final com.google.protobuf.Internal.EnumLiteMap<
-          ExecutionEnvironment> internalValueMap =
-            new com.google.protobuf.Internal.EnumLiteMap() {
-              public ExecutionEnvironment findValueByNumber(int number) {
-                return ExecutionEnvironment.forNumber(number);
-              }
-            };
-
-      public final com.google.protobuf.Descriptors.EnumValueDescriptor
-          getValueDescriptor() {
-        return getDescriptor().getValues().get(ordinal());
-      }
-      public final com.google.protobuf.Descriptors.EnumDescriptor
-          getDescriptorForType() {
-        return getDescriptor();
-      }
-      public static final com.google.protobuf.Descriptors.EnumDescriptor
-          getDescriptor() {
-        return org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.getDescriptor().getEnumTypes().get(0);
-      }
-
-      private static final ExecutionEnvironment[] VALUES = values();
-
-      public static ExecutionEnvironment valueOf(
-          com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
-        if (desc.getType() != getDescriptor()) {
-          throw new java.lang.IllegalArgumentException(
-            "EnumValueDescriptor is not for this type.");
-        }
-        if (desc.getIndex() == -1) {
-          return UNRECOGNIZED;
-        }
-        return VALUES[desc.getIndex()];
-      }
-
-      private final int value;
-
-      private ExecutionEnvironment(int value) {
-        this.value = value;
-      }
-
-      // @@protoc_insertion_point(enum_scope:protos.ChaincodeDeploymentSpec.ExecutionEnvironment)
-    }
-
     public static final int CHAINCODE_SPEC_FIELD_NUMBER = 1;
     private org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeSpec chaincodeSpec_;
     /**
@@ -3164,22 +3050,6 @@ public com.google.protobuf.ByteString getCodePackage() {
       return codePackage_;
     }
 
-    public static final int EXEC_ENV_FIELD_NUMBER = 4;
-    private int execEnv_;
-    /**
-     * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-     */
-    public int getExecEnvValue() {
-      return execEnv_;
-    }
-    /**
-     * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-     */
-    public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment getExecEnv() {
-      org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment result = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment.valueOf(execEnv_);
-      return result == null ? org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment.UNRECOGNIZED : result;
-    }
-
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
@@ -3198,9 +3068,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
       if (!codePackage_.isEmpty()) {
         output.writeBytes(3, codePackage_);
       }
-      if (execEnv_ != org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment.DOCKER.getNumber()) {
-        output.writeEnum(4, execEnv_);
-      }
     }
 
     public int getSerializedSize() {
@@ -3216,10 +3083,6 @@ public int getSerializedSize() {
         size += com.google.protobuf.CodedOutputStream
           .computeBytesSize(3, codePackage_);
       }
-      if (execEnv_ != org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment.DOCKER.getNumber()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(4, execEnv_);
-      }
       memoizedSize = size;
       return size;
     }
@@ -3243,7 +3106,6 @@ public boolean equals(final java.lang.Object obj) {
       }
       result = result && getCodePackage()
           .equals(other.getCodePackage());
-      result = result && execEnv_ == other.execEnv_;
       return result;
     }
 
@@ -3260,8 +3122,6 @@ public int hashCode() {
       }
       hash = (37 * hash) + CODE_PACKAGE_FIELD_NUMBER;
       hash = (53 * hash) + getCodePackage().hashCode();
-      hash = (37 * hash) + EXEC_ENV_FIELD_NUMBER;
-      hash = (53 * hash) + execEnv_;
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
@@ -3393,8 +3253,6 @@ public Builder clear() {
         }
         codePackage_ = com.google.protobuf.ByteString.EMPTY;
 
-        execEnv_ = 0;
-
         return this;
       }
 
@@ -3423,7 +3281,6 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec buil
           result.chaincodeSpec_ = chaincodeSpecBuilder_.build();
         }
         result.codePackage_ = codePackage_;
-        result.execEnv_ = execEnv_;
         onBuilt();
         return result;
       }
@@ -3471,9 +3328,6 @@ public Builder mergeFrom(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeD
         if (other.getCodePackage() != com.google.protobuf.ByteString.EMPTY) {
           setCodePackage(other.getCodePackage());
         }
-        if (other.execEnv_ != 0) {
-          setExecEnvValue(other.getExecEnvValue());
-        }
         onChanged();
         return this;
       }
@@ -3645,50 +3499,6 @@ public Builder clearCodePackage() {
         onChanged();
         return this;
       }
-
-      private int execEnv_ = 0;
-      /**
-       * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-       */
-      public int getExecEnvValue() {
-        return execEnv_;
-      }
-      /**
-       * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-       */
-      public Builder setExecEnvValue(int value) {
-        execEnv_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-       */
-      public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment getExecEnv() {
-        org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment result = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment.valueOf(execEnv_);
-        return result == null ? org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment.UNRECOGNIZED : result;
-      }
-      /**
-       * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-       */
-      public Builder setExecEnv(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.ExecutionEnvironment value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        
-        execEnv_ = value.getNumber();
-        onChanged();
-        return this;
-      }
-      /**
-       * optional .protos.ChaincodeDeploymentSpec.ExecutionEnvironment exec_env = 4;
-       */
-      public Builder clearExecEnv() {
-        
-        execEnv_ = 0;
-        onChanged();
-        return this;
-      }
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
         return this;
@@ -4863,29 +4673,26 @@ public org.hyperledger.fabric.protos.peer.Chaincode.LifecycleEvent getDefaultIns
     java.lang.String[] descriptorData = {
       "\n\024peer/chaincode.proto\022\006protos\":\n\013Chainc" +
       "odeID\022\014\n\004path\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\017\n\007ver" +
-      "sion\030\003 \001(\t\"\220\001\n\016ChaincodeInput\022\014\n\004args\030\001 " +
+      "sion\030\003 \001(\t\"\241\001\n\016ChaincodeInput\022\014\n\004args\030\001 " +
       "\003(\014\022<\n\013decorations\030\002 \003(\0132\'.protos.Chainc" +
-      "odeInput.DecorationsEntry\0322\n\020Decorations" +
-      "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\334\001" +
-      "\n\rChaincodeSpec\022(\n\004type\030\001 \001(\0162\032.protos.C" +
-      "haincodeSpec.Type\022)\n\014chaincode_id\030\002 \001(\0132" +
-      "\023.protos.ChaincodeID\022%\n\005input\030\003 \001(\0132\026.pr" +
-      "otos.ChaincodeInput\022\017\n\007timeout\030\004 \001(\005\">\n\004",
-      "Type\022\r\n\tUNDEFINED\020\000\022\n\n\006GOLANG\020\001\022\010\n\004NODE\020" +
-      "\002\022\007\n\003CAR\020\003\022\010\n\004JAVA\020\004\"\354\001\n\027ChaincodeDeploy" +
-      "mentSpec\022-\n\016chaincode_spec\030\001 \001(\0132\025.proto" +
-      "s.ChaincodeSpec\022\024\n\014code_package\030\003 \001(\014\022F\n" +
-      "\010exec_env\030\004 \001(\01624.protos.ChaincodeDeploy" +
-      "mentSpec.ExecutionEnvironment\".\n\024Executi" +
-      "onEnvironment\022\n\n\006DOCKER\020\000\022\n\n\006SYSTEM\020\001J\004\010" +
-      "\002\020\003R\016effective_date\"a\n\027ChaincodeInvocati" +
-      "onSpec\022-\n\016chaincode_spec\030\001 \001(\0132\025.protos." +
-      "ChaincodeSpecJ\004\010\002\020\003R\021id_generation_alg\"(",
-      "\n\016LifecycleEvent\022\026\n\016chaincode_name\030\001 \001(\t" +
-      "*4\n\024ConfidentialityLevel\022\n\n\006PUBLIC\020\000\022\020\n\014" +
-      "CONFIDENTIAL\020\001BO\n\"org.hyperledger.fabric" +
-      ".protos.peerZ)github.com/hyperledger/fab" +
-      "ric/protos/peerb\006proto3"
+      "odeInput.DecorationsEntry\022\017\n\007is_init\030\003 \001" +
+      "(\010\0322\n\020DecorationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" +
+      "alue\030\002 \001(\014:\0028\001\"\334\001\n\rChaincodeSpec\022(\n\004type" +
+      "\030\001 \001(\0162\032.protos.ChaincodeSpec.Type\022)\n\014ch" +
+      "aincode_id\030\002 \001(\0132\023.protos.ChaincodeID\022%\n" +
+      "\005input\030\003 \001(\0132\026.protos.ChaincodeInput\022\017\n\007",
+      "timeout\030\004 \001(\005\">\n\004Type\022\r\n\tUNDEFINED\020\000\022\n\n\006" +
+      "GOLANG\020\001\022\010\n\004NODE\020\002\022\007\n\003CAR\020\003\022\010\n\004JAVA\020\004\"\204\001" +
+      "\n\027ChaincodeDeploymentSpec\022-\n\016chaincode_s" +
+      "pec\030\001 \001(\0132\025.protos.ChaincodeSpec\022\024\n\014code" +
+      "_package\030\003 \001(\014J\004\010\002\020\003J\004\010\004\020\005R\016effective_da" +
+      "teR\010exec_env\"a\n\027ChaincodeInvocationSpec\022" +
+      "-\n\016chaincode_spec\030\001 \001(\0132\025.protos.Chainco" +
+      "deSpecJ\004\010\002\020\003R\021id_generation_alg\"(\n\016Lifec" +
+      "ycleEvent\022\026\n\016chaincode_name\030\001 \001(\tBO\n\"org" +
+      ".hyperledger.fabric.protos.peerZ)github.",
+      "com/hyperledger/fabric/protos/peerb\006prot" +
+      "o3"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
         new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
@@ -4910,7 +4717,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
     internal_static_protos_ChaincodeInput_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_protos_ChaincodeInput_descriptor,
-        new java.lang.String[] { "Args", "Decorations", });
+        new java.lang.String[] { "Args", "Decorations", "IsInit", });
     internal_static_protos_ChaincodeInput_DecorationsEntry_descriptor =
       internal_static_protos_ChaincodeInput_descriptor.getNestedTypes().get(0);
     internal_static_protos_ChaincodeInput_DecorationsEntry_fieldAccessorTable = new
@@ -4928,7 +4735,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
     internal_static_protos_ChaincodeDeploymentSpec_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_protos_ChaincodeDeploymentSpec_descriptor,
-        new java.lang.String[] { "ChaincodeSpec", "CodePackage", "ExecEnv", });
+        new java.lang.String[] { "ChaincodeSpec", "CodePackage", });
     internal_static_protos_ChaincodeInvocationSpec_descriptor =
       getDescriptor().getMessageTypes().get(4);
     internal_static_protos_ChaincodeInvocationSpec_fieldAccessorTable = new
diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ChaincodeShim.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ChaincodeShim.java
index 9c9e4a23..1e924bb0 100644
--- a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ChaincodeShim.java
+++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ChaincodeShim.java
@@ -334,6 +334,10 @@ public enum Type
        * PUT_STATE_METADATA = 21;
        */
       PUT_STATE_METADATA(21),
+      /**
+       * GET_PRIVATE_DATA_HASH = 22;
+       */
+      GET_PRIVATE_DATA_HASH(22),
       UNRECOGNIZED(-1),
       ;
 
@@ -421,6 +425,10 @@ public enum Type
        * PUT_STATE_METADATA = 21;
        */
       public static final int PUT_STATE_METADATA_VALUE = 21;
+      /**
+       * GET_PRIVATE_DATA_HASH = 22;
+       */
+      public static final int GET_PRIVATE_DATA_HASH_VALUE = 22;
 
 
       public final int getNumber() {
@@ -462,6 +470,7 @@ public static Type forNumber(int value) {
           case 19: return GET_HISTORY_FOR_KEY;
           case 20: return GET_STATE_METADATA;
           case 21: return PUT_STATE_METADATA;
+          case 22: return GET_PRIVATE_DATA_HASH;
           default: return null;
         }
       }
@@ -12400,14 +12409,14 @@ public org.hyperledger.fabric.protos.peer.ChaincodeShim.StateMetadataResult getD
     java.lang.String[] descriptorData = {
       "\n\031peer/chaincode_shim.proto\022\006protos\032\032pee" +
       "r/chaincode_event.proto\032\023peer/proposal.p" +
-      "roto\032\037google/protobuf/timestamp.proto\"\366\004" +
+      "roto\032\037google/protobuf/timestamp.proto\"\221\005" +
       "\n\020ChaincodeMessage\022+\n\004type\030\001 \001(\0162\035.proto" +
       "s.ChaincodeMessage.Type\022-\n\ttimestamp\030\002 \001" +
       "(\0132\032.google.protobuf.Timestamp\022\017\n\007payloa" +
       "d\030\003 \001(\014\022\014\n\004txid\030\004 \001(\t\022(\n\010proposal\030\005 \001(\0132" +
       "\026.protos.SignedProposal\022/\n\017chaincode_eve" +
       "nt\030\006 \001(\0132\026.protos.ChaincodeEvent\022\022\n\nchan" +
-      "nel_id\030\007 \001(\t\"\367\002\n\004Type\022\r\n\tUNDEFINED\020\000\022\014\n\010",
+      "nel_id\030\007 \001(\t\"\222\003\n\004Type\022\r\n\tUNDEFINED\020\000\022\014\n\010",
       "REGISTER\020\001\022\016\n\nREGISTERED\020\002\022\010\n\004INIT\020\003\022\t\n\005" +
       "READY\020\004\022\017\n\013TRANSACTION\020\005\022\r\n\tCOMPLETED\020\006\022" +
       "\t\n\005ERROR\020\007\022\r\n\tGET_STATE\020\010\022\r\n\tPUT_STATE\020\t" +
@@ -12416,35 +12425,36 @@ public org.hyperledger.fabric.protos.peer.ChaincodeShim.StateMetadataResult getD
       "ET_QUERY_RESULT\020\017\022\024\n\020QUERY_STATE_NEXT\020\020\022" +
       "\025\n\021QUERY_STATE_CLOSE\020\021\022\r\n\tKEEPALIVE\020\022\022\027\n" +
       "\023GET_HISTORY_FOR_KEY\020\023\022\026\n\022GET_STATE_META" +
-      "DATA\020\024\022\026\n\022PUT_STATE_METADATA\020\025\"+\n\010GetSta" +
-      "te\022\013\n\003key\030\001 \001(\t\022\022\n\ncollection\030\002 \001(\t\"3\n\020G",
-      "etStateMetadata\022\013\n\003key\030\001 \001(\t\022\022\n\ncollecti" +
-      "on\030\002 \001(\t\":\n\010PutState\022\013\n\003key\030\001 \001(\t\022\r\n\005val" +
-      "ue\030\002 \001(\014\022\022\n\ncollection\030\003 \001(\t\"\\\n\020PutState" +
-      "Metadata\022\013\n\003key\030\001 \001(\t\022\022\n\ncollection\030\003 \001(" +
-      "\t\022\'\n\010metadata\030\004 \001(\0132\025.protos.StateMetada" +
-      "ta\"+\n\010DelState\022\013\n\003key\030\001 \001(\t\022\022\n\ncollectio" +
-      "n\030\002 \001(\t\"Y\n\017GetStateByRange\022\020\n\010startKey\030\001" +
-      " \001(\t\022\016\n\006endKey\030\002 \001(\t\022\022\n\ncollection\030\003 \001(\t" +
-      "\022\020\n\010metadata\030\004 \001(\014\"E\n\016GetQueryResult\022\r\n\005" +
-      "query\030\001 \001(\t\022\022\n\ncollection\030\002 \001(\t\022\020\n\010metad",
-      "ata\030\003 \001(\014\"3\n\rQueryMetadata\022\020\n\010pageSize\030\001" +
-      " \001(\005\022\020\n\010bookmark\030\002 \001(\t\"\037\n\020GetHistoryForK" +
-      "ey\022\013\n\003key\030\001 \001(\t\"\034\n\016QueryStateNext\022\n\n\002id\030" +
-      "\001 \001(\t\"\035\n\017QueryStateClose\022\n\n\002id\030\001 \001(\t\"\'\n\020" +
-      "QueryResultBytes\022\023\n\013resultBytes\030\001 \001(\014\"j\n" +
-      "\rQueryResponse\022)\n\007results\030\001 \003(\0132\030.protos" +
-      ".QueryResultBytes\022\020\n\010has_more\030\002 \001(\010\022\n\n\002i" +
-      "d\030\003 \001(\t\022\020\n\010metadata\030\004 \001(\014\"H\n\025QueryRespon" +
-      "seMetadata\022\035\n\025fetched_records_count\030\001 \001(" +
-      "\005\022\020\n\010bookmark\030\002 \001(\t\"/\n\rStateMetadata\022\017\n\007",
-      "metakey\030\001 \001(\t\022\r\n\005value\030\002 \001(\014\"=\n\023StateMet" +
-      "adataResult\022&\n\007entries\030\001 \003(\0132\025.protos.St" +
-      "ateMetadata2X\n\020ChaincodeSupport\022D\n\010Regis" +
-      "ter\022\030.protos.ChaincodeMessage\032\030.protos.C" +
-      "haincodeMessage\"\000(\0010\001BO\n\"org.hyperledger" +
-      ".fabric.protos.peerZ)github.com/hyperled" +
-      "ger/fabric/protos/peerb\006proto3"
+      "DATA\020\024\022\026\n\022PUT_STATE_METADATA\020\025\022\031\n\025GET_PR" +
+      "IVATE_DATA_HASH\020\026\"+\n\010GetState\022\013\n\003key\030\001 \001",
+      "(\t\022\022\n\ncollection\030\002 \001(\t\"3\n\020GetStateMetada" +
+      "ta\022\013\n\003key\030\001 \001(\t\022\022\n\ncollection\030\002 \001(\t\":\n\010P" +
+      "utState\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014\022\022\n\nc" +
+      "ollection\030\003 \001(\t\"\\\n\020PutStateMetadata\022\013\n\003k" +
+      "ey\030\001 \001(\t\022\022\n\ncollection\030\003 \001(\t\022\'\n\010metadata" +
+      "\030\004 \001(\0132\025.protos.StateMetadata\"+\n\010DelStat" +
+      "e\022\013\n\003key\030\001 \001(\t\022\022\n\ncollection\030\002 \001(\t\"Y\n\017Ge" +
+      "tStateByRange\022\020\n\010startKey\030\001 \001(\t\022\016\n\006endKe" +
+      "y\030\002 \001(\t\022\022\n\ncollection\030\003 \001(\t\022\020\n\010metadata\030" +
+      "\004 \001(\014\"E\n\016GetQueryResult\022\r\n\005query\030\001 \001(\t\022\022",
+      "\n\ncollection\030\002 \001(\t\022\020\n\010metadata\030\003 \001(\014\"3\n\r" +
+      "QueryMetadata\022\020\n\010pageSize\030\001 \001(\005\022\020\n\010bookm" +
+      "ark\030\002 \001(\t\"\037\n\020GetHistoryForKey\022\013\n\003key\030\001 \001" +
+      "(\t\"\034\n\016QueryStateNext\022\n\n\002id\030\001 \001(\t\"\035\n\017Quer" +
+      "yStateClose\022\n\n\002id\030\001 \001(\t\"\'\n\020QueryResultBy" +
+      "tes\022\023\n\013resultBytes\030\001 \001(\014\"j\n\rQueryRespons" +
+      "e\022)\n\007results\030\001 \003(\0132\030.protos.QueryResultB" +
+      "ytes\022\020\n\010has_more\030\002 \001(\010\022\n\n\002id\030\003 \001(\t\022\020\n\010me" +
+      "tadata\030\004 \001(\014\"H\n\025QueryResponseMetadata\022\035\n" +
+      "\025fetched_records_count\030\001 \001(\005\022\020\n\010bookmark",
+      "\030\002 \001(\t\"/\n\rStateMetadata\022\017\n\007metakey\030\001 \001(\t" +
+      "\022\r\n\005value\030\002 \001(\014\"=\n\023StateMetadataResult\022&" +
+      "\n\007entries\030\001 \003(\0132\025.protos.StateMetadata2V" +
+      "\n\020ChaincodeSupport\022B\n\010Register\022\030.protos." +
+      "ChaincodeMessage\032\030.protos.ChaincodeMessa" +
+      "ge(\0010\001BO\n\"org.hyperledger.fabric.protos." +
+      "peerZ)github.com/hyperledger/fabric/prot" +
+      "os/peerb\006proto3"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
         new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ProposalPackage.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ProposalPackage.java
index c0bad491..1ac55dc8 100644
--- a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ProposalPackage.java
+++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/ProposalPackage.java
@@ -3043,6 +3043,55 @@ public interface ChaincodeActionOrBuilder extends
      * optional .protos.ChaincodeID chaincode_id = 4;
      */
     org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDOrBuilder getChaincodeIdOrBuilder();
+
+    /**
+     * 
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + java.util.List + getTokenOperationsList(); + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + org.hyperledger.fabric.protos.token.Operations.TokenOperation getTokenOperations(int index); + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + int getTokenOperationsCount(); + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + java.util.List + getTokenOperationsOrBuilderList(); + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder getTokenOperationsOrBuilder( + int index); } /** *
@@ -3063,6 +3112,7 @@ private ChaincodeAction(com.google.protobuf.GeneratedMessageV3.Builder builde
     private ChaincodeAction() {
       results_ = com.google.protobuf.ByteString.EMPTY;
       events_ = com.google.protobuf.ByteString.EMPTY;
+      tokenOperations_ = java.util.Collections.emptyList();
     }
 
     @java.lang.Override
@@ -3126,6 +3176,15 @@ private ChaincodeAction(
 
               break;
             }
+            case 42: {
+              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+                tokenOperations_ = new java.util.ArrayList();
+                mutable_bitField0_ |= 0x00000010;
+              }
+              tokenOperations_.add(
+                  input.readMessage(org.hyperledger.fabric.protos.token.Operations.TokenOperation.parser(), extensionRegistry));
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -3134,6 +3193,9 @@ private ChaincodeAction(
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e).setUnfinishedMessage(this);
       } finally {
+        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+          tokenOperations_ = java.util.Collections.unmodifiableList(tokenOperations_);
+        }
         makeExtensionsImmutable();
       }
     }
@@ -3149,6 +3211,7 @@ private ChaincodeAction(
               org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction.class, org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction.Builder.class);
     }
 
+    private int bitField0_;
     public static final int RESULTS_FIELD_NUMBER = 1;
     private com.google.protobuf.ByteString results_;
     /**
@@ -3255,6 +3318,66 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDOrBuilder getChai
       return getChaincodeId();
     }
 
+    public static final int TOKEN_OPERATIONS_FIELD_NUMBER = 5;
+    private java.util.List tokenOperations_;
+    /**
+     * 
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public java.util.List getTokenOperationsList() { + return tokenOperations_; + } + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public java.util.List + getTokenOperationsOrBuilderList() { + return tokenOperations_; + } + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public int getTokenOperationsCount() { + return tokenOperations_.size(); + } + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperation getTokenOperations(int index) { + return tokenOperations_.get(index); + } + /** + *
+     * This field contains the token operations requests generated by the chaincode
+     * executing this invocation
+     * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder getTokenOperationsOrBuilder( + int index) { + return tokenOperations_.get(index); + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -3279,6 +3402,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (chaincodeId_ != null) { output.writeMessage(4, getChaincodeId()); } + for (int i = 0; i < tokenOperations_.size(); i++) { + output.writeMessage(5, tokenOperations_.get(i)); + } } public int getSerializedSize() { @@ -3302,6 +3428,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getChaincodeId()); } + for (int i = 0; i < tokenOperations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, tokenOperations_.get(i)); + } memoizedSize = size; return size; } @@ -3332,6 +3462,8 @@ public boolean equals(final java.lang.Object obj) { result = result && getChaincodeId() .equals(other.getChaincodeId()); } + result = result && getTokenOperationsList() + .equals(other.getTokenOperationsList()); return result; } @@ -3354,6 +3486,10 @@ public int hashCode() { hash = (37 * hash) + CHAINCODE_ID_FIELD_NUMBER; hash = (53 * hash) + getChaincodeId().hashCode(); } + if (getTokenOperationsCount() > 0) { + hash = (37 * hash) + TOKEN_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getTokenOperationsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -3473,6 +3609,7 @@ private Builder( private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getTokenOperationsFieldBuilder(); } } public Builder clear() { @@ -3493,6 +3630,12 @@ public Builder clear() { chaincodeId_ = null; chaincodeIdBuilder_ = null; } + if (tokenOperationsBuilder_ == null) { + tokenOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + tokenOperationsBuilder_.clear(); + } return this; } @@ -3515,6 +3658,8 @@ public org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction build( public org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction buildPartial() { org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction result = new org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; result.results_ = results_; result.events_ = events_; if (responseBuilder_ == null) { @@ -3527,6 +3672,16 @@ public org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction buildP } else { result.chaincodeId_ = chaincodeIdBuilder_.build(); } + if (tokenOperationsBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + tokenOperations_ = java.util.Collections.unmodifiableList(tokenOperations_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.tokenOperations_ = tokenOperations_; + } else { + result.tokenOperations_ = tokenOperationsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -3580,6 +3735,32 @@ public Builder mergeFrom(org.hyperledger.fabric.protos.peer.ProposalPackage.Chai if (other.hasChaincodeId()) { mergeChaincodeId(other.getChaincodeId()); } + if (tokenOperationsBuilder_ == null) { + if (!other.tokenOperations_.isEmpty()) { + if (tokenOperations_.isEmpty()) { + tokenOperations_ = other.tokenOperations_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTokenOperationsIsMutable(); + tokenOperations_.addAll(other.tokenOperations_); + } + onChanged(); + } + } else { + if (!other.tokenOperations_.isEmpty()) { + if (tokenOperationsBuilder_.isEmpty()) { + tokenOperationsBuilder_.dispose(); + tokenOperationsBuilder_ = null; + tokenOperations_ = other.tokenOperations_; + bitField0_ = (bitField0_ & ~0x00000010); + tokenOperationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTokenOperationsFieldBuilder() : null; + } else { + tokenOperationsBuilder_.addAllMessages(other.tokenOperations_); + } + } + } onChanged(); return this; } @@ -3605,6 +3786,7 @@ public Builder mergeFrom( } return this; } + private int bitField0_; private com.google.protobuf.ByteString results_ = com.google.protobuf.ByteString.EMPTY; /** @@ -4035,6 +4217,336 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDOrBuilder getChai } return chaincodeIdBuilder_; } + + private java.util.List tokenOperations_ = + java.util.Collections.emptyList(); + private void ensureTokenOperationsIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + tokenOperations_ = new java.util.ArrayList(tokenOperations_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenOperation, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder, org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder> tokenOperationsBuilder_; + + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public java.util.List getTokenOperationsList() { + if (tokenOperationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tokenOperations_); + } else { + return tokenOperationsBuilder_.getMessageList(); + } + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public int getTokenOperationsCount() { + if (tokenOperationsBuilder_ == null) { + return tokenOperations_.size(); + } else { + return tokenOperationsBuilder_.getCount(); + } + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperation getTokenOperations(int index) { + if (tokenOperationsBuilder_ == null) { + return tokenOperations_.get(index); + } else { + return tokenOperationsBuilder_.getMessage(index); + } + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder setTokenOperations( + int index, org.hyperledger.fabric.protos.token.Operations.TokenOperation value) { + if (tokenOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTokenOperationsIsMutable(); + tokenOperations_.set(index, value); + onChanged(); + } else { + tokenOperationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder setTokenOperations( + int index, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder builderForValue) { + if (tokenOperationsBuilder_ == null) { + ensureTokenOperationsIsMutable(); + tokenOperations_.set(index, builderForValue.build()); + onChanged(); + } else { + tokenOperationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder addTokenOperations(org.hyperledger.fabric.protos.token.Operations.TokenOperation value) { + if (tokenOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTokenOperationsIsMutable(); + tokenOperations_.add(value); + onChanged(); + } else { + tokenOperationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder addTokenOperations( + int index, org.hyperledger.fabric.protos.token.Operations.TokenOperation value) { + if (tokenOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTokenOperationsIsMutable(); + tokenOperations_.add(index, value); + onChanged(); + } else { + tokenOperationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder addTokenOperations( + org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder builderForValue) { + if (tokenOperationsBuilder_ == null) { + ensureTokenOperationsIsMutable(); + tokenOperations_.add(builderForValue.build()); + onChanged(); + } else { + tokenOperationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder addTokenOperations( + int index, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder builderForValue) { + if (tokenOperationsBuilder_ == null) { + ensureTokenOperationsIsMutable(); + tokenOperations_.add(index, builderForValue.build()); + onChanged(); + } else { + tokenOperationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder addAllTokenOperations( + java.lang.Iterable values) { + if (tokenOperationsBuilder_ == null) { + ensureTokenOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tokenOperations_); + onChanged(); + } else { + tokenOperationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder clearTokenOperations() { + if (tokenOperationsBuilder_ == null) { + tokenOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + tokenOperationsBuilder_.clear(); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public Builder removeTokenOperations(int index) { + if (tokenOperationsBuilder_ == null) { + ensureTokenOperationsIsMutable(); + tokenOperations_.remove(index); + onChanged(); + } else { + tokenOperationsBuilder_.remove(index); + } + return this; + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder getTokenOperationsBuilder( + int index) { + return getTokenOperationsFieldBuilder().getBuilder(index); + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder getTokenOperationsOrBuilder( + int index) { + if (tokenOperationsBuilder_ == null) { + return tokenOperations_.get(index); } else { + return tokenOperationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public java.util.List + getTokenOperationsOrBuilderList() { + if (tokenOperationsBuilder_ != null) { + return tokenOperationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tokenOperations_); + } + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder addTokenOperationsBuilder() { + return getTokenOperationsFieldBuilder().addBuilder( + org.hyperledger.fabric.protos.token.Operations.TokenOperation.getDefaultInstance()); + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder addTokenOperationsBuilder( + int index) { + return getTokenOperationsFieldBuilder().addBuilder( + index, org.hyperledger.fabric.protos.token.Operations.TokenOperation.getDefaultInstance()); + } + /** + *
+       * This field contains the token operations requests generated by the chaincode
+       * executing this invocation
+       * 
+ * + * repeated .token.TokenOperation token_operations = 5; + */ + public java.util.List + getTokenOperationsBuilderList() { + return getTokenOperationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenOperation, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder, org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder> + getTokenOperationsFieldBuilder() { + if (tokenOperationsBuilder_ == null) { + tokenOperationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenOperation, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder, org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder>( + tokenOperations_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + tokenOperations_ = null; + } + return tokenOperationsBuilder_; + } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; @@ -4125,22 +4637,24 @@ public org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction getDef java.lang.String[] descriptorData = { "\n\023peer/proposal.proto\022\006protos\032\024peer/chai" + "ncode.proto\032\034peer/proposal_response.prot" + - "o\";\n\016SignedProposal\022\026\n\016proposal_bytes\030\001 " + - "\001(\014\022\021\n\tsignature\030\002 \001(\014\">\n\010Proposal\022\016\n\006he" + - "ader\030\001 \001(\014\022\017\n\007payload\030\002 \001(\014\022\021\n\textension" + - "\030\003 \001(\014\"a\n\030ChaincodeHeaderExtension\022\032\n\022pa" + - "yload_visibility\030\001 \001(\014\022)\n\014chaincode_id\030\002" + - " \001(\0132\023.protos.ChaincodeID\"\250\001\n\030ChaincodeP" + - "roposalPayload\022\r\n\005input\030\001 \001(\014\022H\n\014Transie" + - "ntMap\030\002 \003(\01322.protos.ChaincodeProposalPa", - "yload.TransientMapEntry\0323\n\021TransientMapE" + - "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\201\001\n" + - "\017ChaincodeAction\022\017\n\007results\030\001 \001(\014\022\016\n\006eve" + - "nts\030\002 \001(\014\022\"\n\010response\030\003 \001(\0132\020.protos.Res" + - "ponse\022)\n\014chaincode_id\030\004 \001(\0132\023.protos.Cha" + - "incodeIDB`\n\"org.hyperledger.fabric.proto" + - "s.peerB\017ProposalPackageZ)github.com/hype" + - "rledger/fabric/protos/peerb\006proto3" + "o\032\026token/operations.proto\";\n\016SignedPropo" + + "sal\022\026\n\016proposal_bytes\030\001 \001(\014\022\021\n\tsignature" + + "\030\002 \001(\014\">\n\010Proposal\022\016\n\006header\030\001 \001(\014\022\017\n\007pa" + + "yload\030\002 \001(\014\022\021\n\textension\030\003 \001(\014\"a\n\030Chainc" + + "odeHeaderExtension\022\032\n\022payload_visibility" + + "\030\001 \001(\014\022)\n\014chaincode_id\030\002 \001(\0132\023.protos.Ch" + + "aincodeID\"\250\001\n\030ChaincodeProposalPayload\022\r" + + "\n\005input\030\001 \001(\014\022H\n\014TransientMap\030\002 \003(\01322.pr", + "otos.ChaincodeProposalPayload.TransientM" + + "apEntry\0323\n\021TransientMapEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\262\001\n\017ChaincodeAction" + + "\022\017\n\007results\030\001 \001(\014\022\016\n\006events\030\002 \001(\014\022\"\n\010res" + + "ponse\030\003 \001(\0132\020.protos.Response\022)\n\014chainco" + + "de_id\030\004 \001(\0132\023.protos.ChaincodeID\022/\n\020toke" + + "n_operations\030\005 \003(\0132\025.token.TokenOperatio" + + "nB`\n\"org.hyperledger.fabric.protos.peerB" + + "\017ProposalPackageZ)github.com/hyperledger" + + "/fabric/protos/peerb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -4155,6 +4669,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new com.google.protobuf.Descriptors.FileDescriptor[] { org.hyperledger.fabric.protos.peer.Chaincode.getDescriptor(), org.hyperledger.fabric.protos.peer.ProposalResponsePackage.getDescriptor(), + org.hyperledger.fabric.protos.token.Operations.getDescriptor(), }, assigner); internal_static_protos_SignedProposal_descriptor = getDescriptor().getMessageTypes().get(0); @@ -4191,9 +4706,10 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_protos_ChaincodeAction_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_protos_ChaincodeAction_descriptor, - new java.lang.String[] { "Results", "Events", "Response", "ChaincodeId", }); + new java.lang.String[] { "Results", "Events", "Response", "ChaincodeId", "TokenOperations", }); org.hyperledger.fabric.protos.peer.Chaincode.getDescriptor(); org.hyperledger.fabric.protos.peer.ProposalResponsePackage.getDescriptor(); + org.hyperledger.fabric.protos.token.Operations.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/TransactionPackage.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/TransactionPackage.java index 4ac74d9f..1060481d 100644 --- a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/TransactionPackage.java +++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/peer/TransactionPackage.java @@ -119,6 +119,10 @@ public enum TxValidationCode * INVALID_WRITESET = 24; */ INVALID_WRITESET(24), + /** + * INVALID_CHAINCODE = 25; + */ + INVALID_CHAINCODE(25), /** * NOT_VALIDATED = 254; */ @@ -230,6 +234,10 @@ public enum TxValidationCode * INVALID_WRITESET = 24; */ public static final int INVALID_WRITESET_VALUE = 24; + /** + * INVALID_CHAINCODE = 25; + */ + public static final int INVALID_CHAINCODE_VALUE = 25; /** * NOT_VALIDATED = 254; */ @@ -283,6 +291,7 @@ public static TxValidationCode forNumber(int value) { case 22: return BAD_RWSET; case 23: return ILLEGAL_WRITESET; case 24: return INVALID_WRITESET; + case 25: return INVALID_CHAINCODE; case 254: return NOT_VALIDATED; case 255: return INVALID_OTHER_REASON; default: return null; @@ -350,6 +359,10 @@ public enum MetaDataKeys * VALIDATION_PARAMETER = 0; */ VALIDATION_PARAMETER(0), + /** + * VALIDATION_PARAMETER_V2 = 1; + */ + VALIDATION_PARAMETER_V2(1), UNRECOGNIZED(-1), ; @@ -357,6 +370,10 @@ public enum MetaDataKeys * VALIDATION_PARAMETER = 0; */ public static final int VALIDATION_PARAMETER_VALUE = 0; + /** + * VALIDATION_PARAMETER_V2 = 1; + */ + public static final int VALIDATION_PARAMETER_V2_VALUE = 1; public final int getNumber() { @@ -378,6 +395,7 @@ public static MetaDataKeys valueOf(int value) { public static MetaDataKeys forNumber(int value) { switch (value) { case 0: return VALIDATION_PARAMETER; + case 1: return VALIDATION_PARAMETER_V2; default: return null; } } @@ -4955,42 +4973,42 @@ public org.hyperledger.fabric.protos.peer.TransactionPackage.ChaincodeEndorsedAc descriptor; static { java.lang.String[] descriptorData = { - "\n\026peer/transaction.proto\022\006protos\032\037google" + - "/protobuf/timestamp.proto\032\034peer/proposal" + - "_response.proto\032\023common/common.proto\"A\n\021" + - "SignedTransaction\022\031\n\021transaction_bytes\030\001" + - " \001(\014\022\021\n\tsignature\030\002 \001(\014\"]\n\024ProcessedTran" + - "saction\022-\n\023transactionEnvelope\030\001 \001(\0132\020.c" + - "ommon.Envelope\022\026\n\016validationCode\030\002 \001(\005\"9" + - "\n\013Transaction\022*\n\007actions\030\001 \003(\0132\031.protos." + - "TransactionAction\"4\n\021TransactionAction\022\016" + - "\n\006header\030\001 \001(\014\022\017\n\007payload\030\002 \001(\014\"m\n\026Chain", - "codeActionPayload\022\"\n\032chaincode_proposal_" + - "payload\030\001 \001(\014\022/\n\006action\030\002 \001(\0132\037.protos.C" + - "haincodeEndorsedAction\"g\n\027ChaincodeEndor" + - "sedAction\022!\n\031proposal_response_payload\030\001" + - " \001(\014\022)\n\014endorsements\030\002 \003(\0132\023.protos.Endo" + - "rsement*\224\005\n\020TxValidationCode\022\t\n\005VALID\020\000\022" + - "\020\n\014NIL_ENVELOPE\020\001\022\017\n\013BAD_PAYLOAD\020\002\022\025\n\021BA" + - "D_COMMON_HEADER\020\003\022\031\n\025BAD_CREATOR_SIGNATU" + - "RE\020\004\022 \n\034INVALID_ENDORSER_TRANSACTION\020\005\022\036" + - "\n\032INVALID_CONFIG_TRANSACTION\020\006\022\032\n\026UNSUPP", - "ORTED_TX_PAYLOAD\020\007\022\025\n\021BAD_PROPOSAL_TXID\020" + - "\010\022\022\n\016DUPLICATE_TXID\020\t\022\036\n\032ENDORSEMENT_POL" + - "ICY_FAILURE\020\n\022\026\n\022MVCC_READ_CONFLICT\020\013\022\031\n" + - "\025PHANTOM_READ_CONFLICT\020\014\022\023\n\017UNKNOWN_TX_T" + - "YPE\020\r\022\032\n\026TARGET_CHAIN_NOT_FOUND\020\016\022\024\n\020MAR" + - "SHAL_TX_ERROR\020\017\022\020\n\014NIL_TXACTION\020\020\022\025\n\021EXP" + - "IRED_CHAINCODE\020\021\022\036\n\032CHAINCODE_VERSION_CO" + - "NFLICT\020\022\022\030\n\024BAD_HEADER_EXTENSION\020\023\022\026\n\022BA" + - "D_CHANNEL_HEADER\020\024\022\030\n\024BAD_RESPONSE_PAYLO" + - "AD\020\025\022\r\n\tBAD_RWSET\020\026\022\024\n\020ILLEGAL_WRITESET\020", - "\027\022\024\n\020INVALID_WRITESET\020\030\022\022\n\rNOT_VALIDATED" + - "\020\376\001\022\031\n\024INVALID_OTHER_REASON\020\377\001*(\n\014MetaDa" + - "taKeys\022\030\n\024VALIDATION_PARAMETER\020\000Bc\n\"org." + - "hyperledger.fabric.protos.peerB\022Transact" + - "ionPackageZ)github.com/hyperledger/fabri" + - "c/protos/peerb\006proto3" + "\n\026peer/transaction.proto\022\006protos\032\034peer/p" + + "roposal_response.proto\032\023common/common.pr" + + "oto\"A\n\021SignedTransaction\022\031\n\021transaction_" + + "bytes\030\001 \001(\014\022\021\n\tsignature\030\002 \001(\014\"]\n\024Proces" + + "sedTransaction\022-\n\023transactionEnvelope\030\001 " + + "\001(\0132\020.common.Envelope\022\026\n\016validationCode\030" + + "\002 \001(\005\"9\n\013Transaction\022*\n\007actions\030\001 \003(\0132\031." + + "protos.TransactionAction\"4\n\021TransactionA" + + "ction\022\016\n\006header\030\001 \001(\014\022\017\n\007payload\030\002 \001(\014\"m" + + "\n\026ChaincodeActionPayload\022\"\n\032chaincode_pr", + "oposal_payload\030\001 \001(\014\022/\n\006action\030\002 \001(\0132\037.p" + + "rotos.ChaincodeEndorsedAction\"g\n\027Chainco" + + "deEndorsedAction\022!\n\031proposal_response_pa" + + "yload\030\001 \001(\014\022)\n\014endorsements\030\002 \003(\0132\023.prot" + + "os.Endorsement*\253\005\n\020TxValidationCode\022\t\n\005V" + + "ALID\020\000\022\020\n\014NIL_ENVELOPE\020\001\022\017\n\013BAD_PAYLOAD\020" + + "\002\022\025\n\021BAD_COMMON_HEADER\020\003\022\031\n\025BAD_CREATOR_" + + "SIGNATURE\020\004\022 \n\034INVALID_ENDORSER_TRANSACT" + + "ION\020\005\022\036\n\032INVALID_CONFIG_TRANSACTION\020\006\022\032\n" + + "\026UNSUPPORTED_TX_PAYLOAD\020\007\022\025\n\021BAD_PROPOSA", + "L_TXID\020\010\022\022\n\016DUPLICATE_TXID\020\t\022\036\n\032ENDORSEM" + + "ENT_POLICY_FAILURE\020\n\022\026\n\022MVCC_READ_CONFLI" + + "CT\020\013\022\031\n\025PHANTOM_READ_CONFLICT\020\014\022\023\n\017UNKNO" + + "WN_TX_TYPE\020\r\022\032\n\026TARGET_CHAIN_NOT_FOUND\020\016" + + "\022\024\n\020MARSHAL_TX_ERROR\020\017\022\020\n\014NIL_TXACTION\020\020" + + "\022\025\n\021EXPIRED_CHAINCODE\020\021\022\036\n\032CHAINCODE_VER" + + "SION_CONFLICT\020\022\022\030\n\024BAD_HEADER_EXTENSION\020" + + "\023\022\026\n\022BAD_CHANNEL_HEADER\020\024\022\030\n\024BAD_RESPONS" + + "E_PAYLOAD\020\025\022\r\n\tBAD_RWSET\020\026\022\024\n\020ILLEGAL_WR" + + "ITESET\020\027\022\024\n\020INVALID_WRITESET\020\030\022\025\n\021INVALI", + "D_CHAINCODE\020\031\022\022\n\rNOT_VALIDATED\020\376\001\022\031\n\024INV" + + "ALID_OTHER_REASON\020\377\001*E\n\014MetaDataKeys\022\030\n\024" + + "VALIDATION_PARAMETER\020\000\022\033\n\027VALIDATION_PAR" + + "AMETER_V2\020\001Bc\n\"org.hyperledger.fabric.pr" + + "otos.peerB\022TransactionPackageZ)github.co" + + "m/hyperledger/fabric/protos/peerb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -5003,7 +5021,6 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.TimestampProto.getDescriptor(), org.hyperledger.fabric.protos.peer.ProposalResponsePackage.getDescriptor(), org.hyperledger.fabric.protos.common.Common.getDescriptor(), }, assigner); @@ -5043,7 +5060,6 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_protos_ChaincodeEndorsedAction_descriptor, new java.lang.String[] { "ProposalResponsePayload", "Endorsements", }); - com.google.protobuf.TimestampProto.getDescriptor(); org.hyperledger.fabric.protos.peer.ProposalResponsePackage.getDescriptor(); org.hyperledger.fabric.protos.common.Common.getDescriptor(); } diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Operations.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Operations.java new file mode 100644 index 00000000..95718c84 --- /dev/null +++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Operations.java @@ -0,0 +1,2835 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token/operations.proto + +package org.hyperledger.fabric.protos.token; + +public final class Operations { + private Operations() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TokenOperationOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenOperation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Action describes a class of token operation
+     * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction getAction(); + /** + *
+     * Action describes a class of token operation
+     * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder getActionOrBuilder(); + + public org.hyperledger.fabric.protos.token.Operations.TokenOperation.OperationCase getOperationCase(); + } + /** + *
+   * TokenOperation describes a token operation
+   * 
+ * + * Protobuf type {@code token.TokenOperation} + */ + public static final class TokenOperation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenOperation) + TokenOperationOrBuilder { + // Use TokenOperation.newBuilder() to construct. + private TokenOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenOperation() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenOperation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder subBuilder = null; + if (operationCase_ == 1) { + subBuilder = ((org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_).toBuilder(); + } + operation_ = + input.readMessage(org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_); + operation_ = subBuilder.buildPartial(); + } + operationCase_ = 1; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Operations.TokenOperation.class, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder.class); + } + + private int operationCase_ = 0; + private java.lang.Object operation_; + public enum OperationCase + implements com.google.protobuf.Internal.EnumLite { + ACTION(1), + OPERATION_NOT_SET(0); + private final int value; + private OperationCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OperationCase valueOf(int value) { + return forNumber(value); + } + + public static OperationCase forNumber(int value) { + switch (value) { + case 1: return ACTION; + case 0: return OPERATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OperationCase + getOperationCase() { + return OperationCase.forNumber( + operationCase_); + } + + public static final int ACTION_FIELD_NUMBER = 1; + /** + *
+     * Action describes a class of token operation
+     * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction getAction() { + if (operationCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } + /** + *
+     * Action describes a class of token operation
+     * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder getActionOrBuilder() { + if (operationCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (operationCase_ == 1) { + output.writeMessage(1, (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (operationCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Operations.TokenOperation)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Operations.TokenOperation other = (org.hyperledger.fabric.protos.token.Operations.TokenOperation) obj; + + boolean result = true; + result = result && getOperationCase().equals( + other.getOperationCase()); + if (!result) return false; + switch (operationCase_) { + case 1: + result = result && getAction() + .equals(other.getAction()); + break; + case 0: + default: + } + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + switch (operationCase_) { + case 1: + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Operations.TokenOperation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TokenOperation describes a token operation
+     * 
+ * + * Protobuf type {@code token.TokenOperation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenOperation) + org.hyperledger.fabric.protos.token.Operations.TokenOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Operations.TokenOperation.class, org.hyperledger.fabric.protos.token.Operations.TokenOperation.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Operations.TokenOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + operationCase_ = 0; + operation_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperation_descriptor; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperation getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Operations.TokenOperation.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperation build() { + org.hyperledger.fabric.protos.token.Operations.TokenOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperation buildPartial() { + org.hyperledger.fabric.protos.token.Operations.TokenOperation result = new org.hyperledger.fabric.protos.token.Operations.TokenOperation(this); + if (operationCase_ == 1) { + if (actionBuilder_ == null) { + result.operation_ = operation_; + } else { + result.operation_ = actionBuilder_.build(); + } + } + result.operationCase_ = operationCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Operations.TokenOperation) { + return mergeFrom((org.hyperledger.fabric.protos.token.Operations.TokenOperation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Operations.TokenOperation other) { + if (other == org.hyperledger.fabric.protos.token.Operations.TokenOperation.getDefaultInstance()) return this; + switch (other.getOperationCase()) { + case ACTION: { + mergeAction(other.getAction()); + break; + } + case OPERATION_NOT_SET: { + break; + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Operations.TokenOperation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Operations.TokenOperation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int operationCase_ = 0; + private java.lang.Object operation_; + public OperationCase + getOperationCase() { + return OperationCase.forNumber( + operationCase_); + } + + public Builder clearOperation() { + operationCase_ = 0; + operation_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction, org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder, org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder> actionBuilder_; + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction getAction() { + if (actionBuilder_ == null) { + if (operationCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } else { + if (operationCase_ == 1) { + return actionBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public Builder setAction(org.hyperledger.fabric.protos.token.Operations.TokenOperationAction value) { + if (actionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + actionBuilder_.setMessage(value); + } + operationCase_ = 1; + return this; + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public Builder setAction( + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder builderForValue) { + if (actionBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + actionBuilder_.setMessage(builderForValue.build()); + } + operationCase_ = 1; + return this; + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public Builder mergeAction(org.hyperledger.fabric.protos.token.Operations.TokenOperationAction value) { + if (actionBuilder_ == null) { + if (operationCase_ == 1 && + operation_ != org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance()) { + operation_ = org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.newBuilder((org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_) + .mergeFrom(value).buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + if (operationCase_ == 1) { + actionBuilder_.mergeFrom(value); + } + actionBuilder_.setMessage(value); + } + operationCase_ = 1; + return this; + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public Builder clearAction() { + if (actionBuilder_ == null) { + if (operationCase_ == 1) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + } else { + if (operationCase_ == 1) { + operationCase_ = 0; + operation_ = null; + } + actionBuilder_.clear(); + } + return this; + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder getActionBuilder() { + return getActionFieldBuilder().getBuilder(); + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder getActionOrBuilder() { + if ((operationCase_ == 1) && (actionBuilder_ != null)) { + return actionBuilder_.getMessageOrBuilder(); + } else { + if (operationCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } + } + /** + *
+       * Action describes a class of token operation
+       * 
+ * + * optional .token.TokenOperationAction Action = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction, org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder, org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder> + getActionFieldBuilder() { + if (actionBuilder_ == null) { + if (!(operationCase_ == 1)) { + operation_ = org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } + actionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction, org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder, org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder>( + (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) operation_, + getParentForChildren(), + isClean()); + operation_ = null; + } + operationCase_ = 1; + onChanged();; + return actionBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenOperation) + } + + // @@protoc_insertion_point(class_scope:token.TokenOperation) + private static final org.hyperledger.fabric.protos.token.Operations.TokenOperation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Operations.TokenOperation(); + } + + public static org.hyperledger.fabric.protos.token.Operations.TokenOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenOperation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TokenOperationActionOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenOperationAction) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Issue describes a token issue operation
+     * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getIssue(); + /** + *
+     * Issue describes a token issue operation
+     * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder getIssueOrBuilder(); + + /** + *
+     * Transfer describes a token transfer operation
+     * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getTransfer(); + /** + *
+     * Transfer describes a token transfer operation
+     * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder getTransferOrBuilder(); + + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.PayloadCase getPayloadCase(); + } + /** + *
+   * TokenOperationAction lists the available operations
+   * 
+ * + * Protobuf type {@code token.TokenOperationAction} + */ + public static final class TokenOperationAction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenOperationAction) + TokenOperationActionOrBuilder { + // Use TokenOperationAction.newBuilder() to construct. + private TokenOperationAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenOperationAction() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenOperationAction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder subBuilder = null; + if (payloadCase_ == 1) { + subBuilder = ((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_).toBuilder(); + } + payload_ = + input.readMessage(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 1; + break; + } + case 18: { + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder subBuilder = null; + if (payloadCase_ == 2) { + subBuilder = ((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_).toBuilder(); + } + payload_ = + input.readMessage(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 2; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperationAction_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperationAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.class, org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder.class); + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + public enum PayloadCase + implements com.google.protobuf.Internal.EnumLite { + ISSUE(1), + TRANSFER(2), + PAYLOAD_NOT_SET(0); + private final int value; + private PayloadCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: return ISSUE; + case 2: return TRANSFER; + case 0: return PAYLOAD_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public static final int ISSUE_FIELD_NUMBER = 1; + /** + *
+     * Issue describes a token issue operation
+     * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getIssue() { + if (payloadCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + /** + *
+     * Issue describes a token issue operation
+     * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder getIssueOrBuilder() { + if (payloadCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + + public static final int TRANSFER_FIELD_NUMBER = 2; + /** + *
+     * Transfer describes a token transfer operation
+     * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getTransfer() { + if (payloadCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + /** + *
+     * Transfer describes a token transfer operation
+     * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder getTransferOrBuilder() { + if (payloadCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_); + } + if (payloadCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Operations.TokenOperationAction)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction other = (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) obj; + + boolean result = true; + result = result && getPayloadCase().equals( + other.getPayloadCase()); + if (!result) return false; + switch (payloadCase_) { + case 1: + result = result && getIssue() + .equals(other.getIssue()); + break; + case 2: + result = result && getTransfer() + .equals(other.getTransfer()); + break; + case 0: + default: + } + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + break; + case 2: + hash = (37 * hash) + TRANSFER_FIELD_NUMBER; + hash = (53 * hash) + getTransfer().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Operations.TokenOperationAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TokenOperationAction lists the available operations
+     * 
+ * + * Protobuf type {@code token.TokenOperationAction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenOperationAction) + org.hyperledger.fabric.protos.token.Operations.TokenOperationActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperationAction_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperationAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.class, org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + payloadCase_ = 0; + payload_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenOperationAction_descriptor; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction build() { + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction buildPartial() { + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction result = new org.hyperledger.fabric.protos.token.Operations.TokenOperationAction(this); + if (payloadCase_ == 1) { + if (issueBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = issueBuilder_.build(); + } + } + if (payloadCase_ == 2) { + if (transferBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = transferBuilder_.build(); + } + } + result.payloadCase_ = payloadCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) { + return mergeFrom((org.hyperledger.fabric.protos.token.Operations.TokenOperationAction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Operations.TokenOperationAction other) { + if (other == org.hyperledger.fabric.protos.token.Operations.TokenOperationAction.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case ISSUE: { + mergeIssue(other.getIssue()); + break; + } + case TRANSFER: { + mergeTransfer(other.getTransfer()); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Operations.TokenOperationAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Operations.TokenOperationAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int payloadCase_ = 0; + private java.lang.Object payload_; + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder, org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder> issueBuilder_; + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getIssue() { + if (issueBuilder_ == null) { + if (payloadCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return issueBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public Builder setIssue(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + issueBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public Builder setIssue( + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder builderForValue) { + if (issueBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public Builder mergeIssue(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms value) { + if (issueBuilder_ == null) { + if (payloadCase_ == 1 && + payload_ != org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance()) { + payload_ = org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.newBuilder((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + issueBuilder_.mergeFrom(value); + } + issueBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public Builder clearIssue() { + if (issueBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + issueBuilder_.clear(); + } + return this; + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder getIssueBuilder() { + return getIssueFieldBuilder().getBuilder(); + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder getIssueOrBuilder() { + if ((payloadCase_ == 1) && (issueBuilder_ != null)) { + return issueBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + } + /** + *
+       * Issue describes a token issue operation
+       * 
+ * + * optional .token.TokenActionTerms Issue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder, org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + issueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder, org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder>( + (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged();; + return issueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder, org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder> transferBuilder_; + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getTransfer() { + if (transferBuilder_ == null) { + if (payloadCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return transferBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public Builder setTransfer(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms value) { + if (transferBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + transferBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public Builder setTransfer( + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder builderForValue) { + if (transferBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + transferBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public Builder mergeTransfer(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms value) { + if (transferBuilder_ == null) { + if (payloadCase_ == 2 && + payload_ != org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance()) { + payload_ = org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.newBuilder((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + transferBuilder_.mergeFrom(value); + } + transferBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public Builder clearTransfer() { + if (transferBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + transferBuilder_.clear(); + } + return this; + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder getTransferBuilder() { + return getTransferFieldBuilder().getBuilder(); + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder getTransferOrBuilder() { + if ((payloadCase_ == 2) && (transferBuilder_ != null)) { + return transferBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_; + } + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + } + /** + *
+       * Transfer describes a token transfer operation
+       * 
+ * + * optional .token.TokenActionTerms Transfer = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder, org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder> + getTransferFieldBuilder() { + if (transferBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + transferBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder, org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder>( + (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged();; + return transferBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenOperationAction) + } + + // @@protoc_insertion_point(class_scope:token.TokenOperationAction) + private static final org.hyperledger.fabric.protos.token.Operations.TokenOperationAction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Operations.TokenOperationAction(); + } + + public static org.hyperledger.fabric.protos.token.Operations.TokenOperationAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenOperationAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenOperationAction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenOperationAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TokenActionTermsOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenActionTerms) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Sender is the party who should perform the operation
+     * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + boolean hasSender(); + /** + *
+     * Sender is the party who should perform the operation
+     * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOwner getSender(); + /** + *
+     * Sender is the party who should perform the operation
+     * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder getSenderOrBuilder(); + + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + java.util.List + getOutputsList(); + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index); + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + int getOutputsCount(); + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + java.util.List + getOutputsOrBuilderList(); + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index); + } + /** + *
+   * TokenActionTerms describes the expected sender and outputs of a token operation
+   * 
+ * + * Protobuf type {@code token.TokenActionTerms} + */ + public static final class TokenActionTerms extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenActionTerms) + TokenActionTermsOrBuilder { + // Use TokenActionTerms.newBuilder() to construct. + private TokenActionTerms(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenActionTerms() { + outputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenActionTerms( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder subBuilder = null; + if (sender_ != null) { + subBuilder = sender_.toBuilder(); + } + sender_ = input.readMessage(org.hyperledger.fabric.protos.token.Transaction.TokenOwner.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sender_); + sender_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + outputs_.add( + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.Token.parser(), extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenActionTerms_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenActionTerms_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.class, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder.class); + } + + private int bitField0_; + public static final int SENDER_FIELD_NUMBER = 1; + private org.hyperledger.fabric.protos.token.Transaction.TokenOwner sender_; + /** + *
+     * Sender is the party who should perform the operation
+     * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public boolean hasSender() { + return sender_ != null; + } + /** + *
+     * Sender is the party who should perform the operation
+     * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner getSender() { + return sender_ == null ? org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance() : sender_; + } + /** + *
+     * Sender is the party who should perform the operation
+     * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder getSenderOrBuilder() { + return getSender(); + } + + public static final int OUTPUTS_FIELD_NUMBER = 2; + private java.util.List outputs_; + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + public java.util.List getOutputsList() { + return outputs_; + } + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + public int getOutputsCount() { + return outputs_.size(); + } + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index) { + return outputs_.get(index); + } + /** + *
+     * Outputs contains the expected outputs
+     * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index) { + return outputs_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sender_ != null) { + output.writeMessage(1, getSender()); + } + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(2, outputs_.get(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sender_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSender()); + } + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, outputs_.get(i)); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Operations.TokenActionTerms)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms other = (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) obj; + + boolean result = true; + result = result && (hasSender() == other.hasSender()); + if (hasSender()) { + result = result && getSender() + .equals(other.getSender()); + } + result = result && getOutputsList() + .equals(other.getOutputsList()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasSender()) { + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + } + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TokenActionTerms describes the expected sender and outputs of a token operation
+     * 
+ * + * Protobuf type {@code token.TokenActionTerms} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenActionTerms) + org.hyperledger.fabric.protos.token.Operations.TokenActionTermsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenActionTerms_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenActionTerms_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.class, org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOutputsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (senderBuilder_ == null) { + sender_ = null; + } else { + sender_ = null; + senderBuilder_ = null; + } + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + outputsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Operations.internal_static_token_TokenActionTerms_descriptor; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms build() { + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms buildPartial() { + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms result = new org.hyperledger.fabric.protos.token.Operations.TokenActionTerms(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (senderBuilder_ == null) { + result.sender_ = sender_; + } else { + result.sender_ = senderBuilder_.build(); + } + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) { + return mergeFrom((org.hyperledger.fabric.protos.token.Operations.TokenActionTerms)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Operations.TokenActionTerms other) { + if (other == org.hyperledger.fabric.protos.token.Operations.TokenActionTerms.getDefaultInstance()) return this; + if (other.hasSender()) { + mergeSender(other.getSender()); + } + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + outputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOutputsFieldBuilder() : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Operations.TokenActionTerms parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Operations.TokenActionTerms) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.hyperledger.fabric.protos.token.Transaction.TokenOwner sender_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenOwner, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder> senderBuilder_; + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public boolean hasSender() { + return senderBuilder_ != null || sender_ != null; + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner getSender() { + if (senderBuilder_ == null) { + return sender_ == null ? org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance() : sender_; + } else { + return senderBuilder_.getMessage(); + } + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public Builder setSender(org.hyperledger.fabric.protos.token.Transaction.TokenOwner value) { + if (senderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sender_ = value; + onChanged(); + } else { + senderBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public Builder setSender( + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder builderForValue) { + if (senderBuilder_ == null) { + sender_ = builderForValue.build(); + onChanged(); + } else { + senderBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public Builder mergeSender(org.hyperledger.fabric.protos.token.Transaction.TokenOwner value) { + if (senderBuilder_ == null) { + if (sender_ != null) { + sender_ = + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.newBuilder(sender_).mergeFrom(value).buildPartial(); + } else { + sender_ = value; + } + onChanged(); + } else { + senderBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public Builder clearSender() { + if (senderBuilder_ == null) { + sender_ = null; + onChanged(); + } else { + sender_ = null; + senderBuilder_ = null; + } + + return this; + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder getSenderBuilder() { + + onChanged(); + return getSenderFieldBuilder().getBuilder(); + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder getSenderOrBuilder() { + if (senderBuilder_ != null) { + return senderBuilder_.getMessageOrBuilder(); + } else { + return sender_ == null ? + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance() : sender_; + } + } + /** + *
+       * Sender is the party who should perform the operation
+       * 
+ * + * optional .token.TokenOwner Sender = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenOwner, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder> + getSenderFieldBuilder() { + if (senderBuilder_ == null) { + senderBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenOwner, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder>( + getSender(), + getParentForChildren(), + isClean()); + sender_ = null; + } + return senderBuilder_; + } + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder> outputsBuilder_; + + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder setOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder setOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder addOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder addOutputs( + org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder addOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder getOutputsBuilder( + int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder addOutputsBuilder() { + return getOutputsFieldBuilder().addBuilder( + org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()); + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder addOutputsBuilder( + int index) { + return getOutputsFieldBuilder().addBuilder( + index, org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()); + } + /** + *
+       * Outputs contains the expected outputs
+       * 
+ * + * repeated .token.Token Outputs = 2; + */ + public java.util.List + getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder>( + outputs_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenActionTerms) + } + + // @@protoc_insertion_point(class_scope:token.TokenActionTerms) + private static final org.hyperledger.fabric.protos.token.Operations.TokenActionTerms DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Operations.TokenActionTerms(); + } + + public static org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenActionTerms parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenActionTerms(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Operations.TokenActionTerms getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenOperation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenOperation_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenOperationAction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenOperationAction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenActionTerms_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenActionTerms_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\026token/operations.proto\022\005token\032\027token/t" + + "ransaction.proto\"L\n\016TokenOperation\022-\n\006Ac" + + "tion\030\001 \001(\0132\033.token.TokenOperationActionH" + + "\000B\013\n\tOperation\"x\n\024TokenOperationAction\022(" + + "\n\005Issue\030\001 \001(\0132\027.token.TokenActionTermsH\000" + + "\022+\n\010Transfer\030\002 \001(\0132\027.token.TokenActionTe" + + "rmsH\000B\t\n\007Payload\"T\n\020TokenActionTerms\022!\n\006" + + "Sender\030\001 \001(\0132\021.token.TokenOwner\022\035\n\007Outpu" + + "ts\030\002 \003(\0132\014.token.TokenBQ\n#org.hyperledge" + + "r.fabric.protos.tokenZ*github.com/hyperl", + "edger/fabric/protos/tokenb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.hyperledger.fabric.protos.token.Transaction.getDescriptor(), + }, assigner); + internal_static_token_TokenOperation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_token_TokenOperation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenOperation_descriptor, + new java.lang.String[] { "Action", "Operation", }); + internal_static_token_TokenOperationAction_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_token_TokenOperationAction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenOperationAction_descriptor, + new java.lang.String[] { "Issue", "Transfer", "Payload", }); + internal_static_token_TokenActionTerms_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_token_TokenActionTerms_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenActionTerms_descriptor, + new java.lang.String[] { "Sender", "Outputs", }); + org.hyperledger.fabric.protos.token.Transaction.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Transaction.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Transaction.java new file mode 100644 index 00000000..7ca2d875 --- /dev/null +++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Transaction.java @@ -0,0 +1,6471 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: token/transaction.proto + +package org.hyperledger.fabric.protos.token; + +public final class Transaction { + private Transaction() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TokenTransactionOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenTransaction) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .token.TokenAction token_action = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenAction getTokenAction(); + /** + * optional .token.TokenAction token_action = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder getTokenActionOrBuilder(); + + public org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.ActionCase getActionCase(); + } + /** + *
+   * TokenTransaction governs the structure of Payload.data, when
+   * the transaction's envelope header indicates a transaction of type
+   * "Token"
+   * 
+ * + * Protobuf type {@code token.TokenTransaction} + */ + public static final class TokenTransaction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenTransaction) + TokenTransactionOrBuilder { + // Use TokenTransaction.newBuilder() to construct. + private TokenTransaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenTransaction() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenTransaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder subBuilder = null; + if (actionCase_ == 1) { + subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_).toBuilder(); + } + action_ = + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.TokenAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 1; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.class, org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.Builder.class); + } + + private int actionCase_ = 0; + private java.lang.Object action_; + public enum ActionCase + implements com.google.protobuf.Internal.EnumLite { + TOKEN_ACTION(1), + ACTION_NOT_SET(0); + private final int value; + private ActionCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ActionCase valueOf(int value) { + return forNumber(value); + } + + public static ActionCase forNumber(int value) { + switch (value) { + case 1: return TOKEN_ACTION; + case 0: return ACTION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ActionCase + getActionCase() { + return ActionCase.forNumber( + actionCase_); + } + + public static final int TOKEN_ACTION_FIELD_NUMBER = 1; + /** + * optional .token.TokenAction token_action = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenAction getTokenAction() { + if (actionCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_; + } + return org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } + /** + * optional .token.TokenAction token_action = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder getTokenActionOrBuilder() { + if (actionCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_; + } + return org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (actionCase_ == 1) { + output.writeMessage(1, (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (actionCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.TokenTransaction)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.TokenTransaction other = (org.hyperledger.fabric.protos.token.Transaction.TokenTransaction) obj; + + boolean result = true; + result = result && getActionCase().equals( + other.getActionCase()); + if (!result) return false; + switch (actionCase_) { + case 1: + result = result && getTokenAction() + .equals(other.getTokenAction()); + break; + case 0: + default: + } + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + switch (actionCase_) { + case 1: + hash = (37 * hash) + TOKEN_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getTokenAction().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.TokenTransaction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TokenTransaction governs the structure of Payload.data, when
+     * the transaction's envelope header indicates a transaction of type
+     * "Token"
+     * 
+ * + * Protobuf type {@code token.TokenTransaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenTransaction) + org.hyperledger.fabric.protos.token.Transaction.TokenTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.class, org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + actionCase_ = 0; + action_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenTransaction_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenTransaction getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenTransaction build() { + org.hyperledger.fabric.protos.token.Transaction.TokenTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenTransaction buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.TokenTransaction result = new org.hyperledger.fabric.protos.token.Transaction.TokenTransaction(this); + if (actionCase_ == 1) { + if (tokenActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = tokenActionBuilder_.build(); + } + } + result.actionCase_ = actionCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.TokenTransaction) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.TokenTransaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.TokenTransaction other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.TokenTransaction.getDefaultInstance()) return this; + switch (other.getActionCase()) { + case TOKEN_ACTION: { + mergeTokenAction(other.getTokenAction()); + break; + } + case ACTION_NOT_SET: { + break; + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.TokenTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.TokenTransaction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int actionCase_ = 0; + private java.lang.Object action_; + public ActionCase + getActionCase() { + return ActionCase.forNumber( + actionCase_); + } + + public Builder clearAction() { + actionCase_ = 0; + action_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenAction, org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder> tokenActionBuilder_; + /** + * optional .token.TokenAction token_action = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenAction getTokenAction() { + if (tokenActionBuilder_ == null) { + if (actionCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_; + } + return org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } else { + if (actionCase_ == 1) { + return tokenActionBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } + } + /** + * optional .token.TokenAction token_action = 1; + */ + public Builder setTokenAction(org.hyperledger.fabric.protos.token.Transaction.TokenAction value) { + if (tokenActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + tokenActionBuilder_.setMessage(value); + } + actionCase_ = 1; + return this; + } + /** + * optional .token.TokenAction token_action = 1; + */ + public Builder setTokenAction( + org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder builderForValue) { + if (tokenActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + tokenActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 1; + return this; + } + /** + * optional .token.TokenAction token_action = 1; + */ + public Builder mergeTokenAction(org.hyperledger.fabric.protos.token.Transaction.TokenAction value) { + if (tokenActionBuilder_ == null) { + if (actionCase_ == 1 && + action_ != org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance()) { + action_ = org.hyperledger.fabric.protos.token.Transaction.TokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_) + .mergeFrom(value).buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 1) { + tokenActionBuilder_.mergeFrom(value); + } + tokenActionBuilder_.setMessage(value); + } + actionCase_ = 1; + return this; + } + /** + * optional .token.TokenAction token_action = 1; + */ + public Builder clearTokenAction() { + if (tokenActionBuilder_ == null) { + if (actionCase_ == 1) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 1) { + actionCase_ = 0; + action_ = null; + } + tokenActionBuilder_.clear(); + } + return this; + } + /** + * optional .token.TokenAction token_action = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder getTokenActionBuilder() { + return getTokenActionFieldBuilder().getBuilder(); + } + /** + * optional .token.TokenAction token_action = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder getTokenActionOrBuilder() { + if ((actionCase_ == 1) && (tokenActionBuilder_ != null)) { + return tokenActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_; + } + return org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } + } + /** + * optional .token.TokenAction token_action = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenAction, org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder> + getTokenActionFieldBuilder() { + if (tokenActionBuilder_ == null) { + if (!(actionCase_ == 1)) { + action_ = org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } + tokenActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenAction, org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder>( + (org.hyperledger.fabric.protos.token.Transaction.TokenAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 1; + onChanged();; + return tokenActionBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenTransaction) + } + + // @@protoc_insertion_point(class_scope:token.TokenTransaction) + private static final org.hyperledger.fabric.protos.token.Transaction.TokenTransaction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.TokenTransaction(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenTransaction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenTransaction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenTransaction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TokenActionOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenAction) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * An issue action
+     * 
+ * + * optional .token.Issue issue = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.Issue getIssue(); + /** + *
+     * An issue action
+     * 
+ * + * optional .token.Issue issue = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder getIssueOrBuilder(); + + /** + *
+     * A transfer action
+     * 
+ * + * optional .token.Transfer transfer = 2; + */ + org.hyperledger.fabric.protos.token.Transaction.Transfer getTransfer(); + /** + *
+     * A transfer action
+     * 
+ * + * optional .token.Transfer transfer = 2; + */ + org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder getTransferOrBuilder(); + + /** + *
+     * A redeem action
+     * 
+ * + * optional .token.Transfer redeem = 3; + */ + org.hyperledger.fabric.protos.token.Transaction.Transfer getRedeem(); + /** + *
+     * A redeem action
+     * 
+ * + * optional .token.Transfer redeem = 3; + */ + org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder getRedeemOrBuilder(); + + public org.hyperledger.fabric.protos.token.Transaction.TokenAction.DataCase getDataCase(); + } + /** + *
+   * TokenAction specifies the structure of the action that a token undertakes
+   * 
+ * + * Protobuf type {@code token.TokenAction} + */ + public static final class TokenAction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenAction) + TokenActionOrBuilder { + // Use TokenAction.newBuilder() to construct. + private TokenAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenAction() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenAction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.token.Transaction.Issue.Builder subBuilder = null; + if (dataCase_ == 1) { + subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.Issue) data_).toBuilder(); + } + data_ = + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.Issue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.Issue) data_); + data_ = subBuilder.buildPartial(); + } + dataCase_ = 1; + break; + } + case 18: { + org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder subBuilder = null; + if (dataCase_ == 2) { + subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.Transfer) data_).toBuilder(); + } + data_ = + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.Transfer.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.Transfer) data_); + data_ = subBuilder.buildPartial(); + } + dataCase_ = 2; + break; + } + case 26: { + org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder subBuilder = null; + if (dataCase_ == 3) { + subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.Transfer) data_).toBuilder(); + } + data_ = + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.Transfer.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.Transfer) data_); + data_ = subBuilder.buildPartial(); + } + dataCase_ = 3; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenAction_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenAction.class, org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder.class); + } + + private int dataCase_ = 0; + private java.lang.Object data_; + public enum DataCase + implements com.google.protobuf.Internal.EnumLite { + ISSUE(1), + TRANSFER(2), + REDEEM(3), + DATA_NOT_SET(0); + private final int value; + private DataCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 1: return ISSUE; + case 2: return TRANSFER; + case 3: return REDEEM; + case 0: return DATA_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public static final int ISSUE_FIELD_NUMBER = 1; + /** + *
+     * An issue action
+     * 
+ * + * optional .token.Issue issue = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Issue getIssue() { + if (dataCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.Issue) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } + /** + *
+     * An issue action
+     * 
+ * + * optional .token.Issue issue = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder getIssueOrBuilder() { + if (dataCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.Issue) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } + + public static final int TRANSFER_FIELD_NUMBER = 2; + /** + *
+     * A transfer action
+     * 
+ * + * optional .token.Transfer transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Transfer getTransfer() { + if (dataCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + /** + *
+     * A transfer action
+     * 
+ * + * optional .token.Transfer transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder getTransferOrBuilder() { + if (dataCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + + public static final int REDEEM_FIELD_NUMBER = 3; + /** + *
+     * A redeem action
+     * 
+ * + * optional .token.Transfer redeem = 3; + */ + public org.hyperledger.fabric.protos.token.Transaction.Transfer getRedeem() { + if (dataCase_ == 3) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + /** + *
+     * A redeem action
+     * 
+ * + * optional .token.Transfer redeem = 3; + */ + public org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder getRedeemOrBuilder() { + if (dataCase_ == 3) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dataCase_ == 1) { + output.writeMessage(1, (org.hyperledger.fabric.protos.token.Transaction.Issue) data_); + } + if (dataCase_ == 2) { + output.writeMessage(2, (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_); + } + if (dataCase_ == 3) { + output.writeMessage(3, (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.hyperledger.fabric.protos.token.Transaction.Issue) data_); + } + if (dataCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_); + } + if (dataCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.TokenAction)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.TokenAction other = (org.hyperledger.fabric.protos.token.Transaction.TokenAction) obj; + + boolean result = true; + result = result && getDataCase().equals( + other.getDataCase()); + if (!result) return false; + switch (dataCase_) { + case 1: + result = result && getIssue() + .equals(other.getIssue()); + break; + case 2: + result = result && getTransfer() + .equals(other.getTransfer()); + break; + case 3: + result = result && getRedeem() + .equals(other.getRedeem()); + break; + case 0: + default: + } + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + switch (dataCase_) { + case 1: + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + break; + case 2: + hash = (37 * hash) + TRANSFER_FIELD_NUMBER; + hash = (53 * hash) + getTransfer().hashCode(); + break; + case 3: + hash = (37 * hash) + REDEEM_FIELD_NUMBER; + hash = (53 * hash) + getRedeem().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.TokenAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TokenAction specifies the structure of the action that a token undertakes
+     * 
+ * + * Protobuf type {@code token.TokenAction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenAction) + org.hyperledger.fabric.protos.token.Transaction.TokenActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenAction_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenAction.class, org.hyperledger.fabric.protos.token.Transaction.TokenAction.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.TokenAction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + dataCase_ = 0; + data_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenAction_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenAction getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenAction build() { + org.hyperledger.fabric.protos.token.Transaction.TokenAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenAction buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.TokenAction result = new org.hyperledger.fabric.protos.token.Transaction.TokenAction(this); + if (dataCase_ == 1) { + if (issueBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = issueBuilder_.build(); + } + } + if (dataCase_ == 2) { + if (transferBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = transferBuilder_.build(); + } + } + if (dataCase_ == 3) { + if (redeemBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = redeemBuilder_.build(); + } + } + result.dataCase_ = dataCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.TokenAction) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.TokenAction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.TokenAction other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.TokenAction.getDefaultInstance()) return this; + switch (other.getDataCase()) { + case ISSUE: { + mergeIssue(other.getIssue()); + break; + } + case TRANSFER: { + mergeTransfer(other.getTransfer()); + break; + } + case REDEEM: { + mergeRedeem(other.getRedeem()); + break; + } + case DATA_NOT_SET: { + break; + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.TokenAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.TokenAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int dataCase_ = 0; + private java.lang.Object data_; + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Issue, org.hyperledger.fabric.protos.token.Transaction.Issue.Builder, org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder> issueBuilder_; + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Issue getIssue() { + if (issueBuilder_ == null) { + if (dataCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.Issue) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } else { + if (dataCase_ == 1) { + return issueBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public Builder setIssue(org.hyperledger.fabric.protos.token.Transaction.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + issueBuilder_.setMessage(value); + } + dataCase_ = 1; + return this; + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public Builder setIssue( + org.hyperledger.fabric.protos.token.Transaction.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 1; + return this; + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public Builder mergeIssue(org.hyperledger.fabric.protos.token.Transaction.Issue value) { + if (issueBuilder_ == null) { + if (dataCase_ == 1 && + data_ != org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance()) { + data_ = org.hyperledger.fabric.protos.token.Transaction.Issue.newBuilder((org.hyperledger.fabric.protos.token.Transaction.Issue) data_) + .mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 1) { + issueBuilder_.mergeFrom(value); + } + issueBuilder_.setMessage(value); + } + dataCase_ = 1; + return this; + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public Builder clearIssue() { + if (issueBuilder_ == null) { + if (dataCase_ == 1) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 1) { + dataCase_ = 0; + data_ = null; + } + issueBuilder_.clear(); + } + return this; + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Issue.Builder getIssueBuilder() { + return getIssueFieldBuilder().getBuilder(); + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder getIssueOrBuilder() { + if ((dataCase_ == 1) && (issueBuilder_ != null)) { + return issueBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 1) { + return (org.hyperledger.fabric.protos.token.Transaction.Issue) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } + } + /** + *
+       * An issue action
+       * 
+ * + * optional .token.Issue issue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Issue, org.hyperledger.fabric.protos.token.Transaction.Issue.Builder, org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + if (!(dataCase_ == 1)) { + data_ = org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } + issueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Issue, org.hyperledger.fabric.protos.token.Transaction.Issue.Builder, org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder>( + (org.hyperledger.fabric.protos.token.Transaction.Issue) data_, + getParentForChildren(), + isClean()); + data_ = null; + } + dataCase_ = 1; + onChanged();; + return issueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Transfer, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder, org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder> transferBuilder_; + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Transfer getTransfer() { + if (transferBuilder_ == null) { + if (dataCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } else { + if (dataCase_ == 2) { + return transferBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public Builder setTransfer(org.hyperledger.fabric.protos.token.Transaction.Transfer value) { + if (transferBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + transferBuilder_.setMessage(value); + } + dataCase_ = 2; + return this; + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public Builder setTransfer( + org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder builderForValue) { + if (transferBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + transferBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 2; + return this; + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public Builder mergeTransfer(org.hyperledger.fabric.protos.token.Transaction.Transfer value) { + if (transferBuilder_ == null) { + if (dataCase_ == 2 && + data_ != org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance()) { + data_ = org.hyperledger.fabric.protos.token.Transaction.Transfer.newBuilder((org.hyperledger.fabric.protos.token.Transaction.Transfer) data_) + .mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 2) { + transferBuilder_.mergeFrom(value); + } + transferBuilder_.setMessage(value); + } + dataCase_ = 2; + return this; + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public Builder clearTransfer() { + if (transferBuilder_ == null) { + if (dataCase_ == 2) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 2) { + dataCase_ = 0; + data_ = null; + } + transferBuilder_.clear(); + } + return this; + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder getTransferBuilder() { + return getTransferFieldBuilder().getBuilder(); + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder getTransferOrBuilder() { + if ((dataCase_ == 2) && (transferBuilder_ != null)) { + return transferBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 2) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + } + /** + *
+       * A transfer action
+       * 
+ * + * optional .token.Transfer transfer = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Transfer, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder, org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder> + getTransferFieldBuilder() { + if (transferBuilder_ == null) { + if (!(dataCase_ == 2)) { + data_ = org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + transferBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Transfer, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder, org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder>( + (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_, + getParentForChildren(), + isClean()); + data_ = null; + } + dataCase_ = 2; + onChanged();; + return transferBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Transfer, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder, org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder> redeemBuilder_; + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public org.hyperledger.fabric.protos.token.Transaction.Transfer getRedeem() { + if (redeemBuilder_ == null) { + if (dataCase_ == 3) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } else { + if (dataCase_ == 3) { + return redeemBuilder_.getMessage(); + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public Builder setRedeem(org.hyperledger.fabric.protos.token.Transaction.Transfer value) { + if (redeemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + redeemBuilder_.setMessage(value); + } + dataCase_ = 3; + return this; + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public Builder setRedeem( + org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder builderForValue) { + if (redeemBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + redeemBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 3; + return this; + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public Builder mergeRedeem(org.hyperledger.fabric.protos.token.Transaction.Transfer value) { + if (redeemBuilder_ == null) { + if (dataCase_ == 3 && + data_ != org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance()) { + data_ = org.hyperledger.fabric.protos.token.Transaction.Transfer.newBuilder((org.hyperledger.fabric.protos.token.Transaction.Transfer) data_) + .mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 3) { + redeemBuilder_.mergeFrom(value); + } + redeemBuilder_.setMessage(value); + } + dataCase_ = 3; + return this; + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public Builder clearRedeem() { + if (redeemBuilder_ == null) { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + } + redeemBuilder_.clear(); + } + return this; + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder getRedeemBuilder() { + return getRedeemFieldBuilder().getBuilder(); + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + public org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder getRedeemOrBuilder() { + if ((dataCase_ == 3) && (redeemBuilder_ != null)) { + return redeemBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 3) { + return (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_; + } + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + } + /** + *
+       * A redeem action
+       * 
+ * + * optional .token.Transfer redeem = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Transfer, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder, org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder> + getRedeemFieldBuilder() { + if (redeemBuilder_ == null) { + if (!(dataCase_ == 3)) { + data_ = org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + redeemBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Transfer, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder, org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder>( + (org.hyperledger.fabric.protos.token.Transaction.Transfer) data_, + getParentForChildren(), + isClean()); + data_ = null; + } + dataCase_ = 3; + onChanged();; + return redeemBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenAction) + } + + // @@protoc_insertion_point(class_scope:token.TokenAction) + private static final org.hyperledger.fabric.protos.token.Transaction.TokenAction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.TokenAction(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenAction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TokenOwnerOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenOwner) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Type is the type of the identity of the token owner
+     * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + int getTypeValue(); + /** + *
+     * Type is the type of the identity of the token owner
+     * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type getType(); + + /** + *
+     * Raw is the serialization of the identity
+     * 
+ * + * optional bytes raw = 2; + */ + com.google.protobuf.ByteString getRaw(); + } + /** + *
+   * TokenOwner holds the identity of a token owner
+   * 
+ * + * Protobuf type {@code token.TokenOwner} + */ + public static final class TokenOwner extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenOwner) + TokenOwnerOrBuilder { + // Use TokenOwner.newBuilder() to construct. + private TokenOwner(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenOwner() { + type_ = 0; + raw_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenOwner( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 18: { + + raw_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenOwner_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenOwner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.class, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder.class); + } + + /** + * Protobuf enum {@code token.TokenOwner.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * more types to come ....
+       * for example
+       * CHAINCODE_ID = 1;
+       * MSP_OWNER_IDENTIFIER = 2;
+       * 
+ * + * MSP_IDENTIFIER = 0; + */ + MSP_IDENTIFIER(0), + UNRECOGNIZED(-1), + ; + + /** + *
+       * more types to come ....
+       * for example
+       * CHAINCODE_ID = 1;
+       * MSP_OWNER_IDENTIFIER = 2;
+       * 
+ * + * MSP_IDENTIFIER = 0; + */ + public static final int MSP_IDENTIFIER_VALUE = 0; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + public static Type forNumber(int value) { + switch (value) { + case 0: return MSP_IDENTIFIER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:token.TokenOwner.Type) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+     * Type is the type of the identity of the token owner
+     * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+     * Type is the type of the identity of the token owner
+     * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type getType() { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type result = org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type.valueOf(type_); + return result == null ? org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type.UNRECOGNIZED : result; + } + + public static final int RAW_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString raw_; + /** + *
+     * Raw is the serialization of the identity
+     * 
+ * + * optional bytes raw = 2; + */ + public com.google.protobuf.ByteString getRaw() { + return raw_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type.MSP_IDENTIFIER.getNumber()) { + output.writeEnum(1, type_); + } + if (!raw_.isEmpty()) { + output.writeBytes(2, raw_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type.MSP_IDENTIFIER.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (!raw_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, raw_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.TokenOwner)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.TokenOwner other = (org.hyperledger.fabric.protos.token.Transaction.TokenOwner) obj; + + boolean result = true; + result = result && type_ == other.type_; + result = result && getRaw() + .equals(other.getRaw()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + RAW_FIELD_NUMBER; + hash = (53 * hash) + getRaw().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.TokenOwner prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TokenOwner holds the identity of a token owner
+     * 
+ * + * Protobuf type {@code token.TokenOwner} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenOwner) + org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenOwner_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenOwner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.class, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.TokenOwner.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = 0; + + raw_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenOwner_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner build() { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner result = new org.hyperledger.fabric.protos.token.Transaction.TokenOwner(this); + result.type_ = type_; + result.raw_ = raw_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.TokenOwner) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.TokenOwner)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.TokenOwner other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getRaw() != com.google.protobuf.ByteString.EMPTY) { + setRaw(other.getRaw()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.TokenOwner) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + *
+       * Type is the type of the identity of the token owner
+       * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+       * Type is the type of the identity of the token owner
+       * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + *
+       * Type is the type of the identity of the token owner
+       * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type getType() { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type result = org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type.valueOf(type_); + return result == null ? org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type.UNRECOGNIZED : result; + } + /** + *
+       * Type is the type of the identity of the token owner
+       * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public Builder setType(org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Type is the type of the identity of the token owner
+       * 
+ * + * optional .token.TokenOwner.Type type = 1; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString raw_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Raw is the serialization of the identity
+       * 
+ * + * optional bytes raw = 2; + */ + public com.google.protobuf.ByteString getRaw() { + return raw_; + } + /** + *
+       * Raw is the serialization of the identity
+       * 
+ * + * optional bytes raw = 2; + */ + public Builder setRaw(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + raw_ = value; + onChanged(); + return this; + } + /** + *
+       * Raw is the serialization of the identity
+       * 
+ * + * optional bytes raw = 2; + */ + public Builder clearRaw() { + + raw_ = getDefaultInstance().getRaw(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenOwner) + } + + // @@protoc_insertion_point(class_scope:token.TokenOwner) + private static final org.hyperledger.fabric.protos.token.Transaction.TokenOwner DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.TokenOwner(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenOwner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenOwner parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenOwner(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface IssueOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + java.util.List + getOutputsList(); + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index); + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + int getOutputsCount(); + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + java.util.List + getOutputsOrBuilderList(); + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index); + } + /** + *
+   * Issue specifies an issue of one or more tokens
+   * 
+ * + * Protobuf type {@code token.Issue} + */ + public static final class Issue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.Issue) + IssueOrBuilder { + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Issue() { + outputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Issue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + outputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + outputs_.add( + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.Token.parser(), extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Issue_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.Issue.class, org.hyperledger.fabric.protos.token.Transaction.Issue.Builder.class); + } + + public static final int OUTPUTS_FIELD_NUMBER = 1; + private java.util.List outputs_; + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + public java.util.List getOutputsList() { + return outputs_; + } + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + public int getOutputsCount() { + return outputs_.size(); + } + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index) { + return outputs_.get(index); + } + /** + *
+     * Outputs are the newly issued tokens
+     * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index) { + return outputs_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(1, outputs_.get(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, outputs_.get(i)); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.Issue)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.Issue other = (org.hyperledger.fabric.protos.token.Transaction.Issue) obj; + + boolean result = true; + result = result && getOutputsList() + .equals(other.getOutputsList()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Issue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.Issue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Issue specifies an issue of one or more tokens
+     * 
+ * + * Protobuf type {@code token.Issue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.Issue) + org.hyperledger.fabric.protos.token.Transaction.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Issue_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.Issue.class, org.hyperledger.fabric.protos.token.Transaction.Issue.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.Issue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOutputsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + outputsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Issue_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.Issue getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.Issue build() { + org.hyperledger.fabric.protos.token.Transaction.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.Issue buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.Issue result = new org.hyperledger.fabric.protos.token.Transaction.Issue(this); + int from_bitField0_ = bitField0_; + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.Issue) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.Issue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.Issue other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.Issue.getDefaultInstance()) return this; + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000001); + outputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOutputsFieldBuilder() : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.Issue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.Issue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder> outputsBuilder_; + + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder setOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder setOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder addOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder addOutputs( + org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder addOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder getOutputsBuilder( + int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder addOutputsBuilder() { + return getOutputsFieldBuilder().addBuilder( + org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()); + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder addOutputsBuilder( + int index) { + return getOutputsFieldBuilder().addBuilder( + index, org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()); + } + /** + *
+       * Outputs are the newly issued tokens
+       * 
+ * + * repeated .token.Token outputs = 1; + */ + public java.util.List + getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder>( + outputs_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.Issue) + } + + // @@protoc_insertion_point(class_scope:token.Issue) + private static final org.hyperledger.fabric.protos.token.Transaction.Issue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.Issue(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.Issue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Issue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Issue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.Issue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TransferOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.Transfer) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + java.util.List + getInputsList(); + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenId getInputs(int index); + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + int getInputsCount(); + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + java.util.List + getInputsOrBuilderList(); + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder getInputsOrBuilder( + int index); + + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + java.util.List + getOutputsList(); + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index); + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + int getOutputsCount(); + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + java.util.List + getOutputsOrBuilderList(); + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index); + } + /** + *
+   * Transfer specifies a transfer of one or more tokens
+   * 
+ * + * Protobuf type {@code token.Transfer} + */ + public static final class Transfer extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.Transfer) + TransferOrBuilder { + // Use Transfer.newBuilder() to construct. + private Transfer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Transfer() { + inputs_ = java.util.Collections.emptyList(); + outputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Transfer( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + inputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inputs_.add( + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.TokenId.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + outputs_.add( + input.readMessage(org.hyperledger.fabric.protos.token.Transaction.Token.parser(), extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + inputs_ = java.util.Collections.unmodifiableList(inputs_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Transfer_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Transfer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.Transfer.class, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder.class); + } + + public static final int INPUTS_FIELD_NUMBER = 1; + private java.util.List inputs_; + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public java.util.List getInputsList() { + return inputs_; + } + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public java.util.List + getInputsOrBuilderList() { + return inputs_; + } + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public int getInputsCount() { + return inputs_.size(); + } + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenId getInputs(int index) { + return inputs_.get(index); + } + /** + *
+     * Inputs specify the identifiers in the ledger of the tokens to be transferred
+     * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder getInputsOrBuilder( + int index) { + return inputs_.get(index); + } + + public static final int OUTPUTS_FIELD_NUMBER = 2; + private java.util.List outputs_; + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + public java.util.List getOutputsList() { + return outputs_; + } + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + public int getOutputsCount() { + return outputs_.size(); + } + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index) { + return outputs_.get(index); + } + /** + *
+     * Outputs are the new tokens resulting from the transfer
+     * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index) { + return outputs_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < inputs_.size(); i++) { + output.writeMessage(1, inputs_.get(i)); + } + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(2, outputs_.get(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < inputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, inputs_.get(i)); + } + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, outputs_.get(i)); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.Transfer)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.Transfer other = (org.hyperledger.fabric.protos.token.Transaction.Transfer) obj; + + boolean result = true; + result = result && getInputsList() + .equals(other.getInputsList()); + result = result && getOutputsList() + .equals(other.getOutputsList()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getInputsCount() > 0) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getInputsList().hashCode(); + } + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Transfer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.Transfer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Transfer specifies a transfer of one or more tokens
+     * 
+ * + * Protobuf type {@code token.Transfer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.Transfer) + org.hyperledger.fabric.protos.token.Transaction.TransferOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Transfer_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Transfer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.Transfer.class, org.hyperledger.fabric.protos.token.Transaction.Transfer.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.Transfer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInputsFieldBuilder(); + getOutputsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + inputsBuilder_.clear(); + } + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + outputsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Transfer_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.Transfer getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.Transfer build() { + org.hyperledger.fabric.protos.token.Transaction.Transfer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.Transfer buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.Transfer result = new org.hyperledger.fabric.protos.token.Transaction.Transfer(this); + int from_bitField0_ = bitField0_; + if (inputsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + inputs_ = java.util.Collections.unmodifiableList(inputs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputs_ = inputs_; + } else { + result.inputs_ = inputsBuilder_.build(); + } + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.Transfer) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.Transfer)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.Transfer other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.Transfer.getDefaultInstance()) return this; + if (inputsBuilder_ == null) { + if (!other.inputs_.isEmpty()) { + if (inputs_.isEmpty()) { + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputsIsMutable(); + inputs_.addAll(other.inputs_); + } + onChanged(); + } + } else { + if (!other.inputs_.isEmpty()) { + if (inputsBuilder_.isEmpty()) { + inputsBuilder_.dispose(); + inputsBuilder_ = null; + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000001); + inputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getInputsFieldBuilder() : null; + } else { + inputsBuilder_.addAllMessages(other.inputs_); + } + } + } + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + outputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOutputsFieldBuilder() : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.Transfer parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.Transfer) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List inputs_ = + java.util.Collections.emptyList(); + private void ensureInputsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + inputs_ = new java.util.ArrayList(inputs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenId, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder> inputsBuilder_; + + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public java.util.List getInputsList() { + if (inputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputs_); + } else { + return inputsBuilder_.getMessageList(); + } + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public int getInputsCount() { + if (inputsBuilder_ == null) { + return inputs_.size(); + } else { + return inputsBuilder_.getCount(); + } + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenId getInputs(int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); + } else { + return inputsBuilder_.getMessage(index); + } + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder setInputs( + int index, org.hyperledger.fabric.protos.token.Transaction.TokenId value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.set(index, value); + onChanged(); + } else { + inputsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder setInputs( + int index, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.set(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.TokenId value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(value); + onChanged(); + } else { + inputsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder addInputs( + int index, org.hyperledger.fabric.protos.token.Transaction.TokenId value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(index, value); + onChanged(); + } else { + inputsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder addInputs( + org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder addInputs( + int index, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder addAllInputs( + java.lang.Iterable values) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputs_); + onChanged(); + } else { + inputsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder clearInputs() { + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + inputsBuilder_.clear(); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public Builder removeInputs(int index) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.remove(index); + onChanged(); + } else { + inputsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder getInputsBuilder( + int index) { + return getInputsFieldBuilder().getBuilder(index); + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder getInputsOrBuilder( + int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); } else { + return inputsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public java.util.List + getInputsOrBuilderList() { + if (inputsBuilder_ != null) { + return inputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputs_); + } + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder addInputsBuilder() { + return getInputsFieldBuilder().addBuilder( + org.hyperledger.fabric.protos.token.Transaction.TokenId.getDefaultInstance()); + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder addInputsBuilder( + int index) { + return getInputsFieldBuilder().addBuilder( + index, org.hyperledger.fabric.protos.token.Transaction.TokenId.getDefaultInstance()); + } + /** + *
+       * Inputs specify the identifiers in the ledger of the tokens to be transferred
+       * 
+ * + * repeated .token.TokenId inputs = 1; + */ + public java.util.List + getInputsBuilderList() { + return getInputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenId, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder> + getInputsFieldBuilder() { + if (inputsBuilder_ == null) { + inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenId, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder>( + inputs_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + inputs_ = null; + } + return inputsBuilder_; + } + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder> outputsBuilder_; + + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder setOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder setOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder addOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder addOutputs( + org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder addOutputs( + int index, org.hyperledger.fabric.protos.token.Transaction.Token.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder getOutputsBuilder( + int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder getOutputsOrBuilder( + int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder addOutputsBuilder() { + return getOutputsFieldBuilder().addBuilder( + org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()); + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public org.hyperledger.fabric.protos.token.Transaction.Token.Builder addOutputsBuilder( + int index) { + return getOutputsFieldBuilder().addBuilder( + index, org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()); + } + /** + *
+       * Outputs are the new tokens resulting from the transfer
+       * 
+ * + * repeated .token.Token outputs = 2; + */ + public java.util.List + getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.Token, org.hyperledger.fabric.protos.token.Transaction.Token.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder>( + outputs_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.Transfer) + } + + // @@protoc_insertion_point(class_scope:token.Transfer) + private static final org.hyperledger.fabric.protos.token.Transaction.Transfer DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.Transfer(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.Transfer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Transfer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Transfer(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.Transfer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TokenOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.Token) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Owner is the token owner
+     * 
+ * + * optional .token.TokenOwner owner = 1; + */ + boolean hasOwner(); + /** + *
+     * Owner is the token owner
+     * 
+ * + * optional .token.TokenOwner owner = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOwner getOwner(); + /** + *
+     * Owner is the token owner
+     * 
+ * + * optional .token.TokenOwner owner = 1; + */ + org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder getOwnerOrBuilder(); + + /** + *
+     * Type is the type of the token
+     * 
+ * + * optional string type = 2; + */ + java.lang.String getType(); + /** + *
+     * Type is the type of the token
+     * 
+ * + * optional string type = 2; + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
+     * Quantity is the number of units of Type carried in the token.
+     * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+     * 
+ * + * optional string quantity = 3; + */ + java.lang.String getQuantity(); + /** + *
+     * Quantity is the number of units of Type carried in the token.
+     * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+     * 
+ * + * optional string quantity = 3; + */ + com.google.protobuf.ByteString + getQuantityBytes(); + } + /** + *
+   * Token is the result of issue and transfer transactions
+   * 
+ * + * Protobuf type {@code token.Token} + */ + public static final class Token extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.Token) + TokenOrBuilder { + // Use Token.newBuilder() to construct. + private Token(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Token() { + type_ = ""; + quantity_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Token( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder subBuilder = null; + if (owner_ != null) { + subBuilder = owner_.toBuilder(); + } + owner_ = input.readMessage(org.hyperledger.fabric.protos.token.Transaction.TokenOwner.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(owner_); + owner_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + quantity_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Token_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Token_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.Token.class, org.hyperledger.fabric.protos.token.Transaction.Token.Builder.class); + } + + public static final int OWNER_FIELD_NUMBER = 1; + private org.hyperledger.fabric.protos.token.Transaction.TokenOwner owner_; + /** + *
+     * Owner is the token owner
+     * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public boolean hasOwner() { + return owner_ != null; + } + /** + *
+     * Owner is the token owner
+     * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner getOwner() { + return owner_ == null ? org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance() : owner_; + } + /** + *
+     * Owner is the token owner
+     * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder getOwnerOrBuilder() { + return getOwner(); + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + *
+     * Type is the type of the token
+     * 
+ * + * optional string type = 2; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + *
+     * Type is the type of the token
+     * 
+ * + * optional string type = 2; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUANTITY_FIELD_NUMBER = 3; + private volatile java.lang.Object quantity_; + /** + *
+     * Quantity is the number of units of Type carried in the token.
+     * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+     * 
+ * + * optional string quantity = 3; + */ + public java.lang.String getQuantity() { + java.lang.Object ref = quantity_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quantity_ = s; + return s; + } + } + /** + *
+     * Quantity is the number of units of Type carried in the token.
+     * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+     * 
+ * + * optional string quantity = 3; + */ + public com.google.protobuf.ByteString + getQuantityBytes() { + java.lang.Object ref = quantity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + quantity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (owner_ != null) { + output.writeMessage(1, getOwner()); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!getQuantityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, quantity_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (owner_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getOwner()); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!getQuantityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, quantity_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.Token)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.Token other = (org.hyperledger.fabric.protos.token.Transaction.Token) obj; + + boolean result = true; + result = result && (hasOwner() == other.hasOwner()); + if (hasOwner()) { + result = result && getOwner() + .equals(other.getOwner()); + } + result = result && getType() + .equals(other.getType()); + result = result && getQuantity() + .equals(other.getQuantity()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasOwner()) { + hash = (37 * hash) + OWNER_FIELD_NUMBER; + hash = (53 * hash) + getOwner().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getQuantity().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.Token parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.Token prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Token is the result of issue and transfer transactions
+     * 
+ * + * Protobuf type {@code token.Token} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.Token) + org.hyperledger.fabric.protos.token.Transaction.TokenOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Token_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Token_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.Token.class, org.hyperledger.fabric.protos.token.Transaction.Token.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.Token.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (ownerBuilder_ == null) { + owner_ = null; + } else { + owner_ = null; + ownerBuilder_ = null; + } + type_ = ""; + + quantity_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_Token_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.Token getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.Token build() { + org.hyperledger.fabric.protos.token.Transaction.Token result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.Token buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.Token result = new org.hyperledger.fabric.protos.token.Transaction.Token(this); + if (ownerBuilder_ == null) { + result.owner_ = owner_; + } else { + result.owner_ = ownerBuilder_.build(); + } + result.type_ = type_; + result.quantity_ = quantity_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.Token) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.Token)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.Token other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.Token.getDefaultInstance()) return this; + if (other.hasOwner()) { + mergeOwner(other.getOwner()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getQuantity().isEmpty()) { + quantity_ = other.quantity_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.Token parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.Token) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private org.hyperledger.fabric.protos.token.Transaction.TokenOwner owner_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenOwner, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder> ownerBuilder_; + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public boolean hasOwner() { + return ownerBuilder_ != null || owner_ != null; + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner getOwner() { + if (ownerBuilder_ == null) { + return owner_ == null ? org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance() : owner_; + } else { + return ownerBuilder_.getMessage(); + } + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public Builder setOwner(org.hyperledger.fabric.protos.token.Transaction.TokenOwner value) { + if (ownerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + owner_ = value; + onChanged(); + } else { + ownerBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public Builder setOwner( + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder builderForValue) { + if (ownerBuilder_ == null) { + owner_ = builderForValue.build(); + onChanged(); + } else { + ownerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public Builder mergeOwner(org.hyperledger.fabric.protos.token.Transaction.TokenOwner value) { + if (ownerBuilder_ == null) { + if (owner_ != null) { + owner_ = + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.newBuilder(owner_).mergeFrom(value).buildPartial(); + } else { + owner_ = value; + } + onChanged(); + } else { + ownerBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public Builder clearOwner() { + if (ownerBuilder_ == null) { + owner_ = null; + onChanged(); + } else { + owner_ = null; + ownerBuilder_ = null; + } + + return this; + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder getOwnerBuilder() { + + onChanged(); + return getOwnerFieldBuilder().getBuilder(); + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + public org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder getOwnerOrBuilder() { + if (ownerBuilder_ != null) { + return ownerBuilder_.getMessageOrBuilder(); + } else { + return owner_ == null ? + org.hyperledger.fabric.protos.token.Transaction.TokenOwner.getDefaultInstance() : owner_; + } + } + /** + *
+       * Owner is the token owner
+       * 
+ * + * optional .token.TokenOwner owner = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenOwner, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder> + getOwnerFieldBuilder() { + if (ownerBuilder_ == null) { + ownerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.hyperledger.fabric.protos.token.Transaction.TokenOwner, org.hyperledger.fabric.protos.token.Transaction.TokenOwner.Builder, org.hyperledger.fabric.protos.token.Transaction.TokenOwnerOrBuilder>( + getOwner(), + getParentForChildren(), + isClean()); + owner_ = null; + } + return ownerBuilder_; + } + + private java.lang.Object type_ = ""; + /** + *
+       * Type is the type of the token
+       * 
+ * + * optional string type = 2; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Type is the type of the token
+       * 
+ * + * optional string type = 2; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Type is the type of the token
+       * 
+ * + * optional string type = 2; + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + *
+       * Type is the type of the token
+       * 
+ * + * optional string type = 2; + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + *
+       * Type is the type of the token
+       * 
+ * + * optional string type = 2; + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object quantity_ = ""; + /** + *
+       * Quantity is the number of units of Type carried in the token.
+       * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+       * 
+ * + * optional string quantity = 3; + */ + public java.lang.String getQuantity() { + java.lang.Object ref = quantity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quantity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Quantity is the number of units of Type carried in the token.
+       * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+       * 
+ * + * optional string quantity = 3; + */ + public com.google.protobuf.ByteString + getQuantityBytes() { + java.lang.Object ref = quantity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + quantity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Quantity is the number of units of Type carried in the token.
+       * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+       * 
+ * + * optional string quantity = 3; + */ + public Builder setQuantity( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + quantity_ = value; + onChanged(); + return this; + } + /** + *
+       * Quantity is the number of units of Type carried in the token.
+       * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+       * 
+ * + * optional string quantity = 3; + */ + public Builder clearQuantity() { + + quantity_ = getDefaultInstance().getQuantity(); + onChanged(); + return this; + } + /** + *
+       * Quantity is the number of units of Type carried in the token.
+       * It is encoded as a string containing a number in base 16. The string has prefix ``0x''.
+       * 
+ * + * optional string quantity = 3; + */ + public Builder setQuantityBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + quantity_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.Token) + } + + // @@protoc_insertion_point(class_scope:token.Token) + private static final org.hyperledger.fabric.protos.token.Transaction.Token DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.Token(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.Token getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Token parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Token(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.Token getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TokenIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:token.TokenId) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * TxId is the transaction ID of the transaction that created the token
+     * 
+ * + * optional string tx_id = 1; + */ + java.lang.String getTxId(); + /** + *
+     * TxId is the transaction ID of the transaction that created the token
+     * 
+ * + * optional string tx_id = 1; + */ + com.google.protobuf.ByteString + getTxIdBytes(); + + /** + *
+     * Index is the index of the token in the transaction that created it
+     * 
+ * + * optional uint32 index = 2; + */ + int getIndex(); + } + /** + *
+   * A TokenId identifies a token as a function of the identifier of the transaction (issue, transfer)
+   * that created it and its index in that transaction
+   * 
+ * + * Protobuf type {@code token.TokenId} + */ + public static final class TokenId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:token.TokenId) + TokenIdOrBuilder { + // Use TokenId.newBuilder() to construct. + private TokenId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TokenId() { + txId_ = ""; + index_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private TokenId( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + txId_ = s; + break; + } + case 16: { + + index_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenId_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenId.class, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder.class); + } + + public static final int TX_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object txId_; + /** + *
+     * TxId is the transaction ID of the transaction that created the token
+     * 
+ * + * optional string tx_id = 1; + */ + public java.lang.String getTxId() { + java.lang.Object ref = txId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + txId_ = s; + return s; + } + } + /** + *
+     * TxId is the transaction ID of the transaction that created the token
+     * 
+ * + * optional string tx_id = 1; + */ + public com.google.protobuf.ByteString + getTxIdBytes() { + java.lang.Object ref = txId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + txId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FIELD_NUMBER = 2; + private int index_; + /** + *
+     * Index is the index of the token in the transaction that created it
+     * 
+ * + * optional uint32 index = 2; + */ + public int getIndex() { + return index_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTxIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, txId_); + } + if (index_ != 0) { + output.writeUInt32(2, index_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTxIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, txId_); + } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, index_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.hyperledger.fabric.protos.token.Transaction.TokenId)) { + return super.equals(obj); + } + org.hyperledger.fabric.protos.token.Transaction.TokenId other = (org.hyperledger.fabric.protos.token.Transaction.TokenId) obj; + + boolean result = true; + result = result && getTxId() + .equals(other.getTxId()); + result = result && (getIndex() + == other.getIndex()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (37 * hash) + TX_ID_FIELD_NUMBER; + hash = (53 * hash) + getTxId().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.hyperledger.fabric.protos.token.Transaction.TokenId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.hyperledger.fabric.protos.token.Transaction.TokenId prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A TokenId identifies a token as a function of the identifier of the transaction (issue, transfer)
+     * that created it and its index in that transaction
+     * 
+ * + * Protobuf type {@code token.TokenId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:token.TokenId) + org.hyperledger.fabric.protos.token.Transaction.TokenIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenId_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.hyperledger.fabric.protos.token.Transaction.TokenId.class, org.hyperledger.fabric.protos.token.Transaction.TokenId.Builder.class); + } + + // Construct using org.hyperledger.fabric.protos.token.Transaction.TokenId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + txId_ = ""; + + index_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.hyperledger.fabric.protos.token.Transaction.internal_static_token_TokenId_descriptor; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenId getDefaultInstanceForType() { + return org.hyperledger.fabric.protos.token.Transaction.TokenId.getDefaultInstance(); + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenId build() { + org.hyperledger.fabric.protos.token.Transaction.TokenId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenId buildPartial() { + org.hyperledger.fabric.protos.token.Transaction.TokenId result = new org.hyperledger.fabric.protos.token.Transaction.TokenId(this); + result.txId_ = txId_; + result.index_ = index_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.hyperledger.fabric.protos.token.Transaction.TokenId) { + return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.TokenId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.TokenId other) { + if (other == org.hyperledger.fabric.protos.token.Transaction.TokenId.getDefaultInstance()) return this; + if (!other.getTxId().isEmpty()) { + txId_ = other.txId_; + onChanged(); + } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.hyperledger.fabric.protos.token.Transaction.TokenId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.TokenId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object txId_ = ""; + /** + *
+       * TxId is the transaction ID of the transaction that created the token
+       * 
+ * + * optional string tx_id = 1; + */ + public java.lang.String getTxId() { + java.lang.Object ref = txId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + txId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * TxId is the transaction ID of the transaction that created the token
+       * 
+ * + * optional string tx_id = 1; + */ + public com.google.protobuf.ByteString + getTxIdBytes() { + java.lang.Object ref = txId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + txId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * TxId is the transaction ID of the transaction that created the token
+       * 
+ * + * optional string tx_id = 1; + */ + public Builder setTxId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + txId_ = value; + onChanged(); + return this; + } + /** + *
+       * TxId is the transaction ID of the transaction that created the token
+       * 
+ * + * optional string tx_id = 1; + */ + public Builder clearTxId() { + + txId_ = getDefaultInstance().getTxId(); + onChanged(); + return this; + } + /** + *
+       * TxId is the transaction ID of the transaction that created the token
+       * 
+ * + * optional string tx_id = 1; + */ + public Builder setTxIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + txId_ = value; + onChanged(); + return this; + } + + private int index_ ; + /** + *
+       * Index is the index of the token in the transaction that created it
+       * 
+ * + * optional uint32 index = 2; + */ + public int getIndex() { + return index_; + } + /** + *
+       * Index is the index of the token in the transaction that created it
+       * 
+ * + * optional uint32 index = 2; + */ + public Builder setIndex(int value) { + + index_ = value; + onChanged(); + return this; + } + /** + *
+       * Index is the index of the token in the transaction that created it
+       * 
+ * + * optional uint32 index = 2; + */ + public Builder clearIndex() { + + index_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:token.TokenId) + } + + // @@protoc_insertion_point(class_scope:token.TokenId) + private static final org.hyperledger.fabric.protos.token.Transaction.TokenId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.TokenId(); + } + + public static org.hyperledger.fabric.protos.token.Transaction.TokenId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TokenId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenId(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.hyperledger.fabric.protos.token.Transaction.TokenId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenTransaction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenTransaction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenAction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenAction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenOwner_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenOwner_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_Issue_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_Issue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_Transfer_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_Transfer_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_Token_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_Token_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_token_TokenId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_token_TokenId_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\027token/transaction.proto\022\005token\"H\n\020Toke" + + "nTransaction\022*\n\014token_action\030\001 \001(\0132\022.tok" + + "en.TokenActionH\000B\010\n\006action\"|\n\013TokenActio" + + "n\022\035\n\005issue\030\001 \001(\0132\014.token.IssueH\000\022#\n\010tran" + + "sfer\030\002 \001(\0132\017.token.TransferH\000\022!\n\006redeem\030" + + "\003 \001(\0132\017.token.TransferH\000B\006\n\004data\"[\n\nToke" + + "nOwner\022$\n\004type\030\001 \001(\0162\026.token.TokenOwner." + + "Type\022\013\n\003raw\030\002 \001(\014\"\032\n\004Type\022\022\n\016MSP_IDENTIF" + + "IER\020\000\"&\n\005Issue\022\035\n\007outputs\030\001 \003(\0132\014.token." + + "Token\"I\n\010Transfer\022\036\n\006inputs\030\001 \003(\0132\016.toke", + "n.TokenId\022\035\n\007outputs\030\002 \003(\0132\014.token.Token" + + "\"I\n\005Token\022 \n\005owner\030\001 \001(\0132\021.token.TokenOw" + + "ner\022\014\n\004type\030\002 \001(\t\022\020\n\010quantity\030\003 \001(\t\"\'\n\007T" + + "okenId\022\r\n\005tx_id\030\001 \001(\t\022\r\n\005index\030\002 \001(\rBQ\n#" + + "org.hyperledger.fabric.protos.tokenZ*git" + + "hub.com/hyperledger/fabric/protos/tokenb" + + "\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_token_TokenTransaction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_token_TokenTransaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenTransaction_descriptor, + new java.lang.String[] { "TokenAction", "Action", }); + internal_static_token_TokenAction_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_token_TokenAction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenAction_descriptor, + new java.lang.String[] { "Issue", "Transfer", "Redeem", "Data", }); + internal_static_token_TokenOwner_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_token_TokenOwner_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenOwner_descriptor, + new java.lang.String[] { "Type", "Raw", }); + internal_static_token_Issue_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_token_Issue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_Issue_descriptor, + new java.lang.String[] { "Outputs", }); + internal_static_token_Transfer_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_token_Transfer_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_Transfer_descriptor, + new java.lang.String[] { "Inputs", "Outputs", }); + internal_static_token_Token_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_token_Token_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_Token_descriptor, + new java.lang.String[] { "Owner", "Type", "Quantity", }); + internal_static_token_TokenId_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_token_TokenId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_token_TokenId_descriptor, + new java.lang.String[] { "TxId", "Index", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/fabric-chaincode-protos/src/main/protos/common/common.proto b/fabric-chaincode-protos/src/main/protos/common/common.proto index e93d5117..5e7896f3 100644 --- a/fabric-chaincode-protos/src/main/protos/common/common.proto +++ b/fabric-chaincode-protos/src/main/protos/common/common.proto @@ -42,24 +42,26 @@ enum HeaderType { // reserved 7; // reserved "PEER_RESOURCE_UPDATE"; - MESSAGE = 0; // Used for messages which are signed but opaque - CONFIG = 1; // Used for messages which express the channel config - CONFIG_UPDATE = 2; // Used for transactions which update the channel config - ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions - ORDERER_TRANSACTION = 4; // Used internally by the orderer for management - DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek - CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install - PEER_ADMIN_OPERATION = 8; // Used for invoking an administrative operation on a peer - TOKEN_TRANSACTION = 9; // Used to denote transactions that invoke token management operations + MESSAGE = 0; // Used for messages which are signed but opaque + CONFIG = 1; // Used for messages which express the channel config + CONFIG_UPDATE = 2; // Used for transactions which update the channel config + ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions + ORDERER_TRANSACTION = 4; // Used internally by the orderer for management + DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek + CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install + PEER_ADMIN_OPERATION = 8; // Used for invoking an administrative operation on a peer + TOKEN_TRANSACTION = 9; // Used to denote transactions that invoke token management operations } // This enum enlists indexes of the block metadata array enum BlockMetadataIndex { - SIGNATURES = 0; // Block metadata array position for block signatures - LAST_CONFIG = 1; // Block metadata array position to store last configuration block sequence number - TRANSACTIONS_FILTER = 2; // Block metadata array position to store serialized bit array filter of invalid transactions - ORDERER = 3; // Block metadata array position to store operational metadata for orderers - // e.g. For Kafka, this is where we store the last offset written to the local ledger. + SIGNATURES = 0; // Block metadata array position for block signatures + LAST_CONFIG = 1; // Block metadata array position to store last configuration block sequence number + TRANSACTIONS_FILTER = 2; // Block metadata array position to store serialized bit array filter of invalid transactions + ORDERER = 3 [deprecated=true]; /* Block metadata array position to store operational metadata for orderers + e.g. For Kafka, this is where we store the last offset written to the local ledger */ + COMMIT_HASH = 4; /* Block metadata array position to store the hash of TRANSACTIONS_FILTER, State Updates, + and the COMMIT_HASH of the previous block */ } // LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index @@ -175,3 +177,9 @@ message BlockData { message BlockMetadata { repeated bytes metadata = 1; } + +// OrdererBlockMetadata defines metadata that is set by the ordering service. +message OrdererBlockMetadata { + LastConfig last_config = 1; + bytes consenter_metadata = 2; +} diff --git a/fabric-chaincode-protos/src/main/protos/msp/msp_principal.proto b/fabric-chaincode-protos/src/main/protos/msp/msp_principal.proto index 972f0fe4..c9300ff3 100644 --- a/fabric-chaincode-protos/src/main/protos/msp/msp_principal.proto +++ b/fabric-chaincode-protos/src/main/protos/msp/msp_principal.proto @@ -116,6 +116,7 @@ message MSPRole { ADMIN = 1; // Represents an MSP Admin CLIENT = 2; // Represents an MSP Client PEER = 3; // Represents an MSP Peer + ORDERER = 4; // Represents an MSP Orderer } // MSPRoleType defines which of the available, pre-defined MSP-roles diff --git a/fabric-chaincode-protos/src/main/protos/peer/chaincode.proto b/fabric-chaincode-protos/src/main/protos/peer/chaincode.proto index ae4d9fba..d8ab0d6c 100644 --- a/fabric-chaincode-protos/src/main/protos/peer/chaincode.proto +++ b/fabric-chaincode-protos/src/main/protos/peer/chaincode.proto @@ -21,13 +21,6 @@ option java_package = "org.hyperledger.fabric.protos.peer"; option go_package = "github.com/hyperledger/fabric/protos/peer"; -// Confidentiality Levels -enum ConfidentialityLevel { - PUBLIC = 0; - CONFIDENTIAL = 1; -} - - //ChaincodeID contains the path as specified by the deploy transaction //that created it as well as the hashCode that is generated by the //system for the path. From the user level (ie, CLI, REST API and so on) @@ -53,6 +46,12 @@ message ChaincodeID { message ChaincodeInput { repeated bytes args = 1; map decorations = 2; + + // is_init is used for the application to signal that an invocation is to be routed + // to the legacy 'Init' function for compatibility with chaincodes which handled + // Init in the old way. New applications should manage their initialized state + // themselves. + bool is_init = 3; } // Carries the chaincode specification. This is the actual metadata required for @@ -77,17 +76,11 @@ message ChaincodeSpec { // TODO: Define `codePackage`. message ChaincodeDeploymentSpec { // Prevent removed tag re-use - reserved 2; - reserved "effective_date"; - - enum ExecutionEnvironment { - DOCKER = 0; - SYSTEM = 1; - } + reserved 2, 4; + reserved "effective_date", "exec_env"; ChaincodeSpec chaincode_spec = 1; bytes code_package = 3; - ExecutionEnvironment exec_env= 4; } diff --git a/fabric-chaincode-protos/src/main/protos/peer/chaincode_shim.proto b/fabric-chaincode-protos/src/main/protos/peer/chaincode_shim.proto index 85a0e0c1..f32ffffb 100644 --- a/fabric-chaincode-protos/src/main/protos/peer/chaincode_shim.proto +++ b/fabric-chaincode-protos/src/main/protos/peer/chaincode_shim.proto @@ -38,6 +38,7 @@ message ChaincodeMessage { GET_HISTORY_FOR_KEY = 19; GET_STATE_METADATA = 20; PUT_STATE_METADATA = 21; + GET_PRIVATE_DATA_HASH = 22; } Type type = 1; @@ -177,7 +178,7 @@ message StateMetadataResult { // provides the context necessary for the server to respond appropriately. service ChaincodeSupport { - rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage) {} + rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage); } diff --git a/fabric-chaincode-protos/src/main/protos/peer/proposal.proto b/fabric-chaincode-protos/src/main/protos/peer/proposal.proto index 73f1d8e2..c09bf65c 100644 --- a/fabric-chaincode-protos/src/main/protos/peer/proposal.proto +++ b/fabric-chaincode-protos/src/main/protos/peer/proposal.proto @@ -24,6 +24,7 @@ package protos; import "peer/chaincode.proto"; import "peer/proposal_response.proto"; +import "token/operations.proto"; /* The flow to get a generic transaction approved goes as follows: @@ -271,4 +272,8 @@ message ChaincodeAction { // Adding ChaincodeID to keep version opens up the possibility of multiple // ChaincodeAction per transaction. ChaincodeID chaincode_id = 4; -} + + // This field contains the token operations requests generated by the chaincode + // executing this invocation + repeated token.TokenOperation token_operations = 5; +} \ No newline at end of file diff --git a/fabric-chaincode-protos/src/main/protos/peer/transaction.proto b/fabric-chaincode-protos/src/main/protos/peer/transaction.proto index 4523706e..1561a99c 100644 --- a/fabric-chaincode-protos/src/main/protos/peer/transaction.proto +++ b/fabric-chaincode-protos/src/main/protos/peer/transaction.proto @@ -12,7 +12,6 @@ option java_outer_classname = "TransactionPackage"; package protos; -import "google/protobuf/timestamp.proto"; import "peer/proposal_response.proto"; import "common/common.proto"; @@ -138,6 +137,7 @@ enum TxValidationCode { BAD_RWSET = 22; ILLEGAL_WRITESET = 23; INVALID_WRITESET = 24; + INVALID_CHAINCODE = 25; NOT_VALIDATED = 254; INVALID_OTHER_REASON = 255; } @@ -145,4 +145,5 @@ enum TxValidationCode { // Reserved entries in the key-level metadata map enum MetaDataKeys { VALIDATION_PARAMETER = 0; + VALIDATION_PARAMETER_V2 = 1; } diff --git a/fabric-chaincode-protos/src/main/protos/token/operations.proto b/fabric-chaincode-protos/src/main/protos/token/operations.proto new file mode 100644 index 00000000..a24c8238 --- /dev/null +++ b/fabric-chaincode-protos/src/main/protos/token/operations.proto @@ -0,0 +1,41 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/token"; +option java_package = "org.hyperledger.fabric.protos.token"; + +package token; + +import "token/transaction.proto"; + +// TokenOperation describes a token operation +message TokenOperation { + oneof Operation { + // Action describes a class of token operation + TokenOperationAction Action = 1; + } +} + +// TokenOperationAction lists the available operations +message TokenOperationAction { + oneof Payload { + // Issue describes a token issue operation + TokenActionTerms Issue = 1; + // Transfer describes a token transfer operation + TokenActionTerms Transfer = 2; + } +} + +// TokenActionTerms describes the expected sender and outputs of a token operation +message TokenActionTerms { + // Sender is the party who should perform the operation + TokenOwner Sender = 1; + // Outputs contains the expected outputs + repeated Token Outputs = 2; +} + diff --git a/fabric-chaincode-protos/src/main/protos/token/transaction.proto b/fabric-chaincode-protos/src/main/protos/token/transaction.proto new file mode 100644 index 00000000..423b7bb2 --- /dev/null +++ b/fabric-chaincode-protos/src/main/protos/token/transaction.proto @@ -0,0 +1,138 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/token"; +option java_package = "org.hyperledger.fabric.protos.token"; + +package token; + +// ================ Existing Fabric Transaction structure =============== +// +//In Summary, Fabric supports the following transaction structure: +// +// Envelope +// |\_ Signature (signature on the common.Payload message +// | including the transaction by the creator +// | specified in the Payload.header) +// \_ Payload +// |\_ Header (1) (the header of the proposal that requested this +// | action; containing channel header, and +// | signature header) +// \_ Data (1) (serialised Transaction message) +// \_ Transaction +// \_ TransactionAction (1...n) +// |\_ Header (1) (the header of the proposal that +// | requested this action) +// \_ ChaincodeActionPayload (1) +// +// +// +// +// =============== Changes to Existing Fabric Transaction structure =============== +// For envelopes that carry FabToken transaction we still maintain the same structure +// such that the orderers functionality is not disturbed: +// +// Envelope +// |\_ Signature (signature on the Payload message including +// | the transaction by the creator + +// | specified in the Payload.header) +// \_ Payload +// |\_ Header (1) (the header of the proposal that requested +// | this action; containing +// | channel header, and signature header) +// \_ Data (1) (serialised Transaction message) +// \_ TokenTransaction (1) +// \_ action (1) (a oneof for the different types of transactions) + + + +// TokenTransaction governs the structure of Payload.data, when +// the transaction's envelope header indicates a transaction of type +// "Token" +message TokenTransaction { + // TokenAction carries the content of this transaction. + oneof action { + TokenAction token_action = 1; + } +} + +// TokenAction specifies the structure of the action that a token undertakes +message TokenAction { + // Data carries the action to be executed + oneof data { + + // An issue action + Issue issue = 1; + + // A transfer action + Transfer transfer = 2; + + // A redeem action + Transfer redeem = 3; + } +} + +// TokenOwner holds the identity of a token owner +message TokenOwner { + enum Type { + MSP_IDENTIFIER = 0; + // more types to come .... + // for example + // CHAINCODE_ID = 1; + // MSP_OWNER_IDENTIFIER = 2; + } + + // Type is the type of the identity of the token owner + Type type = 1; + + // Raw is the serialization of the identity + bytes raw = 2; +} + +// Issue specifies an issue of one or more tokens +message Issue { + + // Outputs are the newly issued tokens + repeated Token outputs = 1; +} + +// Transfer specifies a transfer of one or more tokens +message Transfer { + + // Inputs specify the identifiers in the ledger of the tokens to be transferred + repeated TokenId inputs = 1; + + // Outputs are the new tokens resulting from the transfer + repeated Token outputs = 2; +} + +// Token is the result of issue and transfer transactions +message Token { + + // Owner is the token owner + TokenOwner owner = 1; + + // Type is the type of the token + string type = 2; + + // Quantity is the number of units of Type carried in the token. + // It is encoded as a string containing a number in base 16. The string has prefix ``0x''. + string quantity = 3; +} + +// A TokenId identifies a token as a function of the identifier of the transaction (issue, transfer) +// that created it and its index in that transaction +message TokenId { + + // TxId is the transaction ID of the transaction that created the token + string tx_id = 1; + + // Index is the index of the token in the transaction that created it + uint32 index = 2; +} diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeStub.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeStub.java index ea90c1a0..7594cbcb 100644 --- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeStub.java +++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeStub.java @@ -6,18 +6,22 @@ package org.hyperledger.fabric.shim; -import org.hyperledger.fabric.protos.peer.ChaincodeEventPackage.ChaincodeEvent; -import org.hyperledger.fabric.protos.peer.ProposalPackage.SignedProposal; -import org.hyperledger.fabric.shim.Chaincode.Response; -import org.hyperledger.fabric.shim.ledger.*; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.stream.Collectors.toList; import java.time.Instant; import java.util.Arrays; import java.util.List; import java.util.Map; -import static java.nio.charset.StandardCharsets.UTF_8; -import static java.util.stream.Collectors.toList; +import org.hyperledger.fabric.protos.peer.ChaincodeEventPackage.ChaincodeEvent; +import org.hyperledger.fabric.protos.peer.ProposalPackage.SignedProposal; +import org.hyperledger.fabric.shim.Chaincode.Response; +import org.hyperledger.fabric.shim.ledger.CompositeKey; +import org.hyperledger.fabric.shim.ledger.KeyModification; +import org.hyperledger.fabric.shim.ledger.KeyValue; +import org.hyperledger.fabric.shim.ledger.QueryResultsIterator; +import org.hyperledger.fabric.shim.ledger.QueryResultsIteratorWithMetadata; public interface ChaincodeStub { @@ -357,6 +361,14 @@ public interface ChaincodeStub { * @return value the value read from the collection */ byte[] getPrivateData(String collection, String key); + + /** + * @param collection name of the collection + * @param key name of the value + * @return + */ + byte[] getPrivateDataHash(String collection, String key); + /** * Retrieves the key-level endorsement * policy for the private data specified by key. Note that this introduces diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImpl.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImpl.java index cb536a03..1d4f59c5 100644 --- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImpl.java +++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImpl.java @@ -6,9 +6,19 @@ package org.hyperledger.fabric.shim.impl; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.Timestamp; +import static java.util.stream.Collectors.toList; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.time.Instant; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + import org.hyperledger.fabric.protos.common.Common; import org.hyperledger.fabric.protos.common.Common.ChannelHeader; import org.hyperledger.fabric.protos.common.Common.Header; @@ -25,20 +35,15 @@ import org.hyperledger.fabric.protos.peer.TransactionPackage; import org.hyperledger.fabric.shim.Chaincode.Response; import org.hyperledger.fabric.shim.ChaincodeStub; -import org.hyperledger.fabric.shim.ledger.*; +import org.hyperledger.fabric.shim.ledger.CompositeKey; +import org.hyperledger.fabric.shim.ledger.KeyModification; +import org.hyperledger.fabric.shim.ledger.KeyValue; +import org.hyperledger.fabric.shim.ledger.QueryResultsIterator; +import org.hyperledger.fabric.shim.ledger.QueryResultsIteratorWithMetadata; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.time.Instant; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static java.util.stream.Collectors.toList; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Timestamp; class ChaincodeStubImpl implements ChaincodeStub { @@ -349,6 +354,12 @@ public byte[] getPrivateData(String collection, String key) { return handler.getState(channelId, txId, collection, key).toByteArray(); } + @Override + public byte[] getPrivateDataHash(String collection, String key) { + validateCollection(collection); + return handler.getPrivateDataHash(channelId, txId, collection, key).toByteArray(); + } + @Override public byte[] getPrivateDataValidationParameter(String collection, String key) { validateCollection(collection); diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/Handler.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/Handler.java index ba61f706..9929d2d9 100644 --- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/Handler.java +++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/Handler.java @@ -10,6 +10,7 @@ import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.COMPLETED; import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.DEL_STATE; import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.ERROR; +import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.GET_PRIVATE_DATA_HASH; import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.GET_QUERY_RESULT; import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.GET_STATE; import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.GET_STATE_BY_RANGE; @@ -345,6 +346,10 @@ ByteString getState(String channelId, String txId, String collection, String key return invokeChaincodeSupport(newGetStateEventMessage(channelId, txId, collection, key)); } + ByteString getPrivateDataHash(String channelId, String txId, String collection, String key) { + return invokeChaincodeSupport(newGetPrivateDataHashEventMessage(channelId, txId, collection, key)); + } + Map getStateMetadata(String channelId, String txId, String collection, String key) { ByteString payload = invokeChaincodeSupport(newGetStateMetadataEventMessage(channelId, txId, collection, key)); try { @@ -513,6 +518,13 @@ private static Chaincode.Response newErrorChaincodeResponse(String message) { return new Chaincode.Response(Chaincode.Response.Status.INTERNAL_SERVER_ERROR, message, null); } + private static ChaincodeMessage newGetPrivateDataHashEventMessage(final String channelId, final String txId, final String collection, final String key) { + return newEventMessage(GET_PRIVATE_DATA_HASH, channelId, txId, GetState.newBuilder() + .setCollection(collection) + .setKey(key) + .build().toByteString()); + } + private static ChaincodeMessage newGetStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE, channelId, txId, GetState.newBuilder() .setCollection(collection) diff --git a/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/contract/ChaincodeStubNaiveImpl.java b/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/contract/ChaincodeStubNaiveImpl.java index 4b592ffd..56262405 100644 --- a/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/contract/ChaincodeStubNaiveImpl.java +++ b/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/contract/ChaincodeStubNaiveImpl.java @@ -184,6 +184,11 @@ public byte[] getPrivateData(String collection, String key) { return new byte[0]; } + @Override + public byte[] getPrivateDataHash(String collection, String key) { + return new byte[0]; + } + @Override public byte[] getPrivateDataValidationParameter(String collection, String key) { return new byte[0]; diff --git a/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImplTest.java b/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImplTest.java index 44dc70cd..dda43314 100644 --- a/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImplTest.java +++ b/fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/shim/impl/ChaincodeStubImplTest.java @@ -490,6 +490,24 @@ public void testGetPrivateData() { } } + @Test + public void testGetPrivateDataHash() { + final ChaincodeStubImpl stub = new ChaincodeStubImpl("myc", "txId", handler, Collections.emptyList(), null); + final byte[] value = new byte[]{0x10, 0x20, 0x30}; + when(handler.getPrivateDataHash("myc", "txId", "testcoll", "key")).thenReturn(ByteString.copyFrom(value)); + assertThat(stub.getPrivateDataHash("testcoll", "key"), is(value)); + try { + stub.getPrivateDataHash(null, "key"); + Assert.fail("Null collection check fails"); + } catch (NullPointerException e) { + } + try { + stub.getPrivateDataHash("", "key"); + Assert.fail("Empty collection check fails"); + } catch (IllegalArgumentException e) { + } + } + @Test public void testGetStringPrivateData() { final ChaincodeStubImpl stub = new ChaincodeStubImpl("myc", "txId", handler, Collections.emptyList(), null);