

- * Block metadata array position to store operational metadata for orderers
+ * 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),
+ /**
+ * + * 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),
;
@@ -489,12 +499,22 @@ public enum BlockMetadataIndex
public static final int TRANSACTIONS_FILTER_VALUE = 2;
/**
*
- * Block metadata array position to store operational metadata for orderers
+ * 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;
*/
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 +539,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 +8807,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
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.ParserPUT_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.StateMetadata2X" +
+ "\n\020ChaincodeSupport\022D\n\010Register\022\030.protos." +
+ "ChaincodeMessage\032\030.protos.ChaincodeMessa" +
+ "ge\"\000(\0010\001BO\n\"org.hyperledger.fabric.proto" +
+ "s.peerZ)github.com/hyperledger/fabric/pr" +
+ "otos/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..84ecefc7 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,34 @@ public interface ChaincodeActionOrBuilder extends
* optional .protos.ChaincodeID chaincode_id = 4;
*/
org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDOrBuilder getChaincodeIdOrBuilder();
+
+ /**
+ * + * This field contains the token expectation generated by the chaincode + * executing this invocation + *+ * + *
optional .protos.TokenExpectation token_expectation = 5;
+ */
+ boolean hasTokenExpectation();
+ /**
+ * + * This field contains the token expectation generated by the chaincode + * executing this invocation + *+ * + *
optional .protos.TokenExpectation token_expectation = 5;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation getTokenExpectation();
+ /**
+ * + * This field contains the token expectation generated by the chaincode + * executing this invocation + *+ * + *
optional .protos.TokenExpectation token_expectation = 5;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder getTokenExpectationOrBuilder();
}
/**
*
@@ -3124,6 +3152,19 @@ private ChaincodeAction(
chaincodeId_ = subBuilder.buildPartial();
}
+ break;
+ }
+ case 42: {
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder subBuilder = null;
+ if (tokenExpectation_ != null) {
+ subBuilder = tokenExpectation_.toBuilder();
+ }
+ tokenExpectation_ = input.readMessage(org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(tokenExpectation_);
+ tokenExpectation_ = subBuilder.buildPartial();
+ }
+
break;
}
}
@@ -3255,6 +3296,42 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDOrBuilder getChai
return getChaincodeId();
}
+ public static final int TOKEN_EXPECTATION_FIELD_NUMBER = 5;
+ private org.hyperledger.fabric.protos.token.Expectations.TokenExpectation tokenExpectation_;
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public boolean hasTokenExpectation() {
+ return tokenExpectation_ != null;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation getTokenExpectation() {
+ return tokenExpectation_ == null ? org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.getDefaultInstance() : tokenExpectation_;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder getTokenExpectationOrBuilder() {
+ return getTokenExpectation();
+ }
+
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
@@ -3279,6 +3356,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (chaincodeId_ != null) {
output.writeMessage(4, getChaincodeId());
}
+ if (tokenExpectation_ != null) {
+ output.writeMessage(5, getTokenExpectation());
+ }
}
public int getSerializedSize() {
@@ -3302,6 +3382,10 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getChaincodeId());
}
+ if (tokenExpectation_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, getTokenExpectation());
+ }
memoizedSize = size;
return size;
}
@@ -3332,6 +3416,11 @@ public boolean equals(final java.lang.Object obj) {
result = result && getChaincodeId()
.equals(other.getChaincodeId());
}
+ result = result && (hasTokenExpectation() == other.hasTokenExpectation());
+ if (hasTokenExpectation()) {
+ result = result && getTokenExpectation()
+ .equals(other.getTokenExpectation());
+ }
return result;
}
@@ -3354,6 +3443,10 @@ public int hashCode() {
hash = (37 * hash) + CHAINCODE_ID_FIELD_NUMBER;
hash = (53 * hash) + getChaincodeId().hashCode();
}
+ if (hasTokenExpectation()) {
+ hash = (37 * hash) + TOKEN_EXPECTATION_FIELD_NUMBER;
+ hash = (53 * hash) + getTokenExpectation().hashCode();
+ }
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -3493,6 +3586,12 @@ public Builder clear() {
chaincodeId_ = null;
chaincodeIdBuilder_ = null;
}
+ if (tokenExpectationBuilder_ == null) {
+ tokenExpectation_ = null;
+ } else {
+ tokenExpectation_ = null;
+ tokenExpectationBuilder_ = null;
+ }
return this;
}
@@ -3527,6 +3626,11 @@ public org.hyperledger.fabric.protos.peer.ProposalPackage.ChaincodeAction buildP
} else {
result.chaincodeId_ = chaincodeIdBuilder_.build();
}
+ if (tokenExpectationBuilder_ == null) {
+ result.tokenExpectation_ = tokenExpectation_;
+ } else {
+ result.tokenExpectation_ = tokenExpectationBuilder_.build();
+ }
onBuilt();
return result;
}
@@ -3580,6 +3684,9 @@ public Builder mergeFrom(org.hyperledger.fabric.protos.peer.ProposalPackage.Chai
if (other.hasChaincodeId()) {
mergeChaincodeId(other.getChaincodeId());
}
+ if (other.hasTokenExpectation()) {
+ mergeTokenExpectation(other.getTokenExpectation());
+ }
onChanged();
return this;
}
@@ -4035,6 +4142,168 @@ public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDOrBuilder getChai
}
return chaincodeIdBuilder_;
}
+
+ private org.hyperledger.fabric.protos.token.Expectations.TokenExpectation tokenExpectation_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation, org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder> tokenExpectationBuilder_;
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public boolean hasTokenExpectation() {
+ return tokenExpectationBuilder_ != null || tokenExpectation_ != null;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation getTokenExpectation() {
+ if (tokenExpectationBuilder_ == null) {
+ return tokenExpectation_ == null ? org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.getDefaultInstance() : tokenExpectation_;
+ } else {
+ return tokenExpectationBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public Builder setTokenExpectation(org.hyperledger.fabric.protos.token.Expectations.TokenExpectation value) {
+ if (tokenExpectationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ tokenExpectation_ = value;
+ onChanged();
+ } else {
+ tokenExpectationBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public Builder setTokenExpectation(
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder builderForValue) {
+ if (tokenExpectationBuilder_ == null) {
+ tokenExpectation_ = builderForValue.build();
+ onChanged();
+ } else {
+ tokenExpectationBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public Builder mergeTokenExpectation(org.hyperledger.fabric.protos.token.Expectations.TokenExpectation value) {
+ if (tokenExpectationBuilder_ == null) {
+ if (tokenExpectation_ != null) {
+ tokenExpectation_ =
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.newBuilder(tokenExpectation_).mergeFrom(value).buildPartial();
+ } else {
+ tokenExpectation_ = value;
+ }
+ onChanged();
+ } else {
+ tokenExpectationBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public Builder clearTokenExpectation() {
+ if (tokenExpectationBuilder_ == null) {
+ tokenExpectation_ = null;
+ onChanged();
+ } else {
+ tokenExpectation_ = null;
+ tokenExpectationBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder getTokenExpectationBuilder() {
+
+ onChanged();
+ return getTokenExpectationFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder getTokenExpectationOrBuilder() {
+ if (tokenExpectationBuilder_ != null) {
+ return tokenExpectationBuilder_.getMessageOrBuilder();
+ } else {
+ return tokenExpectation_ == null ?
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.getDefaultInstance() : tokenExpectation_;
+ }
+ }
+ /**
+ *
+ * This field contains the token expectation generated by the chaincode
+ * executing this invocation
+ *
+ *
+ * optional .protos.TokenExpectation token_expectation = 5;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation, org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder>
+ getTokenExpectationFieldBuilder() {
+ if (tokenExpectationBuilder_ == null) {
+ tokenExpectationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation, org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder>(
+ getTokenExpectation(),
+ getParentForChildren(),
+ isClean());
+ tokenExpectation_ = null;
+ }
+ return tokenExpectationBuilder_;
+ }
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
@@ -4125,22 +4394,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\030token/expectations.proto\";\n\016SignedPro" +
+ "posal\022\026\n\016proposal_bytes\030\001 \001(\014\022\021\n\tsignatu" +
+ "re\030\002 \001(\014\">\n\010Proposal\022\016\n\006header\030\001 \001(\014\022\017\n\007" +
+ "payload\030\002 \001(\014\022\021\n\textension\030\003 \001(\014\"a\n\030Chai" +
+ "ncodeHeaderExtension\022\032\n\022payload_visibili" +
+ "ty\030\001 \001(\014\022)\n\014chaincode_id\030\002 \001(\0132\023.protos." +
+ "ChaincodeID\"\250\001\n\030ChaincodeProposalPayload" +
+ "\022\r\n\005input\030\001 \001(\014\022H\n\014TransientMap\030\002 \003(\01322.",
+ "protos.ChaincodeProposalPayload.Transien" +
+ "tMapEntry\0323\n\021TransientMapEntry\022\013\n\003key\030\001 " +
+ "\001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\266\001\n\017ChaincodeActi" +
+ "on\022\017\n\007results\030\001 \001(\014\022\016\n\006events\030\002 \001(\014\022\"\n\010r" +
+ "esponse\030\003 \001(\0132\020.protos.Response\022)\n\014chain" +
+ "code_id\030\004 \001(\0132\023.protos.ChaincodeID\0223\n\021to" +
+ "ken_expectation\030\005 \001(\0132\030.protos.TokenExpe" +
+ "ctationB`\n\"org.hyperledger.fabric.protos" +
+ ".peerB\017ProposalPackageZ)github.com/hyper" +
+ "ledger/fabric/protos/peerb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4155,6 +4426,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.Expectations.getDescriptor(),
}, assigner);
internal_static_protos_SignedProposal_descriptor =
getDescriptor().getMessageTypes().get(0);
@@ -4191,9 +4463,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", "TokenExpectation", });
org.hyperledger.fabric.protos.peer.Chaincode.getDescriptor();
org.hyperledger.fabric.protos.peer.ProposalResponsePackage.getDescriptor();
+ org.hyperledger.fabric.protos.token.Expectations.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
diff --git a/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Expectations.java b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Expectations.java
new file mode 100644
index 00000000..a545b6fc
--- /dev/null
+++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Expectations.java
@@ -0,0 +1,2584 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: token/expectations.proto
+
+package org.hyperledger.fabric.protos.token;
+
+public final class Expectations {
+ private Expectations() {}
+ 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 TokenExpectationOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:protos.TokenExpectation)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation getPlainExpectation();
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder getPlainExpectationOrBuilder();
+
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.ExpectationCase getExpectationCase();
+ }
+ /**
+ *
+ * TokenExpectation represent the belief that someone should achieve in terms of a token action
+ *
+ *
+ * Protobuf type {@code protos.TokenExpectation}
+ */
+ public static final class TokenExpectation extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:protos.TokenExpectation)
+ TokenExpectationOrBuilder {
+ // Use TokenExpectation.newBuilder() to construct.
+ private TokenExpectation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private TokenExpectation() {
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private TokenExpectation(
+ 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.Expectations.PlainExpectation.Builder subBuilder = null;
+ if (expectationCase_ == 1) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_).toBuilder();
+ }
+ expectation_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_);
+ expectation_ = subBuilder.buildPartial();
+ }
+ expectationCase_ = 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.Expectations.internal_static_protos_TokenExpectation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_TokenExpectation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.class, org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder.class);
+ }
+
+ private int expectationCase_ = 0;
+ private java.lang.Object expectation_;
+ public enum ExpectationCase
+ implements com.google.protobuf.Internal.EnumLite {
+ PLAIN_EXPECTATION(1),
+ EXPECTATION_NOT_SET(0);
+ private final int value;
+ private ExpectationCase(int value) {
+ this.value = value;
+ }
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static ExpectationCase valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static ExpectationCase forNumber(int value) {
+ switch (value) {
+ case 1: return PLAIN_EXPECTATION;
+ case 0: return EXPECTATION_NOT_SET;
+ default: return null;
+ }
+ }
+ public int getNumber() {
+ return this.value;
+ }
+ };
+
+ public ExpectationCase
+ getExpectationCase() {
+ return ExpectationCase.forNumber(
+ expectationCase_);
+ }
+
+ public static final int PLAIN_EXPECTATION_FIELD_NUMBER = 1;
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation getPlainExpectation() {
+ if (expectationCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance();
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder getPlainExpectationOrBuilder() {
+ if (expectationCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.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 (expectationCase_ == 1) {
+ output.writeMessage(1, (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_);
+ }
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (expectationCase_ == 1) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_);
+ }
+ 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.Expectations.TokenExpectation)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation other = (org.hyperledger.fabric.protos.token.Expectations.TokenExpectation) obj;
+
+ boolean result = true;
+ result = result && getExpectationCase().equals(
+ other.getExpectationCase());
+ if (!result) return false;
+ switch (expectationCase_) {
+ case 1:
+ result = result && getPlainExpectation()
+ .equals(other.getPlainExpectation());
+ 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 (expectationCase_) {
+ case 1:
+ hash = (37 * hash) + PLAIN_EXPECTATION_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainExpectation().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Expectations.TokenExpectation parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.TokenExpectation 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.Expectations.TokenExpectation parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.TokenExpectation 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.Expectations.TokenExpectation parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.TokenExpectation 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.Expectations.TokenExpectation parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.TokenExpectation 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.Expectations.TokenExpectation 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.Expectations.TokenExpectation 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.Expectations.TokenExpectation 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;
+ }
+ /**
+ *
+ * TokenExpectation represent the belief that someone should achieve in terms of a token action
+ *
+ *
+ * Protobuf type {@code protos.TokenExpectation}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:protos.TokenExpectation)
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectationOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_TokenExpectation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_TokenExpectation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.class, org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.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();
+ expectationCase_ = 0;
+ expectation_ = null;
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_TokenExpectation_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation build() {
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.TokenExpectation buildPartial() {
+ org.hyperledger.fabric.protos.token.Expectations.TokenExpectation result = new org.hyperledger.fabric.protos.token.Expectations.TokenExpectation(this);
+ if (expectationCase_ == 1) {
+ if (plainExpectationBuilder_ == null) {
+ result.expectation_ = expectation_;
+ } else {
+ result.expectation_ = plainExpectationBuilder_.build();
+ }
+ }
+ result.expectationCase_ = expectationCase_;
+ 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.Expectations.TokenExpectation) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Expectations.TokenExpectation)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Expectations.TokenExpectation other) {
+ if (other == org.hyperledger.fabric.protos.token.Expectations.TokenExpectation.getDefaultInstance()) return this;
+ switch (other.getExpectationCase()) {
+ case PLAIN_EXPECTATION: {
+ mergePlainExpectation(other.getPlainExpectation());
+ break;
+ }
+ case EXPECTATION_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.Expectations.TokenExpectation parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Expectations.TokenExpectation) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int expectationCase_ = 0;
+ private java.lang.Object expectation_;
+ public ExpectationCase
+ getExpectationCase() {
+ return ExpectationCase.forNumber(
+ expectationCase_);
+ }
+
+ public Builder clearExpectation() {
+ expectationCase_ = 0;
+ expectation_ = null;
+ onChanged();
+ return this;
+ }
+
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder> plainExpectationBuilder_;
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation getPlainExpectation() {
+ if (plainExpectationBuilder_ == null) {
+ if (expectationCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance();
+ } else {
+ if (expectationCase_ == 1) {
+ return plainExpectationBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public Builder setPlainExpectation(org.hyperledger.fabric.protos.token.Expectations.PlainExpectation value) {
+ if (plainExpectationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ expectation_ = value;
+ onChanged();
+ } else {
+ plainExpectationBuilder_.setMessage(value);
+ }
+ expectationCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public Builder setPlainExpectation(
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder builderForValue) {
+ if (plainExpectationBuilder_ == null) {
+ expectation_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainExpectationBuilder_.setMessage(builderForValue.build());
+ }
+ expectationCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public Builder mergePlainExpectation(org.hyperledger.fabric.protos.token.Expectations.PlainExpectation value) {
+ if (plainExpectationBuilder_ == null) {
+ if (expectationCase_ == 1 &&
+ expectation_ != org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance()) {
+ expectation_ = org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.newBuilder((org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ expectation_ = value;
+ }
+ onChanged();
+ } else {
+ if (expectationCase_ == 1) {
+ plainExpectationBuilder_.mergeFrom(value);
+ }
+ plainExpectationBuilder_.setMessage(value);
+ }
+ expectationCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public Builder clearPlainExpectation() {
+ if (plainExpectationBuilder_ == null) {
+ if (expectationCase_ == 1) {
+ expectationCase_ = 0;
+ expectation_ = null;
+ onChanged();
+ }
+ } else {
+ if (expectationCase_ == 1) {
+ expectationCase_ = 0;
+ expectation_ = null;
+ }
+ plainExpectationBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder getPlainExpectationBuilder() {
+ return getPlainExpectationFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder getPlainExpectationOrBuilder() {
+ if ((expectationCase_ == 1) && (plainExpectationBuilder_ != null)) {
+ return plainExpectationBuilder_.getMessageOrBuilder();
+ } else {
+ if (expectationCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * PlainExpectation describes a plain token expectation
+ *
+ *
+ * optional .protos.PlainExpectation plain_expectation = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder>
+ getPlainExpectationFieldBuilder() {
+ if (plainExpectationBuilder_ == null) {
+ if (!(expectationCase_ == 1)) {
+ expectation_ = org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance();
+ }
+ plainExpectationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) expectation_,
+ getParentForChildren(),
+ isClean());
+ expectation_ = null;
+ }
+ expectationCase_ = 1;
+ onChanged();;
+ return plainExpectationBuilder_;
+ }
+ 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:protos.TokenExpectation)
+ }
+
+ // @@protoc_insertion_point(class_scope:protos.TokenExpectation)
+ private static final org.hyperledger.fabric.protos.token.Expectations.TokenExpectation DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Expectations.TokenExpectation();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Expectations.TokenExpectation getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public TokenExpectation parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TokenExpectation(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.Expectations.TokenExpectation getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainExpectationOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:protos.PlainExpectation)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getImportExpectation();
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder getImportExpectationOrBuilder();
+
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getTransferExpectation();
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder getTransferExpectationOrBuilder();
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.PayloadCase getPayloadCase();
+ }
+ /**
+ *
+ * PlainExpectation represent the plain expectation where no confidentiality is provided.
+ *
+ *
+ * Protobuf type {@code protos.PlainExpectation}
+ */
+ public static final class PlainExpectation extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:protos.PlainExpectation)
+ PlainExpectationOrBuilder {
+ // Use PlainExpectation.newBuilder() to construct.
+ private PlainExpectation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainExpectation() {
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainExpectation(
+ 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.Expectations.PlainTokenExpectation.Builder subBuilder = null;
+ if (payloadCase_ == 1) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_).toBuilder();
+ }
+ payload_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_);
+ payload_ = subBuilder.buildPartial();
+ }
+ payloadCase_ = 1;
+ break;
+ }
+ case 18: {
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder subBuilder = null;
+ if (payloadCase_ == 2) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_).toBuilder();
+ }
+ payload_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) 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.Expectations.internal_static_protos_PlainExpectation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_PlainExpectation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.class, org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder.class);
+ }
+
+ private int payloadCase_ = 0;
+ private java.lang.Object payload_;
+ public enum PayloadCase
+ implements com.google.protobuf.Internal.EnumLite {
+ IMPORT_EXPECTATION(1),
+ TRANSFER_EXPECTATION(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 IMPORT_EXPECTATION;
+ case 2: return TRANSFER_EXPECTATION;
+ 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 IMPORT_EXPECTATION_FIELD_NUMBER = 1;
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getImportExpectation() {
+ if (payloadCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder getImportExpectationOrBuilder() {
+ if (payloadCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+
+ public static final int TRANSFER_EXPECTATION_FIELD_NUMBER = 2;
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getTransferExpectation() {
+ if (payloadCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder getTransferExpectationOrBuilder() {
+ if (payloadCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.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.Expectations.PlainTokenExpectation) payload_);
+ }
+ if (payloadCase_ == 2) {
+ output.writeMessage(2, (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) 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.Expectations.PlainTokenExpectation) payload_);
+ }
+ if (payloadCase_ == 2) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) 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.Expectations.PlainExpectation)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation other = (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) obj;
+
+ boolean result = true;
+ result = result && getPayloadCase().equals(
+ other.getPayloadCase());
+ if (!result) return false;
+ switch (payloadCase_) {
+ case 1:
+ result = result && getImportExpectation()
+ .equals(other.getImportExpectation());
+ break;
+ case 2:
+ result = result && getTransferExpectation()
+ .equals(other.getTransferExpectation());
+ 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) + IMPORT_EXPECTATION_FIELD_NUMBER;
+ hash = (53 * hash) + getImportExpectation().hashCode();
+ break;
+ case 2:
+ hash = (37 * hash) + TRANSFER_EXPECTATION_FIELD_NUMBER;
+ hash = (53 * hash) + getTransferExpectation().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainExpectation parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainExpectation 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.Expectations.PlainExpectation parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainExpectation 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.Expectations.PlainExpectation parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainExpectation 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.Expectations.PlainExpectation parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainExpectation 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.Expectations.PlainExpectation 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.Expectations.PlainExpectation 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.Expectations.PlainExpectation 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;
+ }
+ /**
+ *
+ * PlainExpectation represent the plain expectation where no confidentiality is provided.
+ *
+ *
+ * Protobuf type {@code protos.PlainExpectation}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:protos.PlainExpectation)
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectationOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_PlainExpectation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_PlainExpectation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.class, org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.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.Expectations.internal_static_protos_PlainExpectation_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation build() {
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainExpectation buildPartial() {
+ org.hyperledger.fabric.protos.token.Expectations.PlainExpectation result = new org.hyperledger.fabric.protos.token.Expectations.PlainExpectation(this);
+ if (payloadCase_ == 1) {
+ if (importExpectationBuilder_ == null) {
+ result.payload_ = payload_;
+ } else {
+ result.payload_ = importExpectationBuilder_.build();
+ }
+ }
+ if (payloadCase_ == 2) {
+ if (transferExpectationBuilder_ == null) {
+ result.payload_ = payload_;
+ } else {
+ result.payload_ = transferExpectationBuilder_.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.Expectations.PlainExpectation) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Expectations.PlainExpectation)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Expectations.PlainExpectation other) {
+ if (other == org.hyperledger.fabric.protos.token.Expectations.PlainExpectation.getDefaultInstance()) return this;
+ switch (other.getPayloadCase()) {
+ case IMPORT_EXPECTATION: {
+ mergeImportExpectation(other.getImportExpectation());
+ break;
+ }
+ case TRANSFER_EXPECTATION: {
+ mergeTransferExpectation(other.getTransferExpectation());
+ 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.Expectations.PlainExpectation parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Expectations.PlainExpectation) 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.Expectations.PlainTokenExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder> importExpectationBuilder_;
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getImportExpectation() {
+ if (importExpectationBuilder_ == null) {
+ if (payloadCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ } else {
+ if (payloadCase_ == 1) {
+ return importExpectationBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public Builder setImportExpectation(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation value) {
+ if (importExpectationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ payload_ = value;
+ onChanged();
+ } else {
+ importExpectationBuilder_.setMessage(value);
+ }
+ payloadCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public Builder setImportExpectation(
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder builderForValue) {
+ if (importExpectationBuilder_ == null) {
+ payload_ = builderForValue.build();
+ onChanged();
+ } else {
+ importExpectationBuilder_.setMessage(builderForValue.build());
+ }
+ payloadCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public Builder mergeImportExpectation(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation value) {
+ if (importExpectationBuilder_ == null) {
+ if (payloadCase_ == 1 &&
+ payload_ != org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance()) {
+ payload_ = org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.newBuilder((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ payload_ = value;
+ }
+ onChanged();
+ } else {
+ if (payloadCase_ == 1) {
+ importExpectationBuilder_.mergeFrom(value);
+ }
+ importExpectationBuilder_.setMessage(value);
+ }
+ payloadCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public Builder clearImportExpectation() {
+ if (importExpectationBuilder_ == null) {
+ if (payloadCase_ == 1) {
+ payloadCase_ = 0;
+ payload_ = null;
+ onChanged();
+ }
+ } else {
+ if (payloadCase_ == 1) {
+ payloadCase_ = 0;
+ payload_ = null;
+ }
+ importExpectationBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder getImportExpectationBuilder() {
+ return getImportExpectationFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder getImportExpectationOrBuilder() {
+ if ((payloadCase_ == 1) && (importExpectationBuilder_ != null)) {
+ return importExpectationBuilder_.getMessageOrBuilder();
+ } else {
+ if (payloadCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * ImportExpectation describes an token import expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation import_expectation = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder>
+ getImportExpectationFieldBuilder() {
+ if (importExpectationBuilder_ == null) {
+ if (!(payloadCase_ == 1)) {
+ payload_ = org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ importExpectationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_,
+ getParentForChildren(),
+ isClean());
+ payload_ = null;
+ }
+ payloadCase_ = 1;
+ onChanged();;
+ return importExpectationBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder> transferExpectationBuilder_;
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getTransferExpectation() {
+ if (transferExpectationBuilder_ == null) {
+ if (payloadCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ } else {
+ if (payloadCase_ == 2) {
+ return transferExpectationBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public Builder setTransferExpectation(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation value) {
+ if (transferExpectationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ payload_ = value;
+ onChanged();
+ } else {
+ transferExpectationBuilder_.setMessage(value);
+ }
+ payloadCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public Builder setTransferExpectation(
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder builderForValue) {
+ if (transferExpectationBuilder_ == null) {
+ payload_ = builderForValue.build();
+ onChanged();
+ } else {
+ transferExpectationBuilder_.setMessage(builderForValue.build());
+ }
+ payloadCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public Builder mergeTransferExpectation(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation value) {
+ if (transferExpectationBuilder_ == null) {
+ if (payloadCase_ == 2 &&
+ payload_ != org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance()) {
+ payload_ = org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.newBuilder((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ payload_ = value;
+ }
+ onChanged();
+ } else {
+ if (payloadCase_ == 2) {
+ transferExpectationBuilder_.mergeFrom(value);
+ }
+ transferExpectationBuilder_.setMessage(value);
+ }
+ payloadCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public Builder clearTransferExpectation() {
+ if (transferExpectationBuilder_ == null) {
+ if (payloadCase_ == 2) {
+ payloadCase_ = 0;
+ payload_ = null;
+ onChanged();
+ }
+ } else {
+ if (payloadCase_ == 2) {
+ payloadCase_ = 0;
+ payload_ = null;
+ }
+ transferExpectationBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder getTransferExpectationBuilder() {
+ return getTransferExpectationFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder getTransferExpectationOrBuilder() {
+ if ((payloadCase_ == 2) && (transferExpectationBuilder_ != null)) {
+ return transferExpectationBuilder_.getMessageOrBuilder();
+ } else {
+ if (payloadCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_;
+ }
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * TransferExpectation describes a token transfer expectation
+ *
+ *
+ * optional .protos.PlainTokenExpectation transfer_expectation = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder>
+ getTransferExpectationFieldBuilder() {
+ if (transferExpectationBuilder_ == null) {
+ if (!(payloadCase_ == 2)) {
+ payload_ = org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+ transferExpectationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) payload_,
+ getParentForChildren(),
+ isClean());
+ payload_ = null;
+ }
+ payloadCase_ = 2;
+ onChanged();;
+ return transferExpectationBuilder_;
+ }
+ 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:protos.PlainExpectation)
+ }
+
+ // @@protoc_insertion_point(class_scope:protos.PlainExpectation)
+ private static final org.hyperledger.fabric.protos.token.Expectations.PlainExpectation DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Expectations.PlainExpectation();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainExpectation getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainExpectation parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainExpectation(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.Expectations.PlainExpectation getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainTokenExpectationOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:protos.PlainTokenExpectation)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ java.util.List
+ getOutputsList();
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ int getOutputsCount();
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList();
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index);
+ }
+ /**
+ *
+ * PlainTokenExpectation represents the expecation that
+ * certain outputs will be matched
+ *
+ *
+ * Protobuf type {@code protos.PlainTokenExpectation}
+ */
+ public static final class PlainTokenExpectation extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:protos.PlainTokenExpectation)
+ PlainTokenExpectationOrBuilder {
+ // Use PlainTokenExpectation.newBuilder() to construct.
+ private PlainTokenExpectation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainTokenExpectation() {
+ outputs_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainTokenExpectation(
+ 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.PlainOutput.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.Expectations.internal_static_protos_PlainTokenExpectation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_PlainTokenExpectation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.class, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder.class);
+ }
+
+ public static final int OUTPUTS_FIELD_NUMBER = 1;
+ private java.util.List outputs_;
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List getOutputsList() {
+ return outputs_;
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ return outputs_;
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public int getOutputsCount() {
+ return outputs_.size();
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ return outputs_.get(index);
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder 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.Expectations.PlainTokenExpectation)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation other = (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) 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.Expectations.PlainTokenExpectation parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation 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.Expectations.PlainTokenExpectation parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation 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.Expectations.PlainTokenExpectation parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation 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.Expectations.PlainTokenExpectation parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation 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.Expectations.PlainTokenExpectation 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.Expectations.PlainTokenExpectation 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.Expectations.PlainTokenExpectation 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;
+ }
+ /**
+ *
+ * PlainTokenExpectation represents the expecation that
+ * certain outputs will be matched
+ *
+ *
+ * Protobuf type {@code protos.PlainTokenExpectation}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:protos.PlainTokenExpectation)
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectationOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_PlainTokenExpectation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Expectations.internal_static_protos_PlainTokenExpectation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.class, org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.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.Expectations.internal_static_protos_PlainTokenExpectation_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation build() {
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation buildPartial() {
+ org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation result = new org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation(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.Expectations.PlainTokenExpectation) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation other) {
+ if (other == org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation.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.Expectations.PlainTokenExpectation parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation) 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.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> outputsBuilder_;
+
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List getOutputsList() {
+ if (outputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(outputs_);
+ } else {
+ return outputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public int getOutputsCount() {
+ if (outputsBuilder_ == null) {
+ return outputs_.size();
+ } else {
+ return outputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index);
+ } else {
+ return outputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput 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 .PlainOutput outputs = 1;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.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 .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.PlainOutput 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 .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput 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 .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.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 .PlainOutput outputs = 1;
+ */
+ public Builder addAllOutputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> 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 .PlainOutput outputs = 1;
+ */
+ public Builder clearOutputs() {
+ if (outputsBuilder_ == null) {
+ outputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ outputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ 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 .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder getOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index); } else {
+ return outputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ if (outputsBuilder_ != null) {
+ return outputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(outputs_);
+ }
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder() {
+ return getOutputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * Outputs contains the expected outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List
+ getOutputsBuilderList() {
+ return getOutputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsFieldBuilder() {
+ if (outputsBuilder_ == null) {
+ outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>(
+ 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:protos.PlainTokenExpectation)
+ }
+
+ // @@protoc_insertion_point(class_scope:protos.PlainTokenExpectation)
+ private static final org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Expectations.PlainTokenExpectation getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainTokenExpectation parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainTokenExpectation(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.Expectations.PlainTokenExpectation getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_protos_TokenExpectation_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_protos_TokenExpectation_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_protos_PlainExpectation_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_protos_PlainExpectation_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_protos_PlainTokenExpectation_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_protos_PlainTokenExpectation_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\030token/expectations.proto\022\006protos\032\037goog" +
+ "le/protobuf/timestamp.proto\032\027token/trans" +
+ "action.proto\"X\n\020TokenExpectation\0225\n\021plai" +
+ "n_expectation\030\001 \001(\0132\030.protos.PlainExpect" +
+ "ationH\000B\r\n\013Expectation\"\231\001\n\020PlainExpectat" +
+ "ion\022;\n\022import_expectation\030\001 \001(\0132\035.protos" +
+ ".PlainTokenExpectationH\000\022=\n\024transfer_exp" +
+ "ectation\030\002 \001(\0132\035.protos.PlainTokenExpect" +
+ "ationH\000B\t\n\007payload\"6\n\025PlainTokenExpectat" +
+ "ion\022\035\n\007outputs\030\001 \003(\0132\014.PlainOutputBQ\n#or",
+ "g.hyperledger.fabric.protos.tokenZ*githu" +
+ "b.com/hyperledger/fabric/protos/tokenb\006p" +
+ "roto3"
+ };
+ 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[] {
+ com.google.protobuf.TimestampProto.getDescriptor(),
+ org.hyperledger.fabric.protos.token.Transaction.getDescriptor(),
+ }, assigner);
+ internal_static_protos_TokenExpectation_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_protos_TokenExpectation_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_protos_TokenExpectation_descriptor,
+ new java.lang.String[] { "PlainExpectation", "Expectation", });
+ internal_static_protos_PlainExpectation_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_protos_PlainExpectation_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_protos_PlainExpectation_descriptor,
+ new java.lang.String[] { "ImportExpectation", "TransferExpectation", "Payload", });
+ internal_static_protos_PlainTokenExpectation_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_protos_PlainTokenExpectation_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_protos_PlainTokenExpectation_descriptor,
+ new java.lang.String[] { "Outputs", });
+ com.google.protobuf.TimestampProto.getDescriptor();
+ 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..13291dfb
--- /dev/null
+++ b/fabric-chaincode-protos/src/main/java/org/hyperledger/fabric/protos/token/Transaction.java
@@ -0,0 +1,10167 @@
+// 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:TokenTransaction)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();
+
+ 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 TokenTransaction}
+ */
+ public static final class TokenTransaction extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements: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.PlainTokenAction.Builder subBuilder = null;
+ if (actionCase_ == 1) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_).toBuilder();
+ }
+ action_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) 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_TokenTransaction_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_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 {
+ PLAIN_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 PLAIN_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 PLAIN_ACTION_FIELD_NUMBER = 1;
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {
+ if (actionCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {
+ if (actionCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.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.PlainTokenAction) 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.PlainTokenAction) 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 && getPlainAction()
+ .equals(other.getPlainAction());
+ 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) + PLAIN_ACTION_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainAction().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 TokenTransaction}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements: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_TokenTransaction_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_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_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 (plainActionBuilder_ == null) {
+ result.action_ = action_;
+ } else {
+ result.action_ = plainActionBuilder_.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 PLAIN_ACTION: {
+ mergePlainAction(other.getPlainAction());
+ 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.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> plainActionBuilder_;
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {
+ if (plainActionBuilder_ == null) {
+ if (actionCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();
+ } else {
+ if (actionCase_ == 1) {
+ return plainActionBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();
+ }
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {
+ if (plainActionBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ action_ = value;
+ onChanged();
+ } else {
+ plainActionBuilder_.setMessage(value);
+ }
+ actionCase_ = 1;
+ return this;
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public Builder setPlainAction(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {
+ if (plainActionBuilder_ == null) {
+ action_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainActionBuilder_.setMessage(builderForValue.build());
+ }
+ actionCase_ = 1;
+ return this;
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {
+ if (plainActionBuilder_ == null) {
+ if (actionCase_ == 1 &&
+ action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {
+ action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ action_ = value;
+ }
+ onChanged();
+ } else {
+ if (actionCase_ == 1) {
+ plainActionBuilder_.mergeFrom(value);
+ }
+ plainActionBuilder_.setMessage(value);
+ }
+ actionCase_ = 1;
+ return this;
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public Builder clearPlainAction() {
+ if (plainActionBuilder_ == null) {
+ if (actionCase_ == 1) {
+ actionCase_ = 0;
+ action_ = null;
+ onChanged();
+ }
+ } else {
+ if (actionCase_ == 1) {
+ actionCase_ = 0;
+ action_ = null;
+ }
+ plainActionBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {
+ return getPlainActionFieldBuilder().getBuilder();
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {
+ if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {
+ return plainActionBuilder_.getMessageOrBuilder();
+ } else {
+ if (actionCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();
+ }
+ }
+ /**
+ * optional .PlainTokenAction plain_action = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>
+ getPlainActionFieldBuilder() {
+ if (plainActionBuilder_ == null) {
+ if (!(actionCase_ == 1)) {
+ action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();
+ }
+ plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,
+ getParentForChildren(),
+ isClean());
+ action_ = null;
+ }
+ actionCase_ = 1;
+ onChanged();;
+ return plainActionBuilder_;
+ }
+ 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:TokenTransaction)
+ }
+
+ // @@protoc_insertion_point(class_scope: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 PlainTokenActionOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainTokenAction)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport getPlainImport();
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder getPlainImportOrBuilder();
+
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainTransfer();
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainTransferOrBuilder();
+
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainRedeem();
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainRedeemOrBuilder();
+
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove getPlainApprove();
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder getPlainApproveOrBuilder();
+
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom getPlainTransferFrom();
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder getPlainTransferFromOrBuilder();
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.DataCase getDataCase();
+ }
+ /**
+ *
+ * PlainTokenAction governs the structure of a token action that is
+ * subjected to no privacy restrictions
+ *
+ *
+ * Protobuf type {@code PlainTokenAction}
+ */
+ public static final class PlainTokenAction extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainTokenAction)
+ PlainTokenActionOrBuilder {
+ // Use PlainTokenAction.newBuilder() to construct.
+ private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainTokenAction() {
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainTokenAction(
+ 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.PlainImport.Builder subBuilder = null;
+ if (dataCase_ == 1) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_).toBuilder();
+ }
+ data_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainImport.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_);
+ data_ = subBuilder.buildPartial();
+ }
+ dataCase_ = 1;
+ break;
+ }
+ case 18: {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder subBuilder = null;
+ if (dataCase_ == 2) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_).toBuilder();
+ }
+ data_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_);
+ data_ = subBuilder.buildPartial();
+ }
+ dataCase_ = 2;
+ break;
+ }
+ case 26: {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder subBuilder = null;
+ if (dataCase_ == 3) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_).toBuilder();
+ }
+ data_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_);
+ data_ = subBuilder.buildPartial();
+ }
+ dataCase_ = 3;
+ break;
+ }
+ case 34: {
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder subBuilder = null;
+ if (dataCase_ == 4) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_).toBuilder();
+ }
+ data_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainApprove.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_);
+ data_ = subBuilder.buildPartial();
+ }
+ dataCase_ = 4;
+ break;
+ }
+ case 42: {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder subBuilder = null;
+ if (dataCase_ == 5) {
+ subBuilder = ((org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_).toBuilder();
+ }
+ data_ =
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_);
+ data_ = subBuilder.buildPartial();
+ }
+ dataCase_ = 5;
+ 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_PlainTokenAction_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTokenAction_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.class, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder.class);
+ }
+
+ private int dataCase_ = 0;
+ private java.lang.Object data_;
+ public enum DataCase
+ implements com.google.protobuf.Internal.EnumLite {
+ PLAIN_IMPORT(1),
+ PLAIN_TRANSFER(2),
+ PLAIN_REDEEM(3),
+ PLAIN_APPROVE(4),
+ PLAIN_TRANSFER_FROM(5),
+ 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 PLAIN_IMPORT;
+ case 2: return PLAIN_TRANSFER;
+ case 3: return PLAIN_REDEEM;
+ case 4: return PLAIN_APPROVE;
+ case 5: return PLAIN_TRANSFER_FROM;
+ 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 PLAIN_IMPORT_FIELD_NUMBER = 1;
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImport getPlainImport() {
+ if (dataCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder getPlainImportOrBuilder() {
+ if (dataCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ }
+
+ public static final int PLAIN_TRANSFER_FIELD_NUMBER = 2;
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainTransfer() {
+ if (dataCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainTransferOrBuilder() {
+ if (dataCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+
+ public static final int PLAIN_REDEEM_FIELD_NUMBER = 3;
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainRedeem() {
+ if (dataCase_ == 3) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainRedeemOrBuilder() {
+ if (dataCase_ == 3) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+
+ public static final int PLAIN_APPROVE_FIELD_NUMBER = 4;
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApprove getPlainApprove() {
+ if (dataCase_ == 4) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder getPlainApproveOrBuilder() {
+ if (dataCase_ == 4) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ }
+
+ public static final int PLAIN_TRANSFER_FROM_FIELD_NUMBER = 5;
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom getPlainTransferFrom() {
+ if (dataCase_ == 5) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance();
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder getPlainTransferFromOrBuilder() {
+ if (dataCase_ == 5) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.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.PlainImport) data_);
+ }
+ if (dataCase_ == 2) {
+ output.writeMessage(2, (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_);
+ }
+ if (dataCase_ == 3) {
+ output.writeMessage(3, (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_);
+ }
+ if (dataCase_ == 4) {
+ output.writeMessage(4, (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_);
+ }
+ if (dataCase_ == 5) {
+ output.writeMessage(5, (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) 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.PlainImport) data_);
+ }
+ if (dataCase_ == 2) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_);
+ }
+ if (dataCase_ == 3) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_);
+ }
+ if (dataCase_ == 4) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_);
+ }
+ if (dataCase_ == 5) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) 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.PlainTokenAction)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction other = (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) obj;
+
+ boolean result = true;
+ result = result && getDataCase().equals(
+ other.getDataCase());
+ if (!result) return false;
+ switch (dataCase_) {
+ case 1:
+ result = result && getPlainImport()
+ .equals(other.getPlainImport());
+ break;
+ case 2:
+ result = result && getPlainTransfer()
+ .equals(other.getPlainTransfer());
+ break;
+ case 3:
+ result = result && getPlainRedeem()
+ .equals(other.getPlainRedeem());
+ break;
+ case 4:
+ result = result && getPlainApprove()
+ .equals(other.getPlainApprove());
+ break;
+ case 5:
+ result = result && getPlainTransferFrom()
+ .equals(other.getPlainTransferFrom());
+ 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) + PLAIN_IMPORT_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainImport().hashCode();
+ break;
+ case 2:
+ hash = (37 * hash) + PLAIN_TRANSFER_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainTransfer().hashCode();
+ break;
+ case 3:
+ hash = (37 * hash) + PLAIN_REDEEM_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainRedeem().hashCode();
+ break;
+ case 4:
+ hash = (37 * hash) + PLAIN_APPROVE_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainApprove().hashCode();
+ break;
+ case 5:
+ hash = (37 * hash) + PLAIN_TRANSFER_FROM_FIELD_NUMBER;
+ hash = (53 * hash) + getPlainTransferFrom().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction 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.PlainTokenAction parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction 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.PlainTokenAction 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.PlainTokenAction 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.PlainTokenAction 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.PlainTokenAction 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.PlainTokenAction 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.PlainTokenAction 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.PlainTokenAction 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;
+ }
+ /**
+ *
+ * PlainTokenAction governs the structure of a token action that is
+ * subjected to no privacy restrictions
+ *
+ *
+ * Protobuf type {@code PlainTokenAction}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainTokenAction)
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTokenAction_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTokenAction_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.class, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.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_PlainTokenAction_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction result = new org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction(this);
+ if (dataCase_ == 1) {
+ if (plainImportBuilder_ == null) {
+ result.data_ = data_;
+ } else {
+ result.data_ = plainImportBuilder_.build();
+ }
+ }
+ if (dataCase_ == 2) {
+ if (plainTransferBuilder_ == null) {
+ result.data_ = data_;
+ } else {
+ result.data_ = plainTransferBuilder_.build();
+ }
+ }
+ if (dataCase_ == 3) {
+ if (plainRedeemBuilder_ == null) {
+ result.data_ = data_;
+ } else {
+ result.data_ = plainRedeemBuilder_.build();
+ }
+ }
+ if (dataCase_ == 4) {
+ if (plainApproveBuilder_ == null) {
+ result.data_ = data_;
+ } else {
+ result.data_ = plainApproveBuilder_.build();
+ }
+ }
+ if (dataCase_ == 5) {
+ if (plainTransferFromBuilder_ == null) {
+ result.data_ = data_;
+ } else {
+ result.data_ = plainTransferFromBuilder_.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.PlainTokenAction) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) return this;
+ switch (other.getDataCase()) {
+ case PLAIN_IMPORT: {
+ mergePlainImport(other.getPlainImport());
+ break;
+ }
+ case PLAIN_TRANSFER: {
+ mergePlainTransfer(other.getPlainTransfer());
+ break;
+ }
+ case PLAIN_REDEEM: {
+ mergePlainRedeem(other.getPlainRedeem());
+ break;
+ }
+ case PLAIN_APPROVE: {
+ mergePlainApprove(other.getPlainApprove());
+ break;
+ }
+ case PLAIN_TRANSFER_FROM: {
+ mergePlainTransferFrom(other.getPlainTransferFrom());
+ 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.PlainTokenAction parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) 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.PlainImport, org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder> plainImportBuilder_;
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImport getPlainImport() {
+ if (plainImportBuilder_ == null) {
+ if (dataCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ } else {
+ if (dataCase_ == 1) {
+ return plainImportBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public Builder setPlainImport(org.hyperledger.fabric.protos.token.Transaction.PlainImport value) {
+ if (plainImportBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ data_ = value;
+ onChanged();
+ } else {
+ plainImportBuilder_.setMessage(value);
+ }
+ dataCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public Builder setPlainImport(
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder builderForValue) {
+ if (plainImportBuilder_ == null) {
+ data_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainImportBuilder_.setMessage(builderForValue.build());
+ }
+ dataCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public Builder mergePlainImport(org.hyperledger.fabric.protos.token.Transaction.PlainImport value) {
+ if (plainImportBuilder_ == null) {
+ if (dataCase_ == 1 &&
+ data_ != org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance()) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainImport.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ data_ = value;
+ }
+ onChanged();
+ } else {
+ if (dataCase_ == 1) {
+ plainImportBuilder_.mergeFrom(value);
+ }
+ plainImportBuilder_.setMessage(value);
+ }
+ dataCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public Builder clearPlainImport() {
+ if (plainImportBuilder_ == null) {
+ if (dataCase_ == 1) {
+ dataCase_ = 0;
+ data_ = null;
+ onChanged();
+ }
+ } else {
+ if (dataCase_ == 1) {
+ dataCase_ = 0;
+ data_ = null;
+ }
+ plainImportBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder getPlainImportBuilder() {
+ return getPlainImportFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder getPlainImportOrBuilder() {
+ if ((dataCase_ == 1) && (plainImportBuilder_ != null)) {
+ return plainImportBuilder_.getMessageOrBuilder();
+ } else {
+ if (dataCase_ == 1) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token import transaction
+ *
+ *
+ * optional .PlainImport plain_import = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport, org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder>
+ getPlainImportFieldBuilder() {
+ if (plainImportBuilder_ == null) {
+ if (!(dataCase_ == 1)) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ }
+ plainImportBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport, org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Transaction.PlainImport) data_,
+ getParentForChildren(),
+ isClean());
+ data_ = null;
+ }
+ dataCase_ = 1;
+ onChanged();;
+ return plainImportBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder> plainTransferBuilder_;
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainTransfer() {
+ if (plainTransferBuilder_ == null) {
+ if (dataCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ } else {
+ if (dataCase_ == 2) {
+ return plainTransferBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public Builder setPlainTransfer(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer value) {
+ if (plainTransferBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ data_ = value;
+ onChanged();
+ } else {
+ plainTransferBuilder_.setMessage(value);
+ }
+ dataCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public Builder setPlainTransfer(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder builderForValue) {
+ if (plainTransferBuilder_ == null) {
+ data_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainTransferBuilder_.setMessage(builderForValue.build());
+ }
+ dataCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public Builder mergePlainTransfer(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer value) {
+ if (plainTransferBuilder_ == null) {
+ if (dataCase_ == 2 &&
+ data_ != org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance()) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ data_ = value;
+ }
+ onChanged();
+ } else {
+ if (dataCase_ == 2) {
+ plainTransferBuilder_.mergeFrom(value);
+ }
+ plainTransferBuilder_.setMessage(value);
+ }
+ dataCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public Builder clearPlainTransfer() {
+ if (plainTransferBuilder_ == null) {
+ if (dataCase_ == 2) {
+ dataCase_ = 0;
+ data_ = null;
+ onChanged();
+ }
+ } else {
+ if (dataCase_ == 2) {
+ dataCase_ = 0;
+ data_ = null;
+ }
+ plainTransferBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder getPlainTransferBuilder() {
+ return getPlainTransferFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainTransferOrBuilder() {
+ if ((dataCase_ == 2) && (plainTransferBuilder_ != null)) {
+ return plainTransferBuilder_.getMessageOrBuilder();
+ } else {
+ if (dataCase_ == 2) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token transfer transaction
+ *
+ *
+ * optional .PlainTransfer plain_transfer = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder>
+ getPlainTransferFieldBuilder() {
+ if (plainTransferBuilder_ == null) {
+ if (!(dataCase_ == 2)) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ plainTransferBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_,
+ getParentForChildren(),
+ isClean());
+ data_ = null;
+ }
+ dataCase_ = 2;
+ onChanged();;
+ return plainTransferBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder> plainRedeemBuilder_;
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainRedeem() {
+ if (plainRedeemBuilder_ == null) {
+ if (dataCase_ == 3) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ } else {
+ if (dataCase_ == 3) {
+ return plainRedeemBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public Builder setPlainRedeem(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer value) {
+ if (plainRedeemBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ data_ = value;
+ onChanged();
+ } else {
+ plainRedeemBuilder_.setMessage(value);
+ }
+ dataCase_ = 3;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public Builder setPlainRedeem(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder builderForValue) {
+ if (plainRedeemBuilder_ == null) {
+ data_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainRedeemBuilder_.setMessage(builderForValue.build());
+ }
+ dataCase_ = 3;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public Builder mergePlainRedeem(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer value) {
+ if (plainRedeemBuilder_ == null) {
+ if (dataCase_ == 3 &&
+ data_ != org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance()) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ data_ = value;
+ }
+ onChanged();
+ } else {
+ if (dataCase_ == 3) {
+ plainRedeemBuilder_.mergeFrom(value);
+ }
+ plainRedeemBuilder_.setMessage(value);
+ }
+ dataCase_ = 3;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public Builder clearPlainRedeem() {
+ if (plainRedeemBuilder_ == null) {
+ if (dataCase_ == 3) {
+ dataCase_ = 0;
+ data_ = null;
+ onChanged();
+ }
+ } else {
+ if (dataCase_ == 3) {
+ dataCase_ = 0;
+ data_ = null;
+ }
+ plainRedeemBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder getPlainRedeemBuilder() {
+ return getPlainRedeemFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainRedeemOrBuilder() {
+ if ((dataCase_ == 3) && (plainRedeemBuilder_ != null)) {
+ return plainRedeemBuilder_.getMessageOrBuilder();
+ } else {
+ if (dataCase_ == 3) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token redeem transaction
+ *
+ *
+ * optional .PlainTransfer plain_redeem = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder>
+ getPlainRedeemFieldBuilder() {
+ if (plainRedeemBuilder_ == null) {
+ if (!(dataCase_ == 3)) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+ plainRedeemBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) data_,
+ getParentForChildren(),
+ isClean());
+ data_ = null;
+ }
+ dataCase_ = 3;
+ onChanged();;
+ return plainRedeemBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove, org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder> plainApproveBuilder_;
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApprove getPlainApprove() {
+ if (plainApproveBuilder_ == null) {
+ if (dataCase_ == 4) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ } else {
+ if (dataCase_ == 4) {
+ return plainApproveBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public Builder setPlainApprove(org.hyperledger.fabric.protos.token.Transaction.PlainApprove value) {
+ if (plainApproveBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ data_ = value;
+ onChanged();
+ } else {
+ plainApproveBuilder_.setMessage(value);
+ }
+ dataCase_ = 4;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public Builder setPlainApprove(
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder builderForValue) {
+ if (plainApproveBuilder_ == null) {
+ data_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainApproveBuilder_.setMessage(builderForValue.build());
+ }
+ dataCase_ = 4;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public Builder mergePlainApprove(org.hyperledger.fabric.protos.token.Transaction.PlainApprove value) {
+ if (plainApproveBuilder_ == null) {
+ if (dataCase_ == 4 &&
+ data_ != org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance()) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainApprove.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ data_ = value;
+ }
+ onChanged();
+ } else {
+ if (dataCase_ == 4) {
+ plainApproveBuilder_.mergeFrom(value);
+ }
+ plainApproveBuilder_.setMessage(value);
+ }
+ dataCase_ = 4;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public Builder clearPlainApprove() {
+ if (plainApproveBuilder_ == null) {
+ if (dataCase_ == 4) {
+ dataCase_ = 0;
+ data_ = null;
+ onChanged();
+ }
+ } else {
+ if (dataCase_ == 4) {
+ dataCase_ = 0;
+ data_ = null;
+ }
+ plainApproveBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder getPlainApproveBuilder() {
+ return getPlainApproveFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder getPlainApproveOrBuilder() {
+ if ((dataCase_ == 4) && (plainApproveBuilder_ != null)) {
+ return plainApproveBuilder_.getMessageOrBuilder();
+ } else {
+ if (dataCase_ == 4) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token approve transaction
+ *
+ *
+ * optional .PlainApprove plain_approve = 4;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove, org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder>
+ getPlainApproveFieldBuilder() {
+ if (plainApproveBuilder_ == null) {
+ if (!(dataCase_ == 4)) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ }
+ plainApproveBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove, org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) data_,
+ getParentForChildren(),
+ isClean());
+ data_ = null;
+ }
+ dataCase_ = 4;
+ onChanged();;
+ return plainApproveBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder> plainTransferFromBuilder_;
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom getPlainTransferFrom() {
+ if (plainTransferFromBuilder_ == null) {
+ if (dataCase_ == 5) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance();
+ } else {
+ if (dataCase_ == 5) {
+ return plainTransferFromBuilder_.getMessage();
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public Builder setPlainTransferFrom(org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom value) {
+ if (plainTransferFromBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ data_ = value;
+ onChanged();
+ } else {
+ plainTransferFromBuilder_.setMessage(value);
+ }
+ dataCase_ = 5;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public Builder setPlainTransferFrom(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder builderForValue) {
+ if (plainTransferFromBuilder_ == null) {
+ data_ = builderForValue.build();
+ onChanged();
+ } else {
+ plainTransferFromBuilder_.setMessage(builderForValue.build());
+ }
+ dataCase_ = 5;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public Builder mergePlainTransferFrom(org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom value) {
+ if (plainTransferFromBuilder_ == null) {
+ if (dataCase_ == 5 &&
+ data_ != org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance()) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ data_ = value;
+ }
+ onChanged();
+ } else {
+ if (dataCase_ == 5) {
+ plainTransferFromBuilder_.mergeFrom(value);
+ }
+ plainTransferFromBuilder_.setMessage(value);
+ }
+ dataCase_ = 5;
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public Builder clearPlainTransferFrom() {
+ if (plainTransferFromBuilder_ == null) {
+ if (dataCase_ == 5) {
+ dataCase_ = 0;
+ data_ = null;
+ onChanged();
+ }
+ } else {
+ if (dataCase_ == 5) {
+ dataCase_ = 0;
+ data_ = null;
+ }
+ plainTransferFromBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder getPlainTransferFromBuilder() {
+ return getPlainTransferFromFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder getPlainTransferFromOrBuilder() {
+ if ((dataCase_ == 5) && (plainTransferFromBuilder_ != null)) {
+ return plainTransferFromBuilder_.getMessageOrBuilder();
+ } else {
+ if (dataCase_ == 5) {
+ return (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_;
+ }
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ * A plaintext token transfer from transaction
+ *
+ *
+ * optional .PlainTransferFrom plain_transfer_From = 5;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder>
+ getPlainTransferFromFieldBuilder() {
+ if (plainTransferFromBuilder_ == null) {
+ if (!(dataCase_ == 5)) {
+ data_ = org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance();
+ }
+ plainTransferFromBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder>(
+ (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) data_,
+ getParentForChildren(),
+ isClean());
+ data_ = null;
+ }
+ dataCase_ = 5;
+ onChanged();;
+ return plainTransferFromBuilder_;
+ }
+ 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:PlainTokenAction)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainTokenAction)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainTokenAction parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainTokenAction(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.PlainTokenAction getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainImportOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainImport)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ java.util.List
+ getOutputsList();
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ int getOutputsCount();
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList();
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index);
+ }
+ /**
+ *
+ * PlainImport specifies an import of one or more tokens in plaintext format
+ *
+ *
+ * Protobuf type {@code PlainImport}
+ */
+ public static final class PlainImport extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainImport)
+ PlainImportOrBuilder {
+ // Use PlainImport.newBuilder() to construct.
+ private PlainImport(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainImport() {
+ outputs_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainImport(
+ 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.PlainOutput.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_PlainImport_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainImport_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport.class, org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder.class);
+ }
+
+ public static final int OUTPUTS_FIELD_NUMBER = 1;
+ private java.util.List outputs_;
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List getOutputsList() {
+ return outputs_;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ return outputs_;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public int getOutputsCount() {
+ return outputs_.size();
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ return outputs_.get(index);
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder 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.PlainImport)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport other = (org.hyperledger.fabric.protos.token.Transaction.PlainImport) 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.PlainImport parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainImport 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.PlainImport parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainImport 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.PlainImport 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.PlainImport 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.PlainImport 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.PlainImport 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.PlainImport 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.PlainImport 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.PlainImport 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;
+ }
+ /**
+ *
+ * PlainImport specifies an import of one or more tokens in plaintext format
+ *
+ *
+ * Protobuf type {@code PlainImport}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainImport)
+ org.hyperledger.fabric.protos.token.Transaction.PlainImportOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainImport_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainImport_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport.class, org.hyperledger.fabric.protos.token.Transaction.PlainImport.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainImport.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_PlainImport_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImport getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainImport.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImport build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainImport buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainImport result = new org.hyperledger.fabric.protos.token.Transaction.PlainImport(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.PlainImport) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainImport)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainImport other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainImport.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.PlainImport parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainImport) 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.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> outputsBuilder_;
+
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List getOutputsList() {
+ if (outputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(outputs_);
+ } else {
+ return outputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public int getOutputsCount() {
+ if (outputsBuilder_ == null) {
+ return outputs_.size();
+ } else {
+ return outputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index);
+ } else {
+ return outputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.set(index, value);
+ onChanged();
+ } else {
+ outputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.add(value);
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.add(index, value);
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder addAllOutputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> values) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, outputs_);
+ onChanged();
+ } else {
+ outputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder clearOutputs() {
+ if (outputsBuilder_ == null) {
+ outputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ outputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public Builder removeOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.remove(index);
+ onChanged();
+ } else {
+ outputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder getOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index); } else {
+ return outputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ if (outputsBuilder_ != null) {
+ return outputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(outputs_);
+ }
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder() {
+ return getOutputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * An import transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 1;
+ */
+ public java.util.List
+ getOutputsBuilderList() {
+ return getOutputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsFieldBuilder() {
+ if (outputsBuilder_ == null) {
+ outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>(
+ 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:PlainImport)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainImport)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainImport DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainImport();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainImport getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainImport parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainImport(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.PlainImport getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainTransferOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainTransfer)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ java.util.List
+ getInputsList();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index);
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ int getInputsCount();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index);
+
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ java.util.List
+ getOutputsList();
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ int getOutputsCount();
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList();
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index);
+ }
+ /**
+ *
+ * PlainTransfer specifies a transfer of one or more plaintext tokens to one or more outputs
+ *
+ *
+ * Protobuf type {@code PlainTransfer}
+ */
+ public static final class PlainTransfer extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainTransfer)
+ PlainTransferOrBuilder {
+ // Use PlainTransfer.newBuilder() to construct.
+ private PlainTransfer(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainTransfer() {
+ 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 PlainTransfer(
+ 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.InputId.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.PlainOutput.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_PlainTransfer_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransfer_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.class, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder.class);
+ }
+
+ public static final int INPUTS_FIELD_NUMBER = 1;
+ private java.util.List inputs_;
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List getInputsList() {
+ return inputs_;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList() {
+ return inputs_;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public int getInputsCount() {
+ return inputs_.size();
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {
+ return inputs_.get(index);
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index) {
+ return inputs_.get(index);
+ }
+
+ public static final int OUTPUTS_FIELD_NUMBER = 2;
+ private java.util.List outputs_;
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List getOutputsList() {
+ return outputs_;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ return outputs_;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public int getOutputsCount() {
+ return outputs_.size();
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ return outputs_.get(index);
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder 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.PlainTransfer)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer other = (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) 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.PlainTransfer parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransfer 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.PlainTransfer parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransfer 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.PlainTransfer 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.PlainTransfer 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.PlainTransfer 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.PlainTransfer 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.PlainTransfer 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.PlainTransfer 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.PlainTransfer 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;
+ }
+ /**
+ *
+ * PlainTransfer specifies a transfer of one or more plaintext tokens to one or more outputs
+ *
+ *
+ * Protobuf type {@code PlainTransfer}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainTransfer)
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransfer_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransfer_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.class, org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.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_PlainTransfer_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransfer buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransfer result = new org.hyperledger.fabric.protos.token.Transaction.PlainTransfer(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.PlainTransfer) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTransfer)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainTransfer other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainTransfer.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.PlainTransfer parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainTransfer) 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.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder> inputsBuilder_;
+
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List getInputsList() {
+ if (inputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(inputs_);
+ } else {
+ return inputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public int getInputsCount() {
+ if (inputsBuilder_ == null) {
+ return inputs_.size();
+ } else {
+ return inputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {
+ if (inputsBuilder_ == null) {
+ return inputs_.get(index);
+ } else {
+ return inputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder setInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.set(index, value);
+ onChanged();
+ } else {
+ inputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder setInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.add(value);
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.add(index, value);
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addAllInputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.InputId> values) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, inputs_);
+ onChanged();
+ } else {
+ inputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder clearInputs() {
+ if (inputsBuilder_ == null) {
+ inputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ inputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder removeInputs(int index) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.remove(index);
+ onChanged();
+ } else {
+ inputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(
+ int index) {
+ return getInputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index) {
+ if (inputsBuilder_ == null) {
+ return inputs_.get(index); } else {
+ return inputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList() {
+ if (inputsBuilder_ != null) {
+ return inputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(inputs_);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder() {
+ return getInputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(
+ int index) {
+ return getInputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List
+ getInputsBuilderList() {
+ return getInputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsFieldBuilder() {
+ if (inputsBuilder_ == null) {
+ inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>(
+ 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.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> outputsBuilder_;
+
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List getOutputsList() {
+ if (outputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(outputs_);
+ } else {
+ return outputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public int getOutputsCount() {
+ if (outputsBuilder_ == null) {
+ return outputs_.size();
+ } else {
+ return outputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index);
+ } else {
+ return outputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.set(index, value);
+ onChanged();
+ } else {
+ outputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.add(value);
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.add(index, value);
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addAllOutputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> values) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, outputs_);
+ onChanged();
+ } else {
+ outputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder clearOutputs() {
+ if (outputsBuilder_ == null) {
+ outputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ } else {
+ outputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder removeOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.remove(index);
+ onChanged();
+ } else {
+ outputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder getOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index); } else {
+ return outputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ if (outputsBuilder_ != null) {
+ return outputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(outputs_);
+ }
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder() {
+ return getOutputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * A transfer transaction may contain one or more outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List
+ getOutputsBuilderList() {
+ return getOutputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsFieldBuilder() {
+ if (outputsBuilder_ == null) {
+ outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>(
+ 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:PlainTransfer)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainTransfer)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainTransfer DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainTransfer();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainTransfer parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainTransfer(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.PlainTransfer getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainApproveOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainApprove)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ java.util.List
+ getInputsList();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index);
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ int getInputsCount();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index);
+
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ java.util.List
+ getDelegatedOutputsList();
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ int getDelegatedOutputsCount();
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>
+ getDelegatedOutputsOrBuilderList();
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputsOrBuilder(
+ int index);
+
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ boolean hasOutput();
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();
+ }
+ /**
+ *
+ * PlainApprove specifies an approve of one or more tokens in plaintext format
+ *
+ *
+ * Protobuf type {@code PlainApprove}
+ */
+ public static final class PlainApprove extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainApprove)
+ PlainApproveOrBuilder {
+ // Use PlainApprove.newBuilder() to construct.
+ private PlainApprove(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainApprove() {
+ inputs_ = java.util.Collections.emptyList();
+ delegatedOutputs_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainApprove(
+ 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.InputId.parser(), extensionRegistry));
+ break;
+ }
+ case 18: {
+ if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatedOutputs_ = new java.util.ArrayList();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ delegatedOutputs_.add(
+ input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.parser(), extensionRegistry));
+ break;
+ }
+ case 26: {
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder subBuilder = null;
+ if (output_ != null) {
+ subBuilder = output_.toBuilder();
+ }
+ output_ = input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainOutput.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(output_);
+ output_ = subBuilder.buildPartial();
+ }
+
+ 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)) {
+ delegatedOutputs_ = java.util.Collections.unmodifiableList(delegatedOutputs_);
+ }
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainApprove_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainApprove_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove.class, org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int INPUTS_FIELD_NUMBER = 1;
+ private java.util.List inputs_;
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List getInputsList() {
+ return inputs_;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList() {
+ return inputs_;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public int getInputsCount() {
+ return inputs_.size();
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {
+ return inputs_.get(index);
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index) {
+ return inputs_.get(index);
+ }
+
+ public static final int DELEGATED_OUTPUTS_FIELD_NUMBER = 2;
+ private java.util.List delegatedOutputs_;
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public java.util.List getDelegatedOutputsList() {
+ return delegatedOutputs_;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>
+ getDelegatedOutputsOrBuilderList() {
+ return delegatedOutputs_;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public int getDelegatedOutputsCount() {
+ return delegatedOutputs_.size();
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index) {
+ return delegatedOutputs_.get(index);
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputsOrBuilder(
+ int index) {
+ return delegatedOutputs_.get(index);
+ }
+
+ public static final int OUTPUT_FIELD_NUMBER = 3;
+ private org.hyperledger.fabric.protos.token.Transaction.PlainOutput output_;
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public boolean hasOutput() {
+ return output_ != null;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput() {
+ return output_ == null ? org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance() : output_;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder() {
+ return getOutput();
+ }
+
+ 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 < delegatedOutputs_.size(); i++) {
+ output.writeMessage(2, delegatedOutputs_.get(i));
+ }
+ if (output_ != null) {
+ output.writeMessage(3, getOutput());
+ }
+ }
+
+ 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 < delegatedOutputs_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, delegatedOutputs_.get(i));
+ }
+ if (output_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getOutput());
+ }
+ 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.PlainApprove)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove other = (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) obj;
+
+ boolean result = true;
+ result = result && getInputsList()
+ .equals(other.getInputsList());
+ result = result && getDelegatedOutputsList()
+ .equals(other.getDelegatedOutputsList());
+ result = result && (hasOutput() == other.hasOutput());
+ if (hasOutput()) {
+ result = result && getOutput()
+ .equals(other.getOutput());
+ }
+ 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 (getDelegatedOutputsCount() > 0) {
+ hash = (37 * hash) + DELEGATED_OUTPUTS_FIELD_NUMBER;
+ hash = (53 * hash) + getDelegatedOutputsList().hashCode();
+ }
+ if (hasOutput()) {
+ hash = (37 * hash) + OUTPUT_FIELD_NUMBER;
+ hash = (53 * hash) + getOutput().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainApprove parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainApprove 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.PlainApprove parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainApprove 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.PlainApprove 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.PlainApprove 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.PlainApprove 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.PlainApprove 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.PlainApprove 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.PlainApprove 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.PlainApprove 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;
+ }
+ /**
+ *
+ * PlainApprove specifies an approve of one or more tokens in plaintext format
+ *
+ *
+ * Protobuf type {@code PlainApprove}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainApprove)
+ org.hyperledger.fabric.protos.token.Transaction.PlainApproveOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainApprove_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainApprove_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove.class, org.hyperledger.fabric.protos.token.Transaction.PlainApprove.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainApprove.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();
+ getDelegatedOutputsFieldBuilder();
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ if (inputsBuilder_ == null) {
+ inputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ inputsBuilder_.clear();
+ }
+ if (delegatedOutputsBuilder_ == null) {
+ delegatedOutputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ delegatedOutputsBuilder_.clear();
+ }
+ if (outputBuilder_ == null) {
+ output_ = null;
+ } else {
+ output_ = null;
+ outputBuilder_ = null;
+ }
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainApprove_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApprove getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainApprove.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApprove build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainApprove buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainApprove result = new org.hyperledger.fabric.protos.token.Transaction.PlainApprove(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ 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 (delegatedOutputsBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatedOutputs_ = java.util.Collections.unmodifiableList(delegatedOutputs_);
+ bitField0_ = (bitField0_ & ~0x00000002);
+ }
+ result.delegatedOutputs_ = delegatedOutputs_;
+ } else {
+ result.delegatedOutputs_ = delegatedOutputsBuilder_.build();
+ }
+ if (outputBuilder_ == null) {
+ result.output_ = output_;
+ } else {
+ result.output_ = outputBuilder_.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.Transaction.PlainApprove) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainApprove)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainApprove other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainApprove.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 (delegatedOutputsBuilder_ == null) {
+ if (!other.delegatedOutputs_.isEmpty()) {
+ if (delegatedOutputs_.isEmpty()) {
+ delegatedOutputs_ = other.delegatedOutputs_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.addAll(other.delegatedOutputs_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.delegatedOutputs_.isEmpty()) {
+ if (delegatedOutputsBuilder_.isEmpty()) {
+ delegatedOutputsBuilder_.dispose();
+ delegatedOutputsBuilder_ = null;
+ delegatedOutputs_ = other.delegatedOutputs_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ delegatedOutputsBuilder_ =
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+ getDelegatedOutputsFieldBuilder() : null;
+ } else {
+ delegatedOutputsBuilder_.addAllMessages(other.delegatedOutputs_);
+ }
+ }
+ }
+ if (other.hasOutput()) {
+ mergeOutput(other.getOutput());
+ }
+ 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.PlainApprove parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainApprove) 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.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder> inputsBuilder_;
+
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List getInputsList() {
+ if (inputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(inputs_);
+ } else {
+ return inputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public int getInputsCount() {
+ if (inputsBuilder_ == null) {
+ return inputs_.size();
+ } else {
+ return inputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {
+ if (inputsBuilder_ == null) {
+ return inputs_.get(index);
+ } else {
+ return inputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder setInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.set(index, value);
+ onChanged();
+ } else {
+ inputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder setInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.add(value);
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.add(index, value);
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addAllInputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.InputId> values) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, inputs_);
+ onChanged();
+ } else {
+ inputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder clearInputs() {
+ if (inputsBuilder_ == null) {
+ inputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ inputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder removeInputs(int index) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.remove(index);
+ onChanged();
+ } else {
+ inputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(
+ int index) {
+ return getInputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index) {
+ if (inputsBuilder_ == null) {
+ return inputs_.get(index); } else {
+ return inputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList() {
+ if (inputsBuilder_ != null) {
+ return inputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(inputs_);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder() {
+ return getInputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(
+ int index) {
+ return getInputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List
+ getInputsBuilderList() {
+ return getInputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsFieldBuilder() {
+ if (inputsBuilder_ == null) {
+ inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>(
+ inputs_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
+ getParentForChildren(),
+ isClean());
+ inputs_ = null;
+ }
+ return inputsBuilder_;
+ }
+
+ private java.util.List delegatedOutputs_ =
+ java.util.Collections.emptyList();
+ private void ensureDelegatedOutputsIsMutable() {
+ if (!((bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatedOutputs_ = new java.util.ArrayList(delegatedOutputs_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder> delegatedOutputsBuilder_;
+
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public java.util.List getDelegatedOutputsList() {
+ if (delegatedOutputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(delegatedOutputs_);
+ } else {
+ return delegatedOutputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public int getDelegatedOutputsCount() {
+ if (delegatedOutputsBuilder_ == null) {
+ return delegatedOutputs_.size();
+ } else {
+ return delegatedOutputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index) {
+ if (delegatedOutputsBuilder_ == null) {
+ return delegatedOutputs_.get(index);
+ } else {
+ return delegatedOutputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder setDelegatedOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput value) {
+ if (delegatedOutputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.set(index, value);
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder setDelegatedOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder builderForValue) {
+ if (delegatedOutputsBuilder_ == null) {
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder addDelegatedOutputs(org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput value) {
+ if (delegatedOutputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.add(value);
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder addDelegatedOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput value) {
+ if (delegatedOutputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.add(index, value);
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder addDelegatedOutputs(
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder builderForValue) {
+ if (delegatedOutputsBuilder_ == null) {
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder addDelegatedOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder builderForValue) {
+ if (delegatedOutputsBuilder_ == null) {
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder addAllDelegatedOutputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput> values) {
+ if (delegatedOutputsBuilder_ == null) {
+ ensureDelegatedOutputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, delegatedOutputs_);
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder clearDelegatedOutputs() {
+ if (delegatedOutputsBuilder_ == null) {
+ delegatedOutputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public Builder removeDelegatedOutputs(int index) {
+ if (delegatedOutputsBuilder_ == null) {
+ ensureDelegatedOutputsIsMutable();
+ delegatedOutputs_.remove(index);
+ onChanged();
+ } else {
+ delegatedOutputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder getDelegatedOutputsBuilder(
+ int index) {
+ return getDelegatedOutputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputsOrBuilder(
+ int index) {
+ if (delegatedOutputsBuilder_ == null) {
+ return delegatedOutputs_.get(index); } else {
+ return delegatedOutputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>
+ getDelegatedOutputsOrBuilderList() {
+ if (delegatedOutputsBuilder_ != null) {
+ return delegatedOutputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(delegatedOutputs_);
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder addDelegatedOutputsBuilder() {
+ return getDelegatedOutputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder addDelegatedOutputsBuilder(
+ int index) {
+ return getDelegatedOutputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * An approve transaction contains one or more plain delegated outputs
+ *
+ *
+ * repeated .PlainDelegatedOutput delegated_outputs = 2;
+ */
+ public java.util.List
+ getDelegatedOutputsBuilderList() {
+ return getDelegatedOutputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>
+ getDelegatedOutputsFieldBuilder() {
+ if (delegatedOutputsBuilder_ == null) {
+ delegatedOutputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>(
+ delegatedOutputs_,
+ ((bitField0_ & 0x00000002) == 0x00000002),
+ getParentForChildren(),
+ isClean());
+ delegatedOutputs_ = null;
+ }
+ return delegatedOutputsBuilder_;
+ }
+
+ private org.hyperledger.fabric.protos.token.Transaction.PlainOutput output_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> outputBuilder_;
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public boolean hasOutput() {
+ return outputBuilder_ != null || output_ != null;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput() {
+ if (outputBuilder_ == null) {
+ return output_ == null ? org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance() : output_;
+ } else {
+ return outputBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public Builder setOutput(org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ output_ = value;
+ onChanged();
+ } else {
+ outputBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public Builder setOutput(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputBuilder_ == null) {
+ output_ = builderForValue.build();
+ onChanged();
+ } else {
+ outputBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public Builder mergeOutput(org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputBuilder_ == null) {
+ if (output_ != null) {
+ output_ =
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.newBuilder(output_).mergeFrom(value).buildPartial();
+ } else {
+ output_ = value;
+ }
+ onChanged();
+ } else {
+ outputBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public Builder clearOutput() {
+ if (outputBuilder_ == null) {
+ output_ = null;
+ onChanged();
+ } else {
+ output_ = null;
+ outputBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder getOutputBuilder() {
+
+ onChanged();
+ return getOutputFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder() {
+ if (outputBuilder_ != null) {
+ return outputBuilder_.getMessageOrBuilder();
+ } else {
+ return output_ == null ?
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance() : output_;
+ }
+ }
+ /**
+ *
+ * An approve transaction contains one plain output
+ *
+ *
+ * optional .PlainOutput output = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputFieldBuilder() {
+ if (outputBuilder_ == null) {
+ outputBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>(
+ getOutput(),
+ getParentForChildren(),
+ isClean());
+ output_ = null;
+ }
+ return outputBuilder_;
+ }
+ 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:PlainApprove)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainApprove)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainApprove DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainApprove();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainApprove getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainApprove parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainApprove(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.PlainApprove getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainTransferFromOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainTransferFrom)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ java.util.List
+ getInputsList();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index);
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ int getInputsCount();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList();
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index);
+
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ java.util.List
+ getOutputsList();
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ int getOutputsCount();
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList();
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index);
+
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ boolean hasDelegatedOutput();
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();
+ }
+ /**
+ *
+ * PlainTransferFrom specifies a transfer of one or more plaintext delegated tokens to one or more outputs
+ * an to a delegated output
+ *
+ *
+ * Protobuf type {@code PlainTransferFrom}
+ */
+ public static final class PlainTransferFrom extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainTransferFrom)
+ PlainTransferFromOrBuilder {
+ // Use PlainTransferFrom.newBuilder() to construct.
+ private PlainTransferFrom(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainTransferFrom() {
+ 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 PlainTransferFrom(
+ 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.InputId.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.PlainOutput.parser(), extensionRegistry));
+ break;
+ }
+ case 26: {
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder subBuilder = null;
+ if (delegatedOutput_ != null) {
+ subBuilder = delegatedOutput_.toBuilder();
+ }
+ delegatedOutput_ = input.readMessage(org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(delegatedOutput_);
+ delegatedOutput_ = subBuilder.buildPartial();
+ }
+
+ 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_PlainTransferFrom_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransferFrom_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.class, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int INPUTS_FIELD_NUMBER = 1;
+ private java.util.List inputs_;
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List getInputsList() {
+ return inputs_;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList() {
+ return inputs_;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public int getInputsCount() {
+ return inputs_.size();
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {
+ return inputs_.get(index);
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index) {
+ return inputs_.get(index);
+ }
+
+ public static final int OUTPUTS_FIELD_NUMBER = 2;
+ private java.util.List outputs_;
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List getOutputsList() {
+ return outputs_;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ return outputs_;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public int getOutputsCount() {
+ return outputs_.size();
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ return outputs_.get(index);
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index) {
+ return outputs_.get(index);
+ }
+
+ public static final int DELEGATED_OUTPUT_FIELD_NUMBER = 3;
+ private org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput delegatedOutput_;
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public boolean hasDelegatedOutput() {
+ return delegatedOutput_ != null;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput() {
+ return delegatedOutput_ == null ? org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance() : delegatedOutput_;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder() {
+ return getDelegatedOutput();
+ }
+
+ 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));
+ }
+ if (delegatedOutput_ != null) {
+ output.writeMessage(3, getDelegatedOutput());
+ }
+ }
+
+ 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));
+ }
+ if (delegatedOutput_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getDelegatedOutput());
+ }
+ 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.PlainTransferFrom)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom other = (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) obj;
+
+ boolean result = true;
+ result = result && getInputsList()
+ .equals(other.getInputsList());
+ result = result && getOutputsList()
+ .equals(other.getOutputsList());
+ result = result && (hasDelegatedOutput() == other.hasDelegatedOutput());
+ if (hasDelegatedOutput()) {
+ result = result && getDelegatedOutput()
+ .equals(other.getDelegatedOutput());
+ }
+ 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();
+ }
+ if (hasDelegatedOutput()) {
+ hash = (37 * hash) + DELEGATED_OUTPUT_FIELD_NUMBER;
+ hash = (53 * hash) + getDelegatedOutput().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom 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.PlainTransferFrom parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom 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.PlainTransferFrom 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.PlainTransferFrom 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.PlainTransferFrom 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.PlainTransferFrom 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.PlainTransferFrom 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.PlainTransferFrom 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.PlainTransferFrom 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;
+ }
+ /**
+ *
+ * PlainTransferFrom specifies a transfer of one or more plaintext delegated tokens to one or more outputs
+ * an to a delegated output
+ *
+ *
+ * Protobuf type {@code PlainTransferFrom}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainTransferFrom)
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransferFrom_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransferFrom_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.class, org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.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();
+ }
+ if (delegatedOutputBuilder_ == null) {
+ delegatedOutput_ = null;
+ } else {
+ delegatedOutput_ = null;
+ delegatedOutputBuilder_ = null;
+ }
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainTransferFrom_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom result = new org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ 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();
+ }
+ if (delegatedOutputBuilder_ == null) {
+ result.delegatedOutput_ = delegatedOutput_;
+ } else {
+ result.delegatedOutput_ = delegatedOutputBuilder_.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.Transaction.PlainTransferFrom) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom.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_);
+ }
+ }
+ }
+ if (other.hasDelegatedOutput()) {
+ mergeDelegatedOutput(other.getDelegatedOutput());
+ }
+ 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.PlainTransferFrom parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom) 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.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder> inputsBuilder_;
+
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List getInputsList() {
+ if (inputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(inputs_);
+ } else {
+ return inputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public int getInputsCount() {
+ if (inputsBuilder_ == null) {
+ return inputs_.size();
+ } else {
+ return inputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {
+ if (inputsBuilder_ == null) {
+ return inputs_.get(index);
+ } else {
+ return inputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder setInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.set(index, value);
+ onChanged();
+ } else {
+ inputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder setInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.add(value);
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {
+ if (inputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInputsIsMutable();
+ inputs_.add(index, value);
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addInputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder builderForValue) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ inputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder addAllInputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.InputId> values) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, inputs_);
+ onChanged();
+ } else {
+ inputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder clearInputs() {
+ if (inputsBuilder_ == null) {
+ inputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ inputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public Builder removeInputs(int index) {
+ if (inputsBuilder_ == null) {
+ ensureInputsIsMutable();
+ inputs_.remove(index);
+ onChanged();
+ } else {
+ inputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(
+ int index) {
+ return getInputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(
+ int index) {
+ if (inputsBuilder_ == null) {
+ return inputs_.get(index); } else {
+ return inputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsOrBuilderList() {
+ if (inputsBuilder_ != null) {
+ return inputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(inputs_);
+ }
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder() {
+ return getInputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(
+ int index) {
+ return getInputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());
+ }
+ /**
+ *
+ * The inputs to the transfer transaction are specified by their ID
+ *
+ *
+ * repeated .InputId inputs = 1;
+ */
+ public java.util.List
+ getInputsBuilderList() {
+ return getInputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>
+ getInputsFieldBuilder() {
+ if (inputsBuilder_ == null) {
+ inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.InputId, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder, org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder>(
+ 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.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> outputsBuilder_;
+
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List getOutputsList() {
+ if (outputsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(outputs_);
+ } else {
+ return outputsBuilder_.getMessageList();
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public int getOutputsCount() {
+ if (outputsBuilder_ == null) {
+ return outputs_.size();
+ } else {
+ return outputsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index);
+ } else {
+ return outputsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.set(index, value);
+ onChanged();
+ } else {
+ outputsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder setOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.add(value);
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput value) {
+ if (outputsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOutputsIsMutable();
+ outputs_.add(index, value);
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addOutputs(
+ int index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder builderForValue) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ outputsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder addAllOutputs(
+ java.lang.Iterable extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> values) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, outputs_);
+ onChanged();
+ } else {
+ outputsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder clearOutputs() {
+ if (outputsBuilder_ == null) {
+ outputs_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ } else {
+ outputsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public Builder removeOutputs(int index) {
+ if (outputsBuilder_ == null) {
+ ensureOutputsIsMutable();
+ outputs_.remove(index);
+ onChanged();
+ } else {
+ outputsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder getOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(
+ int index) {
+ if (outputsBuilder_ == null) {
+ return outputs_.get(index); } else {
+ return outputsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsOrBuilderList() {
+ if (outputsBuilder_ != null) {
+ return outputsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(outputs_);
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder() {
+ return getOutputsFieldBuilder().addBuilder(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder addOutputsBuilder(
+ int index) {
+ return getOutputsFieldBuilder().addBuilder(
+ index, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance());
+ }
+ /**
+ *
+ * A transferFrom transaction contains multiple outputs
+ *
+ *
+ * repeated .PlainOutput outputs = 2;
+ */
+ public java.util.List
+ getOutputsBuilderList() {
+ return getOutputsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>
+ getOutputsFieldBuilder() {
+ if (outputsBuilder_ == null) {
+ outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder>(
+ outputs_,
+ ((bitField0_ & 0x00000002) == 0x00000002),
+ getParentForChildren(),
+ isClean());
+ outputs_ = null;
+ }
+ return outputsBuilder_;
+ }
+
+ private org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput delegatedOutput_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder> delegatedOutputBuilder_;
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public boolean hasDelegatedOutput() {
+ return delegatedOutputBuilder_ != null || delegatedOutput_ != null;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput() {
+ if (delegatedOutputBuilder_ == null) {
+ return delegatedOutput_ == null ? org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance() : delegatedOutput_;
+ } else {
+ return delegatedOutputBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public Builder setDelegatedOutput(org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput value) {
+ if (delegatedOutputBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ delegatedOutput_ = value;
+ onChanged();
+ } else {
+ delegatedOutputBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public Builder setDelegatedOutput(
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder builderForValue) {
+ if (delegatedOutputBuilder_ == null) {
+ delegatedOutput_ = builderForValue.build();
+ onChanged();
+ } else {
+ delegatedOutputBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public Builder mergeDelegatedOutput(org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput value) {
+ if (delegatedOutputBuilder_ == null) {
+ if (delegatedOutput_ != null) {
+ delegatedOutput_ =
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.newBuilder(delegatedOutput_).mergeFrom(value).buildPartial();
+ } else {
+ delegatedOutput_ = value;
+ }
+ onChanged();
+ } else {
+ delegatedOutputBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public Builder clearDelegatedOutput() {
+ if (delegatedOutputBuilder_ == null) {
+ delegatedOutput_ = null;
+ onChanged();
+ } else {
+ delegatedOutput_ = null;
+ delegatedOutputBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder getDelegatedOutputBuilder() {
+
+ onChanged();
+ return getDelegatedOutputFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder() {
+ if (delegatedOutputBuilder_ != null) {
+ return delegatedOutputBuilder_.getMessageOrBuilder();
+ } else {
+ return delegatedOutput_ == null ?
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance() : delegatedOutput_;
+ }
+ }
+ /**
+ *
+ * A transferFrom transaction may contain one delegatable output
+ *
+ *
+ * optional .PlainDelegatedOutput delegated_output = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>
+ getDelegatedOutputFieldBuilder() {
+ if (delegatedOutputBuilder_ == null) {
+ delegatedOutputBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder>(
+ getDelegatedOutput(),
+ getParentForChildren(),
+ isClean());
+ delegatedOutput_ = null;
+ }
+ return delegatedOutputBuilder_;
+ }
+ 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:PlainTransferFrom)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainTransferFrom)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainTransferFrom parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainTransferFrom(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.PlainTransferFrom getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainOutputOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainOutput)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ com.google.protobuf.ByteString getOwner();
+
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 2;
+ */
+ java.lang.String getType();
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 2;
+ */
+ com.google.protobuf.ByteString
+ getTypeBytes();
+
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 3;
+ */
+ long getQuantity();
+ }
+ /**
+ *
+ * A PlainOutput is the result of import and transfer transactions using plaintext tokens
+ *
+ *
+ * Protobuf type {@code PlainOutput}
+ */
+ public static final class PlainOutput extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainOutput)
+ PlainOutputOrBuilder {
+ // Use PlainOutput.newBuilder() to construct.
+ private PlainOutput(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainOutput() {
+ owner_ = com.google.protobuf.ByteString.EMPTY;
+ type_ = "";
+ quantity_ = 0L;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainOutput(
+ 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: {
+
+ owner_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ type_ = s;
+ break;
+ }
+ case 24: {
+
+ quantity_ = input.readUInt64();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainOutput_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainOutput_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.class, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder.class);
+ }
+
+ public static final int OWNER_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString owner_;
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public com.google.protobuf.ByteString getOwner() {
+ return owner_;
+ }
+
+ public static final int TYPE_FIELD_NUMBER = 2;
+ private volatile java.lang.Object type_;
+ /**
+ *
+ * The token type
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * 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 long quantity_;
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 3;
+ */
+ public long getQuantity() {
+ return quantity_;
+ }
+
+ 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_.isEmpty()) {
+ output.writeBytes(1, owner_);
+ }
+ if (!getTypeBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_);
+ }
+ if (quantity_ != 0L) {
+ output.writeUInt64(3, quantity_);
+ }
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!owner_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, owner_);
+ }
+ if (!getTypeBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_);
+ }
+ if (quantity_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(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.PlainOutput)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput other = (org.hyperledger.fabric.protos.token.Transaction.PlainOutput) obj;
+
+ boolean result = true;
+ result = result && getOwner()
+ .equals(other.getOwner());
+ result = result && getType()
+ .equals(other.getType());
+ result = result && (getQuantity()
+ == other.getQuantity());
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ 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) + com.google.protobuf.Internal.hashLong(
+ getQuantity());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainOutput parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainOutput 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.PlainOutput parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainOutput 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.PlainOutput 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.PlainOutput 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.PlainOutput 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.PlainOutput 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.PlainOutput 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.PlainOutput 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.PlainOutput 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 PlainOutput is the result of import and transfer transactions using plaintext tokens
+ *
+ *
+ * Protobuf type {@code PlainOutput}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainOutput)
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainOutput_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainOutput_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput.class, org.hyperledger.fabric.protos.token.Transaction.PlainOutput.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainOutput.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();
+ owner_ = com.google.protobuf.ByteString.EMPTY;
+
+ type_ = "";
+
+ quantity_ = 0L;
+
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainOutput_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainOutput buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainOutput result = new org.hyperledger.fabric.protos.token.Transaction.PlainOutput(this);
+ result.owner_ = owner_;
+ 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.PlainOutput) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainOutput)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainOutput other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainOutput.getDefaultInstance()) return this;
+ if (other.getOwner() != com.google.protobuf.ByteString.EMPTY) {
+ setOwner(other.getOwner());
+ }
+ if (!other.getType().isEmpty()) {
+ type_ = other.type_;
+ onChanged();
+ }
+ if (other.getQuantity() != 0L) {
+ setQuantity(other.getQuantity());
+ }
+ 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.PlainOutput parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainOutput) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+
+ private com.google.protobuf.ByteString owner_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public com.google.protobuf.ByteString getOwner() {
+ return owner_;
+ }
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public Builder setOwner(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ owner_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public Builder clearOwner() {
+
+ owner_ = getDefaultInstance().getOwner();
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object type_ = "";
+ /**
+ *
+ * The token type
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 2;
+ */
+ public Builder setType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 2;
+ */
+ public Builder clearType() {
+
+ type_ = getDefaultInstance().getType();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * 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 long quantity_ ;
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 3;
+ */
+ public long getQuantity() {
+ return quantity_;
+ }
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 3;
+ */
+ public Builder setQuantity(long value) {
+
+ quantity_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 3;
+ */
+ public Builder clearQuantity() {
+
+ quantity_ = 0L;
+ 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:PlainOutput)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainOutput)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainOutput DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainOutput();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainOutput getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainOutput parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainOutput(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.PlainOutput getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface InputIdOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:InputId)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * optional string tx_id = 1;
+ */
+ java.lang.String getTxId();
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * optional string tx_id = 1;
+ */
+ com.google.protobuf.ByteString
+ getTxIdBytes();
+
+ /**
+ *
+ * The index of the output in the transaction
+ *
+ *
+ * optional uint32 index = 2;
+ */
+ int getIndex();
+ }
+ /**
+ *
+ * An InputId specifies an output using the transaction ID and the index of the output in the transaction
+ *
+ *
+ * Protobuf type {@code InputId}
+ */
+ public static final class InputId extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:InputId)
+ InputIdOrBuilder {
+ // Use InputId.newBuilder() to construct.
+ private InputId(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private InputId() {
+ txId_ = "";
+ index_ = 0;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private InputId(
+ 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_InputId_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_InputId_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.class, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder.class);
+ }
+
+ public static final int TX_ID_FIELD_NUMBER = 1;
+ private volatile java.lang.Object txId_;
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * 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_;
+ /**
+ *
+ * The index of the output in the transaction
+ *
+ *
+ * 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.InputId)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.InputId other = (org.hyperledger.fabric.protos.token.Transaction.InputId) 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.InputId parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.InputId 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.InputId parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.InputId 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.InputId 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.InputId 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.InputId 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.InputId 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.InputId 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.InputId 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.InputId prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * An InputId specifies an output using the transaction ID and the index of the output in the transaction
+ *
+ *
+ * Protobuf type {@code InputId}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:InputId)
+ org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_InputId_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_InputId_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.InputId.class, org.hyperledger.fabric.protos.token.Transaction.InputId.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.InputId.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_InputId_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.InputId getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.InputId build() {
+ org.hyperledger.fabric.protos.token.Transaction.InputId result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.InputId buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.InputId result = new org.hyperledger.fabric.protos.token.Transaction.InputId(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.InputId) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.InputId)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.InputId other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.InputId.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.InputId parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.InputId) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+
+ private java.lang.Object txId_ = "";
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * optional string tx_id = 1;
+ */
+ public Builder setTxId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ txId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * optional string tx_id = 1;
+ */
+ public Builder clearTxId() {
+
+ txId_ = getDefaultInstance().getTxId();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The transaction ID
+ *
+ *
+ * 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_ ;
+ /**
+ *
+ * The index of the output in the transaction
+ *
+ *
+ * optional uint32 index = 2;
+ */
+ public int getIndex() {
+ return index_;
+ }
+ /**
+ *
+ * The index of the output in the transaction
+ *
+ *
+ * optional uint32 index = 2;
+ */
+ public Builder setIndex(int value) {
+
+ index_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The index of the output in the transaction
+ *
+ *
+ * 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:InputId)
+ }
+
+ // @@protoc_insertion_point(class_scope:InputId)
+ private static final org.hyperledger.fabric.protos.token.Transaction.InputId DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.InputId();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.InputId getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public InputId parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new InputId(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.InputId getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PlainDelegatedOutputOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:PlainDelegatedOutput)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ com.google.protobuf.ByteString getOwner();
+
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ java.util.List getDelegateesList();
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ int getDelegateesCount();
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ com.google.protobuf.ByteString getDelegatees(int index);
+
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ java.lang.String getType();
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ com.google.protobuf.ByteString
+ getTypeBytes();
+
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 4;
+ */
+ long getQuantity();
+ }
+ /**
+ *
+ * A PlainDelegatedOutput is the result of approve transactions using plaintext tokens
+ *
+ *
+ * Protobuf type {@code PlainDelegatedOutput}
+ */
+ public static final class PlainDelegatedOutput extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:PlainDelegatedOutput)
+ PlainDelegatedOutputOrBuilder {
+ // Use PlainDelegatedOutput.newBuilder() to construct.
+ private PlainDelegatedOutput(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PlainDelegatedOutput() {
+ owner_ = com.google.protobuf.ByteString.EMPTY;
+ delegatees_ = java.util.Collections.emptyList();
+ type_ = "";
+ quantity_ = 0L;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
+ }
+ private PlainDelegatedOutput(
+ 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: {
+
+ owner_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatees_ = new java.util.ArrayList();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ delegatees_.add(input.readBytes());
+ break;
+ }
+ case 26: {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ type_ = s;
+ break;
+ }
+ case 32: {
+
+ quantity_ = input.readUInt64();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatees_ = java.util.Collections.unmodifiableList(delegatees_);
+ }
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainDelegatedOutput_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainDelegatedOutput_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.class, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int OWNER_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString owner_;
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public com.google.protobuf.ByteString getOwner() {
+ return owner_;
+ }
+
+ public static final int DELEGATEES_FIELD_NUMBER = 2;
+ private java.util.List delegatees_;
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public java.util.List
+ getDelegateesList() {
+ return delegatees_;
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public int getDelegateesCount() {
+ return delegatees_.size();
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public com.google.protobuf.ByteString getDelegatees(int index) {
+ return delegatees_.get(index);
+ }
+
+ public static final int TYPE_FIELD_NUMBER = 3;
+ private volatile java.lang.Object type_;
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ 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;
+ }
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ 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 = 4;
+ private long quantity_;
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 4;
+ */
+ public long getQuantity() {
+ return quantity_;
+ }
+
+ 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_.isEmpty()) {
+ output.writeBytes(1, owner_);
+ }
+ for (int i = 0; i < delegatees_.size(); i++) {
+ output.writeBytes(2, delegatees_.get(i));
+ }
+ if (!getTypeBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_);
+ }
+ if (quantity_ != 0L) {
+ output.writeUInt64(4, quantity_);
+ }
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!owner_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, owner_);
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < delegatees_.size(); i++) {
+ dataSize += com.google.protobuf.CodedOutputStream
+ .computeBytesSizeNoTag(delegatees_.get(i));
+ }
+ size += dataSize;
+ size += 1 * getDelegateesList().size();
+ }
+ if (!getTypeBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_);
+ }
+ if (quantity_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(4, 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.PlainDelegatedOutput)) {
+ return super.equals(obj);
+ }
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput other = (org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput) obj;
+
+ boolean result = true;
+ result = result && getOwner()
+ .equals(other.getOwner());
+ result = result && getDelegateesList()
+ .equals(other.getDelegateesList());
+ result = result && getType()
+ .equals(other.getType());
+ result = result && (getQuantity()
+ == other.getQuantity());
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ hash = (37 * hash) + OWNER_FIELD_NUMBER;
+ hash = (53 * hash) + getOwner().hashCode();
+ if (getDelegateesCount() > 0) {
+ hash = (37 * hash) + DELEGATEES_FIELD_NUMBER;
+ hash = (53 * hash) + getDelegateesList().hashCode();
+ }
+ hash = (37 * hash) + TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + getType().hashCode();
+ hash = (37 * hash) + QUANTITY_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getQuantity());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput 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.PlainDelegatedOutput parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput 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.PlainDelegatedOutput 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.PlainDelegatedOutput 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.PlainDelegatedOutput 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.PlainDelegatedOutput 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.PlainDelegatedOutput 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.PlainDelegatedOutput 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.PlainDelegatedOutput 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 PlainDelegatedOutput is the result of approve transactions using plaintext tokens
+ *
+ *
+ * Protobuf type {@code PlainDelegatedOutput}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:PlainDelegatedOutput)
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainDelegatedOutput_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainDelegatedOutput_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.class, org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.Builder.class);
+ }
+
+ // Construct using org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.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();
+ owner_ = com.google.protobuf.ByteString.EMPTY;
+
+ delegatees_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ type_ = "";
+
+ quantity_ = 0L;
+
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.internal_static_PlainDelegatedOutput_descriptor;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDefaultInstanceForType() {
+ return org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance();
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput build() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput buildPartial() {
+ org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput result = new org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ result.owner_ = owner_;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatees_ = java.util.Collections.unmodifiableList(delegatees_);
+ bitField0_ = (bitField0_ & ~0x00000002);
+ }
+ result.delegatees_ = delegatees_;
+ result.type_ = type_;
+ result.quantity_ = quantity_;
+ 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.Transaction.PlainDelegatedOutput) {
+ return mergeFrom((org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput other) {
+ if (other == org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput.getDefaultInstance()) return this;
+ if (other.getOwner() != com.google.protobuf.ByteString.EMPTY) {
+ setOwner(other.getOwner());
+ }
+ if (!other.delegatees_.isEmpty()) {
+ if (delegatees_.isEmpty()) {
+ delegatees_ = other.delegatees_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ ensureDelegateesIsMutable();
+ delegatees_.addAll(other.delegatees_);
+ }
+ onChanged();
+ }
+ if (!other.getType().isEmpty()) {
+ type_ = other.type_;
+ onChanged();
+ }
+ if (other.getQuantity() != 0L) {
+ setQuantity(other.getQuantity());
+ }
+ 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.PlainDelegatedOutput parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString owner_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public com.google.protobuf.ByteString getOwner() {
+ return owner_;
+ }
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public Builder setOwner(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ owner_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The owner is the serialization of a SerializedIdentity struct
+ *
+ *
+ * optional bytes owner = 1;
+ */
+ public Builder clearOwner() {
+
+ owner_ = getDefaultInstance().getOwner();
+ onChanged();
+ return this;
+ }
+
+ private java.util.List delegatees_ = java.util.Collections.emptyList();
+ private void ensureDelegateesIsMutable() {
+ if (!((bitField0_ & 0x00000002) == 0x00000002)) {
+ delegatees_ = new java.util.ArrayList(delegatees_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public java.util.List
+ getDelegateesList() {
+ return java.util.Collections.unmodifiableList(delegatees_);
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public int getDelegateesCount() {
+ return delegatees_.size();
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public com.google.protobuf.ByteString getDelegatees(int index) {
+ return delegatees_.get(index);
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public Builder setDelegatees(
+ int index, com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDelegateesIsMutable();
+ delegatees_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public Builder addDelegatees(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDelegateesIsMutable();
+ delegatees_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public Builder addAllDelegatees(
+ java.lang.Iterable extends com.google.protobuf.ByteString> values) {
+ ensureDelegateesIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, delegatees_);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ * the owner
+ *
+ *
+ * repeated bytes delegatees = 2;
+ */
+ public Builder clearDelegatees() {
+ delegatees_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object type_ = "";
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ 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;
+ }
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ 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;
+ }
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ public Builder setType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ public Builder clearType() {
+
+ type_ = getDefaultInstance().getType();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The token type
+ *
+ *
+ * optional string type = 3;
+ */
+ public Builder setTypeBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ type_ = value;
+ onChanged();
+ return this;
+ }
+
+ private long quantity_ ;
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 4;
+ */
+ public long getQuantity() {
+ return quantity_;
+ }
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 4;
+ */
+ public Builder setQuantity(long value) {
+
+ quantity_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The quantity of tokens
+ *
+ *
+ * optional uint64 quantity = 4;
+ */
+ public Builder clearQuantity() {
+
+ quantity_ = 0L;
+ 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:PlainDelegatedOutput)
+ }
+
+ // @@protoc_insertion_point(class_scope:PlainDelegatedOutput)
+ private static final org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput();
+ }
+
+ public static org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PlainDelegatedOutput parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PlainDelegatedOutput(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.PlainDelegatedOutput getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_TokenTransaction_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_TokenTransaction_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainTokenAction_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainTokenAction_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainImport_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainImport_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainTransfer_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainTransfer_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainApprove_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainApprove_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainTransferFrom_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainTransferFrom_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainOutput_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainOutput_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_InputId_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_InputId_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_PlainDelegatedOutput_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_PlainDelegatedOutput_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\"G\n\020TokenTransa" +
+ "ction\022)\n\014plain_action\030\001 \001(\0132\021.PlainToken" +
+ "ActionH\000B\010\n\006action\"\355\001\n\020PlainTokenAction\022" +
+ "$\n\014plain_import\030\001 \001(\0132\014.PlainImportH\000\022(\n" +
+ "\016plain_transfer\030\002 \001(\0132\016.PlainTransferH\000\022" +
+ "&\n\014plain_redeem\030\003 \001(\0132\016.PlainTransferH\000\022" +
+ "&\n\rplain_approve\030\004 \001(\0132\r.PlainApproveH\000\022" +
+ "1\n\023plain_transfer_From\030\005 \001(\0132\022.PlainTran" +
+ "sferFromH\000B\006\n\004data\",\n\013PlainImport\022\035\n\007out" +
+ "puts\030\001 \003(\0132\014.PlainOutput\"H\n\rPlainTransfe",
+ "r\022\030\n\006inputs\030\001 \003(\0132\010.InputId\022\035\n\007outputs\030\002" +
+ " \003(\0132\014.PlainOutput\"x\n\014PlainApprove\022\030\n\006in" +
+ "puts\030\001 \003(\0132\010.InputId\0220\n\021delegated_output" +
+ "s\030\002 \003(\0132\025.PlainDelegatedOutput\022\034\n\006output" +
+ "\030\003 \001(\0132\014.PlainOutput\"}\n\021PlainTransferFro" +
+ "m\022\030\n\006inputs\030\001 \003(\0132\010.InputId\022\035\n\007outputs\030\002" +
+ " \003(\0132\014.PlainOutput\022/\n\020delegated_output\030\003" +
+ " \001(\0132\025.PlainDelegatedOutput\"<\n\013PlainOutp" +
+ "ut\022\r\n\005owner\030\001 \001(\014\022\014\n\004type\030\002 \001(\t\022\020\n\010quant" +
+ "ity\030\003 \001(\004\"\'\n\007InputId\022\r\n\005tx_id\030\001 \001(\t\022\r\n\005i",
+ "ndex\030\002 \001(\r\"Y\n\024PlainDelegatedOutput\022\r\n\005ow" +
+ "ner\030\001 \001(\014\022\022\n\ndelegatees\030\002 \003(\014\022\014\n\004type\030\003 " +
+ "\001(\t\022\020\n\010quantity\030\004 \001(\004BQ\n#org.hyperledger" +
+ ".fabric.protos.tokenZ*github.com/hyperle" +
+ "dger/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_TokenTransaction_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_TokenTransaction_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_TokenTransaction_descriptor,
+ new java.lang.String[] { "PlainAction", "Action", });
+ internal_static_PlainTokenAction_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_PlainTokenAction_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainTokenAction_descriptor,
+ new java.lang.String[] { "PlainImport", "PlainTransfer", "PlainRedeem", "PlainApprove", "PlainTransferFrom", "Data", });
+ internal_static_PlainImport_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_PlainImport_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainImport_descriptor,
+ new java.lang.String[] { "Outputs", });
+ internal_static_PlainTransfer_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_PlainTransfer_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainTransfer_descriptor,
+ new java.lang.String[] { "Inputs", "Outputs", });
+ internal_static_PlainApprove_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_PlainApprove_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainApprove_descriptor,
+ new java.lang.String[] { "Inputs", "DelegatedOutputs", "Output", });
+ internal_static_PlainTransferFrom_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_PlainTransferFrom_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainTransferFrom_descriptor,
+ new java.lang.String[] { "Inputs", "Outputs", "DelegatedOutput", });
+ internal_static_PlainOutput_descriptor =
+ getDescriptor().getMessageTypes().get(6);
+ internal_static_PlainOutput_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainOutput_descriptor,
+ new java.lang.String[] { "Owner", "Type", "Quantity", });
+ internal_static_InputId_descriptor =
+ getDescriptor().getMessageTypes().get(7);
+ internal_static_InputId_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_InputId_descriptor,
+ new java.lang.String[] { "TxId", "Index", });
+ internal_static_PlainDelegatedOutput_descriptor =
+ getDescriptor().getMessageTypes().get(8);
+ internal_static_PlainDelegatedOutput_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_PlainDelegatedOutput_descriptor,
+ new java.lang.String[] { "Owner", "Delegatees", "Type", "Quantity", });
+ }
+
+ // @@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..cb3befb3 100644
--- a/fabric-chaincode-protos/src/main/protos/common/common.proto
+++ b/fabric-chaincode-protos/src/main/protos/common/common.proto
@@ -58,8 +58,10 @@ 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.
+ 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 */
+ 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/peer/chaincode_shim.proto b/fabric-chaincode-protos/src/main/protos/peer/chaincode_shim.proto
index 85a0e0c1..e49e573f 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;
diff --git a/fabric-chaincode-protos/src/main/protos/peer/proposal.proto b/fabric-chaincode-protos/src/main/protos/peer/proposal.proto
index 73f1d8e2..81a8d04d 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/expectations.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 expectation generated by the chaincode
+ // executing this invocation
+ TokenExpectation token_expectation = 5;
+}
\ No newline at end of file
diff --git a/fabric-chaincode-protos/src/main/protos/token/expectations.proto b/fabric-chaincode-protos/src/main/protos/token/expectations.proto
new file mode 100644
index 00000000..c4cc5954
--- /dev/null
+++ b/fabric-chaincode-protos/src/main/protos/token/expectations.proto
@@ -0,0 +1,40 @@
+/*
+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 protos;
+
+import "google/protobuf/timestamp.proto";
+import "token/transaction.proto";
+
+// TokenExpectation represent the belief that someone should achieve in terms of a token action
+message TokenExpectation {
+ oneof Expectation {
+ // PlainExpectation describes a plain token expectation
+ PlainExpectation plain_expectation = 1;
+ }
+}
+
+// PlainExpectation represent the plain expectation where no confidentiality is provided.
+message PlainExpectation {
+ oneof payload {
+ // ImportExpectation describes an token import expectation
+ PlainTokenExpectation import_expectation = 1;
+ // TransferExpectation describes a token transfer expectation
+ PlainTokenExpectation transfer_expectation = 2;
+ }
+}
+
+// PlainTokenExpectation represents the expecation that
+// certain outputs will be matched
+message PlainTokenExpectation {
+ // Outputs contains the expected outputs
+ repeated PlainOutput outputs = 1;
+}
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..2c47324b
--- /dev/null
+++ b/fabric-chaincode-protos/src/main/protos/token/transaction.proto
@@ -0,0 +1,158 @@
+/*
+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";
+
+// ================ 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 {
+ // action carries the content of this transaction.
+ oneof action {
+ PlainTokenAction plain_action = 1;
+ }
+}
+
+// PlainTokenAction governs the structure of a token action that is
+// subjected to no privacy restrictions
+message PlainTokenAction {
+ oneof data {
+ // A plaintext token import transaction
+ PlainImport plain_import = 1;
+ // A plaintext token transfer transaction
+ PlainTransfer plain_transfer = 2;
+ // A plaintext token redeem transaction
+ PlainTransfer plain_redeem = 3;
+ // A plaintext token approve transaction
+ PlainApprove plain_approve = 4;
+ // A plaintext token transfer from transaction
+ PlainTransferFrom plain_transfer_From = 5;
+ }
+}
+
+// PlainImport specifies an import of one or more tokens in plaintext format
+message PlainImport {
+
+ // An import transaction may contain one or more outputs
+ repeated PlainOutput outputs = 1;
+}
+
+// PlainTransfer specifies a transfer of one or more plaintext tokens to one or more outputs
+message PlainTransfer {
+
+ // The inputs to the transfer transaction are specified by their ID
+ repeated InputId inputs = 1;
+
+ // A transfer transaction may contain one or more outputs
+ repeated PlainOutput outputs = 2;
+}
+
+// PlainApprove specifies an approve of one or more tokens in plaintext format
+message PlainApprove {
+ // The inputs to the transfer transaction are specified by their ID
+ repeated InputId inputs = 1;
+
+ // An approve transaction contains one or more plain delegated outputs
+ repeated PlainDelegatedOutput delegated_outputs = 2;
+
+ // An approve transaction contains one plain output
+ PlainOutput output = 3;
+}
+
+// PlainTransferFrom specifies a transfer of one or more plaintext delegated tokens to one or more outputs
+// an to a delegated output
+message PlainTransferFrom {
+ // The inputs to the transfer transaction are specified by their ID
+ repeated InputId inputs = 1;
+
+ // A transferFrom transaction contains multiple outputs
+ repeated PlainOutput outputs = 2;
+
+ // A transferFrom transaction may contain one delegatable output
+ PlainDelegatedOutput delegated_output = 3;
+}
+
+// A PlainOutput is the result of import and transfer transactions using plaintext tokens
+message PlainOutput {
+
+ // The owner is the serialization of a SerializedIdentity struct
+ bytes owner = 1;
+
+ // The token type
+ string type = 2;
+
+ // The quantity of tokens
+ uint64 quantity = 3;
+}
+
+// An InputId specifies an output using the transaction ID and the index of the output in the transaction
+message InputId {
+
+ // The transaction ID
+ string tx_id = 1;
+
+ // The index of the output in the transaction
+ uint32 index = 2;
+}
+
+// A PlainDelegatedOutput is the result of approve transactions using plaintext tokens
+message PlainDelegatedOutput {
+ // The owner is the serialization of a SerializedIdentity struct
+ bytes owner = 1;
+
+ // The delegatees is an arrary of the serialized identities that can spend the output on behalf
+ // the owner
+ repeated bytes delegatees = 2;
+
+ // The token type
+ string type = 3;
+
+ // The quantity of tokens
+ uint64 quantity = 4;
+}
\ No newline at end of file
diff --git a/fabric-chaincode-shim/build.gradle b/fabric-chaincode-shim/build.gradle
index 20b0de87..4b096116 100644
--- a/fabric-chaincode-shim/build.gradle
+++ b/fabric-chaincode-shim/build.gradle
@@ -11,11 +11,36 @@ plugins {
id 'signing'
}
+tasks.withType(org.gradle.api.tasks.testing.Test) {
+ systemProperty 'CORE_CHAINCODE_LOGGING_LEVEL', 'DEBUG'
+}
+
+test {
+ // Always run tests, even when nothing changed.
+ dependsOn 'cleanTest'
+
+ // Show test results. Potentially useful for debugging. Comment this block
+ // testLogging {
+ // events "passed", "skipped", "failed"
+ // showExceptions true
+ // showCauses true
+ // showStandardStreams true
+ // exceptionFormat "full"
+
+ // }
+}
+
dependencies {
compile project(':fabric-chaincode-protos')
- compile 'io.netty:netty-tcnative-boringssl-static:2.0.7.Final'
- compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
- compile 'org.bouncycastle:bcprov-jdk15on:1.59'
+ compile 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final'
+ compile 'org.bouncycastle:bcpkix-jdk15on:1.62'
+ compile 'org.bouncycastle:bcprov-jdk15on:1.62'
+ compile group: 'io.github.classgraph', name: 'classgraph', version: '4.8.47'
+ implementation 'com.github.everit-org.json-schema:org.everit.json.schema:1.11.1'
+ compile 'io.swagger.core.v3:swagger-annotations:2.0.0'
+ implementation group: 'org.json', name: 'json', version: '20180813'
+ // Required if using Java 11+ as no longer bundled in the core libraries
+ testCompile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
}
sourceSets {
@@ -49,6 +74,9 @@ jacoco {
}
jacocoTestReport {
+ reports {
+ xml.enabled true
+ }
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: 'org/hyperledger/fabric/protos/**')
@@ -62,7 +90,22 @@ jacocoTestCoverageVerification {
element = 'CLASS'
excludes = ['org.hyperledger.fabric.shim.helper.Channel',
'org.hyperledger.fabric.shim.impl.Handler',
- 'org.hyperledger.fabric.shim.impl.ChaincodeSupportStream.1']
+ 'org.hyperledger.fabric.shim.impl.ChaincodeSupportStream.1',
+ 'org.hyperledger.fabric.contract.ContractRouter',
+ 'org.hyperledger.fabric.contract.routing.impl.ContractDefinitionImpl',
+ 'org.hyperledger.fabric.contract.routing.RoutingRegistry',
+ 'org.hyperledger.fabric.contract.routing.impl.RoutingRegistryImpl',
+ 'org.hyperledger.fabric.contract.execution.impl.ContractInvocationRequest',
+ 'org.hyperledger.fabric.contract.routing.TransactionType',
+ 'org.hyperledger.fabric.contract.metadata.MetadataBuilder',
+ 'org.hyperledger.fabric.shim.ChaincodeBase*',
+ 'org.hyperledger.fabric.shim.impl.InnvocationTaskManager',
+ 'org.hyperledger.fabric.shim.impl.InnvocationStubImpl*',
+ 'org.hyperledger.fabric.shim.impl.ChaincodeSupportClient*',
+ 'org.hyperledger.fabric.shim.impl.InnvocationTaskExecutor',
+ 'org.hyperledger.fabric.shim.impl.ChaincodeInnvocationTask',
+ 'org.hyperledger.fabric.shim.impl.QueryResultsIteratorImpl*',
+ 'org.hyperledger.fabric.shim.impl.ChaincodeMessageFactory']
limit {
minimum = 0.86
}
@@ -71,9 +114,20 @@ jacocoTestCoverageVerification {
rule {
element = 'CLASS'
includes = ['org.hyperledger.fabric.shim.helper.Channel',
- 'org.hyperledger.fabric.shim.impl.Handler']
+ 'org.hyperledger.fabric.contract.ContractRouter',
+ 'org.hyperledger.fabric.contract.execution.impl.ContractInvocationRequest',
+ 'org.hyperledger.fabric.contract.routing.impl.ContractDefinitionImpl',
+ 'org.hyperledger.fabric.contract.routing.RoutingRegistry',
+ 'org.hyperledger.fabric.contract.routing.impl.RoutingRegistryImpl',
+ 'org.hyperledger.fabric.shim.impl.Handler',
+ 'org.hyperledger.fabric.shim.ChaincodeBase',
+ 'org.hyperledger.fabric.contract.metadata.MetadataBuilder',
+ 'org.hyperledger.fabric.shim.impl.InnvocationTaskManager',
+ 'org.hyperledger.fabric.shim.impl.InnvocationTaskExecutor',
+ 'org.hyperledger.fabric.shim.impl.ChaincodeSupportClient',
+ 'org.hyperledger.fabric.shim.impl.ChaincodeMessageFactory']
limit {
- minimum = 0.79
+ minimum = 0.71
}
}
}
@@ -93,6 +147,7 @@ task licenseCheck {
sourceSet ->
sourceSet.allSource.findAll { !it.path.contains("build") && !it.path.contains("test/resources")}.each {
file ->
+ if (!file.name.contains("json")){
BufferedReader r = new BufferedReader(new FileReader(file))
def line, hasSPDX = false, hasTraditional = false
while ((line = r.readLine()) != null) {
@@ -112,6 +167,7 @@ task licenseCheck {
missing.add(file)
}
}
+ }
}
}
@@ -139,13 +195,22 @@ task licenseCheck {
javadoc {
- failOnError = false
- excludes = ['org/hyperledger/fabric/shim/impl/**',
- 'org/hyperledger/fabric/shim/helper/**',
- 'org/hyperledger/fabric/shim/ChaincodeBase.java']
+ failOnError = true
+ excludes = ['org/hyperledger/fabric/contract/ContextFactory.java',
+ 'org/hyperledger/fabric/contract/ContractRouter.java',
+ 'org/hyperledger/fabric/contract/ContractRuntimeException.java',
+ 'org/hyperledger/fabric/contract/execution/**',
+ 'org/hyperledger/fabric/contract/metadata/**',
+ 'org/hyperledger/fabric/contract/routing/**',
+ 'org/hyperledger/fabric/contract/systemcontract/**',
+ 'org/hyperledger/fabric/**/impl/**',
+ 'org/hyperledger/fabric/shim/helper/**']
+
source = sourceSets.main.allJava
- classpath = sourceSets.main.compileClasspath
+ classpath = sourceSets.main.runtimeClasspath
+
+ javadoc.options.addStringOption('Xdoclint:none', '-quiet')
}
if (JavaVersion.current().isJava8Compatible()) {
@@ -220,6 +285,8 @@ uploadArchives {
}
}
+
+
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
diff --git a/fabric-chaincode-shim/src/main/java/commons-logging.properties b/fabric-chaincode-shim/src/main/java/commons-logging.properties
deleted file mode 100644
index 57a53c99..00000000
--- a/fabric-chaincode-shim/src/main/java/commons-logging.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright IBM Corp. All Rights Reserved.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-# jdk handlers
-handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
-
-# default log level
-.level=INFO
-
-# Specific logger level
-example.Example.level=DEBUG
-example.SimpleSample.level=FINE
-
-# FileHandler options - can also be set to the ConsoleHandler
-# FileHandler level can be set to override the global level:
-java.util.logging.FileHandler.level=DEBUG
-
-# log file name for the File Handler
-java.util.logging.FileHandler.pattern=java-chaincode%u.log
-
-# Specify the style of output (simple or xml)
-java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
-
-# Optional - Limit the size of the file (in bytes)
-java.util.logging.FileHandler.limit=50000
-
-# Optional - The number of files to cycle through, by
-# appending an integer to the base file name:
-java.util.logging.FileHandler.count=10
-
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java
new file mode 100644
index 00000000..67e8e4a1
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java
@@ -0,0 +1,96 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+package org.hyperledger.fabric;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.function.Supplier;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+
+/**
+ * Logger class to use throughout the Contract Implementation
+ *
+ * Only available within the 1.4.3 release, this class was a helper class that wrapped
+ * the standard java.util.logging.
+ *
+ * This being deprecated as it doesn't enough extra function and also
+ * log calls made via this can loose their 'caller method info'
+ *
+ * For chaincode/contract implementations please use java.util.logging
+ * or your own framework. All the Hyperledger Fabric code here is logged
+ * in loggers with names starting org.hyperledger
+ *
+ * @deprecated
+ */
+public class Logger extends java.util.logging.Logger {
+
+ protected Logger(String name) {
+ super(name, null);
+
+ // ensure that the parent logger is set
+ this.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric"));
+ }
+
+ public static Logger getLogger(String name) {
+ return new Logger(name);
+ }
+
+ /**
+ * @deprecated
+ */
+ public void debug(Supplier msgSupplier) {
+ log(Level.FINEST, msgSupplier);
+ }
+
+ /**
+ * @deprecated
+ */
+ public void debug(String msg) {
+ log(Level.FINEST, msg);
+ }
+
+ public static Logger getLogger(Class> class1) {
+ // important to add the logger to the log manager
+ Logger l = Logger.getLogger(class1.getName());
+ LogManager.getLogManager().addLogger(l);
+ return l;
+ }
+
+ /**
+ * @deprecated
+ */
+ public void error(String message) {
+ log(Level.SEVERE, message);
+ }
+
+ /**
+ * @deprecated
+ */
+ public void error(Supplier msgSupplier) {
+ log(Level.SEVERE, msgSupplier);
+ }
+
+ /**
+ * @deprecated
+ */
+ public String formatError(Throwable throwable) {
+ if (throwable == null)
+ return null;
+ final StringWriter buffer = new StringWriter();
+ buffer.append(throwable.getMessage());
+ throwable.printStackTrace(new PrintWriter(buffer));
+
+ Throwable cause = throwable.getCause();
+ if (cause != null) {
+ buffer.append(".. caused by ..");
+ buffer.append(this.formatError(cause));
+ }
+
+ return buffer.toString();
+ }
+
+}
\ No newline at end of file
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logging.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logging.java
new file mode 100644
index 00000000..08719a83
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logging.java
@@ -0,0 +1,96 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+package org.hyperledger.fabric;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+
+/**
+ * Assistance class to use when logging.
+ *
+ * For chaincode/contract implementations please use java.util.logging or your
+ * own framework. All the Hyperledger Fabric code here is logged in loggers with
+ * names starting org.hyperledger
+ *
+ * Control of this is via the environment variables
+ * 'CORE_CHAINCODE_LOGGING_LEVEL' this takes a string that matches the following
+ * Java.util.logging levels (case insensitive)
+ *
+ * CRITICAL, ERROR -> Level.SEVERE, WARNING -> Level.WARNING, INFO -> Level.INFO
+ * NOTICE -> Level.CONFIG, DEBUG -> Level.FINEST
+ *
+ */
+public class Logging {
+
+ public static final String PERFLOGGER = "org.hyperledger.Performance";
+
+ /**
+ * Formats a Throwable to a string with details of all the causes as well
+ *
+ * @param throwable Exception
+ * @return String formatted with all the details
+ */
+ public static String formatError(final Throwable throwable) {
+ if (throwable == null) {
+ return null;
+ }
+ final StringWriter buffer = new StringWriter();
+ buffer.append(throwable.getMessage()).append(System.lineSeparator());
+
+ throwable.printStackTrace(new PrintWriter(buffer));
+
+ final Throwable cause = throwable.getCause();
+ if (cause != null) {
+ buffer.append(".. caused by ..").append(System.lineSeparator());
+ buffer.append(Logging.formatError(cause));
+ }
+
+ return buffer.toString();
+
+ }
+
+ /**
+ * Sets the log level to the the
+ */
+ public static void setLogLevel(String newLevel) {
+
+ Level l = mapLevel(newLevel);
+ LogManager logManager = LogManager.getLogManager();
+ // slightly cumbersome approach - but the loggers don't have a 'get children'
+ // so find those that have the correct stem.
+ final ArrayList allLoggers = Collections.list(logManager.getLoggerNames());
+ allLoggers.add("org.hyperledger");
+ allLoggers.stream().filter(name -> name.startsWith("org.hyperledger")).map(name -> logManager.getLogger(name))
+ .forEach(logger -> {
+ if (logger != null) {
+ logger.setLevel(l);
+ }
+ });
+ }
+
+ private static Level mapLevel(final String level) {
+ if (level != null) {
+ switch (level.toUpperCase().trim()) {
+ case "ERROR":
+ case "CRITICAL":
+ return Level.SEVERE;
+ case "WARNING":
+ return Level.WARNING;
+ case "INFO":
+ return Level.INFO;
+ case "NOTICE":
+ return Level.CONFIG;
+ case "DEBUG":
+ return Level.FINEST;
+ }
+ }
+ return Level.INFO;
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ClientIdentity.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ClientIdentity.java
new file mode 100644
index 00000000..f9c53d3f
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ClientIdentity.java
@@ -0,0 +1,184 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.bouncycastle.asn1.ASN1InputStream;
+import org.bouncycastle.asn1.ASN1Primitive;
+import org.bouncycastle.asn1.DEROctetString;
+import org.hyperledger.fabric.Logging;
+import org.hyperledger.fabric.protos.msp.Identities.SerializedIdentity;
+import org.hyperledger.fabric.shim.ChaincodeStub;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * ClientIdentity represents information about the identity that submitted a
+ * transaction. Chaincodes can use this class to obtain information about the
+ * submitting identity including a unique ID, the MSP (Membership Service
+ * Provider) ID, and attributes. Such information is useful in enforcing access
+ * control by the chaincode.
+ *
+ */
+public final class ClientIdentity {
+ private static Logger logger = Logger.getLogger(ContractRouter.class.getName());
+
+ private final String mspId;
+ private final X509Certificate cert;
+ private Map attrs;
+ private final String id;
+ // special OID used by Fabric to save attributes in x.509 certificates
+ private static final String FABRIC_CERT_ATTR_OID = "1.2.3.4.5.6.7.8.1";
+
+ public ClientIdentity(final ChaincodeStub stub) throws CertificateException, JSONException, IOException {
+ final byte[] signingId = stub.getCreator();
+
+ // Create a Serialized Identity protobuf
+ final SerializedIdentity si = SerializedIdentity.parseFrom(signingId);
+ this.mspId = si.getMspid();
+
+ final byte[] idBytes = si.getIdBytes().toByteArray();
+
+ final X509Certificate cert = (X509Certificate) CertificateFactory.getInstance("X509")
+ .generateCertificate(new ByteArrayInputStream(idBytes));
+ this.cert = cert;
+
+ this.attrs = new HashMap();
+ // Get the extension where the identity attributes are stored
+ final byte[] extensionValue = cert.getExtensionValue(FABRIC_CERT_ATTR_OID);
+ if (extensionValue != null) {
+ this.attrs = parseAttributes(extensionValue);
+ }
+
+ // Populate identity
+ this.id = "x509::" + cert.getSubjectDN().getName() + "::" + cert.getIssuerDN().getName();
+ }
+
+ /**
+ * getId returns the ID associated with the invoking identity. This ID is
+ * guaranteed to be unique within the MSP.
+ *
+ * @return {String} A string in the format: "x509::{subject DN}::{issuer DN}"
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * getMSPID returns the MSP ID of the invoking identity.
+ *
+ * @return {String}
+ */
+ public String getMSPID() {
+ return this.mspId;
+ }
+
+ /**
+ * parseAttributes returns a map of the attributes associated with an identity
+ *
+ * @param extensionValue DER-encoded Octet string stored in the attributes
+ * extension of the certificate, as a byte array
+ * @return attrMap {Map} a map of identity attributes as key
+ * value pair strings
+ */
+ private Map parseAttributes(final byte[] extensionValue) throws IOException {
+
+ final Map attrMap = new HashMap();
+
+ // Create ASN1InputStream from extensionValue
+ try (ByteArrayInputStream inStream = new ByteArrayInputStream(extensionValue);
+ ASN1InputStream asn1InputStream = new ASN1InputStream(inStream)) {
+
+ // Read the DER object
+ final ASN1Primitive derObject = asn1InputStream.readObject();
+ if (derObject instanceof DEROctetString) {
+ final DEROctetString derOctetString = (DEROctetString) derObject;
+
+ // Create attributeString from octets and create JSON object
+ final String attributeString = new String(derOctetString.getOctets(), UTF_8);
+ final JSONObject extJSON = new JSONObject(attributeString);
+ final JSONObject attrs = extJSON.getJSONObject("attrs");
+
+ final Iterator keys = attrs.keys();
+ while (keys.hasNext()) {
+ final String key = keys.next();
+ // Populate map with attributes and values
+ attrMap.put(key, attrs.getString(key));
+ }
+ }
+ } catch (final JSONException error) {
+ // creating a JSON object failed
+ // decoded extensionValue is not a string containing JSON
+ logger.severe(() -> Logging.formatError(error));
+ // return empty map
+ }
+ return attrMap;
+ }
+
+ /**
+ * getAttributeValue returns the value of the client's attribute named
+ * `attrName`. If the invoking identity possesses the attribute, returns the
+ * value of the attribute. If the invoking identity does not possess the
+ * attribute, returns null.
+ *
+ * @param attrName Name of the attribute to retrieve the value from the
+ * identity's credentials (such as x.509 certificate for
+ * PKI-based MSPs).
+ * @return {String | null} Value of the attribute or null if the invoking
+ * identity does not possess the attribute.
+ */
+ public String getAttributeValue(final String attrName) {
+ if (this.attrs.containsKey(attrName)) {
+ return this.attrs.get(attrName);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * assertAttributeValue verifies that the invoking identity has the attribute
+ * named `attrName` with a value of `attrValue`.
+ *
+ * @param attrName Name of the attribute to retrieve the value from the
+ * identity's credentials (such as x.509 certificate for
+ * PKI-based MSPs)
+ * @param attrValue Expected value of the attribute
+ * @return {boolean} True if the invoking identity possesses the attribute and
+ * the attribute value matches the expected value. Otherwise, returns
+ * false.
+ */
+ public boolean assertAttributeValue(final String attrName, final String attrValue) {
+ if (!this.attrs.containsKey(attrName)) {
+ return false;
+ } else {
+ return attrValue.equals(this.attrs.get(attrName));
+ }
+ }
+
+ /**
+ * getX509Certificate returns the X509 certificate associated with the invoking
+ * identity, or null if it was not identified by an X509 certificate, for
+ * instance if the MSP is implemented with an alternative to PKI such as
+ * [Identity Mixer](https://jira.hyperledger.org/browse/FAB-5673).
+ *
+ * @return {X509Certificate | null}
+ */
+ public X509Certificate getX509Certificate() {
+ return this.cert;
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/Context.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/Context.java
new file mode 100644
index 00000000..561c9ae4
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/Context.java
@@ -0,0 +1,70 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract;
+
+import java.io.IOException;
+import java.security.cert.CertificateException;
+
+import org.hyperledger.fabric.shim.ChaincodeStub;
+import org.json.JSONException;
+
+/**
+ *
+ * This context is available to all 'transaction functions' and provides the
+ * transaction context. It also provides access to the APIs for the world state
+ * using {@link #getStub()}
+ *
+ * Applications can implement their own versions if they wish to add
+ * functionality. All subclasses MUST implement a constructor, for example
+ *
+ * {@code
+ *
+ * public MyContext extends Context {
+ *
+ * public MyContext(ChaincodeStub stub) {
+ * super(stub);
+ * }
+ * }
+ *
+ *}
+ *
+ *
+ */
+public class Context {
+ protected ChaincodeStub stub;
+ protected ClientIdentity clientIdentity;
+
+ /**
+ * Constructor
+ * Creates new client identity and sets it as a property of the stub
+ * @param stub Instance of the {@link ChaincodeStub} to use
+ */
+ public Context(ChaincodeStub stub) {
+ this.stub = stub;
+ try {
+ this.clientIdentity = new ClientIdentity(stub);
+ } catch (CertificateException | JSONException | IOException e) {
+ throw new ContractRuntimeException("Could not create new client identity", e);
+ }
+ }
+
+ /**
+ *
+ * @return ChaincodeStub instance to use
+ */
+ public ChaincodeStub getStub() {
+ return this.stub;
+ }
+
+ /**
+ *
+ * @return ClientIdentity object to use
+ */
+ public ClientIdentity getClientIdentity() {
+ return this.clientIdentity;
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContextFactory.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContextFactory.java
new file mode 100644
index 00000000..11a3a6fe
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContextFactory.java
@@ -0,0 +1,30 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract;
+
+import org.hyperledger.fabric.shim.ChaincodeStub;
+
+/**
+ * Factory to create {@link Context} from {@link ChaincodeStub} by wrapping stub
+ * with dynamic proxy.
+ */
+public class ContextFactory {
+ private static ContextFactory cf;
+
+ static synchronized public ContextFactory getInstance() {
+ if (cf == null) {
+ cf = new ContextFactory();
+ }
+ return cf;
+ }
+
+ public Context createContext(final ChaincodeStub stub) {
+ Context newContext = new Context(stub);
+ return newContext;
+ }
+
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractInterface.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractInterface.java
new file mode 100644
index 00000000..1a4be631
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractInterface.java
@@ -0,0 +1,102 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract;
+
+import org.hyperledger.fabric.contract.annotation.Contract;
+import org.hyperledger.fabric.contract.annotation.Transaction;
+import org.hyperledger.fabric.shim.ChaincodeStub;
+import org.hyperledger.fabric.shim.ChaincodeException;
+
+/**
+ * All Contracts should implement this interface, in addition to the
+ * {@link Contract} annotation.
+ *
+ * All the of the methods on this is inteface have default implementations; for
+ * many contracts it may not be needed to sub-class these.
+ *
+ * Each method on the Contract that is marked with the {@link Transaction}
+ * annotation is considered a Transaction Function. This is eligible for
+ * calling. Each transaction function is supplied with it's first parameter
+ * being a {@link org.hyperledger.fabric.contract.Context} the other parameters
+ * are at the developer's discretion.
+ *
+ * The sequence of calls is
+ *
+ *
+ * createContext() -> beforeTransaction() -> the transaction function -> afterTransaction()
+ *
+ *
+ * If any of these functions throws an exception it is considered an error case,
+ * and the whole transaction is failed. The {@link org.hyperledger.fabric.contract.Context} is
+ * a very important object as it provides transactional context for access to current transaction id,
+ * ledger state, etc.
+ *
+ * Note on Threading
+ *
+ * All code should be 'Thread Friendly'. Each method must not rely on instance
+ * fields or class side variables for storage. Nor should they use any
+ * ThreadLocal Storage. Ledger data is stored via the ledger api available via
+ * the {@link Context}.
+ *
+ * If information needs to be passed from the {@link #beforeTransaction(Context)}
+ * {@link #afterTransaction(Context, Object)} or between separate transaction functions when
+ * called directory, then a subclass of the
+ * {@link Context} should be provided.
+ *
+ *
+ */
+public interface ContractInterface {
+
+ /**
+ * Create context from {@link ChaincodeStub}, default impl provided, but can be
+ * overwritten by contract
+ *
+ * @param stub Instance of the ChaincodeStub to use for this transaction
+ * @return instance of the context to use for the current transaciton being
+ * executed
+ */
+ default Context createContext(ChaincodeStub stub) {
+ return ContextFactory.getInstance().createContext(stub);
+ }
+
+ /**
+ * Invoked for any transaction that does not exist.
+ *
+ * This will throw an exception. If you wish to alter the exception thrown or if
+ * you wish to consider requests for transactions that don't exist as not an
+ * error, subclass this method.
+ *
+ * @param ctx the context as created by {@link #createContext(ChaincodeStub)}.
+ */
+ default void unknownTransaction(Context ctx) {
+ throw new ChaincodeException("Undefined contract method called");
+ }
+
+ /**
+ * Invoked once before each transaction.
+ *
+ * Any exceptions thrown will fail the transaction, and neither the required
+ * transaction or the {@link #afterTransaction(Context, Object)} will be called
+ *
+ * @param ctx the context as created by {@link #createContext(ChaincodeStub)}.
+ */
+ default void beforeTransaction(Context ctx) {
+ }
+
+ /**
+ * Invoked once after each transaction.
+ *
+ * Any exceptions thrown will fail the transaction.
+ *
+ * @param ctx the context as created by {@link #createContext(ChaincodeStub)}.
+ * @param result The object returned from the transaction function if any. As
+ * this is a Java object and therefore pass-by-reference it is
+ * possible to modify this object.
+ */
+ default void afterTransaction(Context ctx, Object result) {
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java
new file mode 100644
index 00000000..4edd4587
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java
@@ -0,0 +1,161 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract;
+
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import org.hyperledger.fabric.Logging;
+import org.hyperledger.fabric.contract.execution.ExecutionFactory;
+import org.hyperledger.fabric.contract.execution.ExecutionService;
+import org.hyperledger.fabric.contract.execution.InvocationRequest;
+import org.hyperledger.fabric.contract.metadata.MetadataBuilder;
+import org.hyperledger.fabric.contract.routing.ContractDefinition;
+import org.hyperledger.fabric.contract.routing.RoutingRegistry;
+import org.hyperledger.fabric.contract.routing.TxFunction;
+import org.hyperledger.fabric.contract.routing.TypeRegistry;
+import org.hyperledger.fabric.contract.routing.impl.RoutingRegistryImpl;
+import org.hyperledger.fabric.contract.routing.impl.TypeRegistryImpl;
+import org.hyperledger.fabric.metrics.Metrics;
+import org.hyperledger.fabric.shim.ChaincodeBase;
+import org.hyperledger.fabric.shim.ChaincodeStub;
+import org.hyperledger.fabric.shim.ResponseUtils;
+
+/**
+ * Router class routes Init/Invoke requests to contracts. Implements
+ * {@link org.hyperledger.fabric.shim.Chaincode} interface.
+ */
+public class ContractRouter extends ChaincodeBase {
+ private static Logger logger = Logger.getLogger(ContractRouter.class.getName());
+
+ private RoutingRegistry registry;
+ private TypeRegistry typeRegistry;
+ private ExecutionService executor;
+
+ /**
+ * Take the arguments from the cli, and initiate processing of cli options and
+ * environment variables.
+ *
+ * Create the Contract scanner, and the Execution service
+ *
+ * @param args
+ */
+ public ContractRouter(String[] args) {
+ super.initializeLogging();
+ super.processEnvironmentOptions();
+ super.processCommandLineOptions(args);
+
+ Properties props = super.getChaincodeConfig();
+ Metrics.initialize(props);
+
+ super.validateOptions();
+ logger.fine("ContractRouter");
+ registry = new RoutingRegistryImpl();
+ typeRegistry = new TypeRegistryImpl();
+ executor = ExecutionFactory.getInstance().createExecutionService(typeRegistry);
+
+ }
+
+ /**
+ * Locate all the contracts that are available on the classpath
+ */
+ protected void findAllContracts() {
+ registry.findAndSetContracts(this.typeRegistry);
+ }
+
+ /**
+ * Start the chaincode container off and running, this will send the initial
+ * flow back to the peer
+ *
+ * @throws Exception
+ */
+ void startRouting() {
+ try {
+ super.connectToPeer();
+ } catch (Exception e) {
+ ContractRuntimeException cre = new ContractRuntimeException("Unable to start routing",e);
+ logger.severe(() -> Logging.formatError(cre));
+ throw cre;
+ }
+ }
+
+ private Response processRequest(ChaincodeStub stub) {
+ logger.info(() -> "Got invoke routing request");
+ try {
+ if (stub.getStringArgs().size() > 0) {
+ logger.info(() -> "Got the invoke request for:" + stub.getFunction() + " " + stub.getParameters());
+ InvocationRequest request = ExecutionFactory.getInstance().createRequest(stub);
+ TxFunction txFn = getRouting(request);
+
+ logger.info(() -> "Got routing:" + txFn.getRouting());
+ return executor.executeRequest(txFn, request, stub);
+ } else {
+ return ResponseUtils.newSuccessResponse();
+ }
+ } catch (Throwable throwable) {
+ return ResponseUtils.newErrorResponse(throwable);
+ }
+ }
+
+ @Override
+ public Response invoke(ChaincodeStub stub) {
+ return processRequest(stub);
+ }
+
+ @Override
+ public Response init(ChaincodeStub stub) {
+ return processRequest(stub);
+ }
+
+ /**
+ * Given the Invocation Request, return the routing object for this call
+ *
+ * @param request
+ * @return
+ */
+ TxFunction getRouting(InvocationRequest request) {
+ // request name is the fully qualified 'name:txname'
+ if (registry.containsRoute(request)) {
+ return registry.getTxFn(request);
+ } else {
+ logger.fine(() -> "Namespace is " + request);
+ ContractDefinition contract = registry.getContract(request.getNamespace());
+ return contract.getUnknownRoute();
+ }
+ }
+
+ /**
+ * Main method to start the contract based chaincode
+ *
+ */
+ public static void main(String[] args) {
+
+ logger.info("Starting ContractRouter...");
+
+ ContractRouter cfc = new ContractRouter(args);
+ cfc.findAllContracts();
+
+ // Create the Metadata ahead of time rather than have to produce every
+ // time
+ MetadataBuilder.initialize(cfc.getRoutingRegistry(), cfc.getTypeRegistry());
+ logger.info(() -> "Metadata follows:" + MetadataBuilder.debugString());
+
+ // commence routing, once this has returned the chaincode and contract api is
+ // 'open for chaining'
+ cfc.startRouting();
+ logger.info("Ending main thread ContractRouter...");
+ }
+
+ protected TypeRegistry getTypeRegistry() {
+ return this.typeRegistry;
+ }
+
+ protected RoutingRegistry getRoutingRegistry() {
+ return this.registry;
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRuntimeException.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRuntimeException.java
new file mode 100644
index 00000000..3c10cc19
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRuntimeException.java
@@ -0,0 +1,37 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+package org.hyperledger.fabric.contract;
+
+import org.hyperledger.fabric.shim.ChaincodeException;
+
+/**
+ * Specific RuntimeException for events that occur in the calling and handling
+ * of the Contracts, NOT within the contract logic itself.
+ *
+ * FUTURE At some future point we wish to add more diagnostic information into this,
+ * for example current tx id
+ *
+ */
+public class ContractRuntimeException extends ChaincodeException {
+
+ public ContractRuntimeException(String string) {
+ super(string);
+ }
+
+ public ContractRuntimeException(String string, Throwable cause) {
+ super(string, cause);
+ }
+
+ public ContractRuntimeException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Generated serial version id
+ */
+ private static final long serialVersionUID = -884373036398750450L;
+
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Contact.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Contact.java
new file mode 100644
index 00000000..aa76afcd
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Contact.java
@@ -0,0 +1,30 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation that identifies this class as being a contact. Can
+ * be populated with email, name and url fields.
+ *
+ */
+@Retention(RUNTIME)
+@Target(ElementType.TYPE)
+public @interface Contact {
+
+ String email() default "";
+
+ String name() default "";
+
+ String url() default "";
+
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Contract.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Contract.java
new file mode 100644
index 00000000..d964fe4d
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Contract.java
@@ -0,0 +1,41 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.hyperledger.fabric.contract.annotation.Info;
+
+/**
+ * Class level annotation that identifies this class as being a contract. Can
+ * supply information and an alternative name for the contract rather than the
+ * classname
+ */
+@Retention(RUNTIME)
+@Target(ElementType.TYPE)
+public @interface Contract {
+
+ /**
+ * The Info object can be supplied to provide additional information about the
+ * contract, including title, description, version and license
+ *
+ * @return Info object
+ */
+ Info info() default @Info();
+
+ /**
+ * Normally the name of the class is used to refer to the contract (name without package).
+ * This can be altered if wished.
+ *
+ * @return Name of the contract to be used instead of the Classname
+ */
+ String name() default "";
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/DataType.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/DataType.java
new file mode 100644
index 00000000..a5fc5223
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/DataType.java
@@ -0,0 +1,30 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation indicating this class represents one of the complex
+ * types that can be returned or passed to the transaction functions.
+ *
+ * These datatypes are used (within the current implementation) for determining the data flow protocol
+ * from the Contracts to the SDK and for permitting a fully formed Interface Definition to be created for the
+ * contract.
+ *
+ * Complex types can appear within this definition, and these are identified using this annotation.
+ *
+ * FUTURE To take these annotations are also utilize them for leverage storage
+ */
+@Retention(RUNTIME)
+@Target(ElementType.TYPE)
+public @interface DataType {
+ String namespace() default "";
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Default.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Default.java
new file mode 100644
index 00000000..510e0b99
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Default.java
@@ -0,0 +1,21 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+package org.hyperledger.fabric.contract.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Class level annotation that defines the contract that is the default contract,
+ * and as such invoke of the transaction functions does not need to be qualified by the contract name
+ */
+@Retention(RUNTIME)
+@Target(ElementType.TYPE)
+public @interface Default {
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Info.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Info.java
new file mode 100644
index 00000000..566bc73e
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Info.java
@@ -0,0 +1,51 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import org.hyperledger.fabric.contract.annotation.License;
+import org.hyperledger.fabric.contract.annotation.Contact;
+
+/**
+ * Class level annotation that identifies this class as being an info object. Can
+ * supply additional information about the contract, including title, description,
+ * version, license and contact information.
+ *
+ */
+@Retention(RUNTIME)
+@Target(ElementType.TYPE)
+public @interface Info {
+
+ String title() default "";
+
+ String description() default "";
+
+ String version() default "";
+
+ String termsOfService() default "";
+
+ /**
+ * License object that can be populated to include name and url.
+ *
+ * @return License object
+ *
+ */
+ License license() default @License();
+
+ /**
+ * Contact object that can be populated with email, name and url fields.
+ *
+ * @return Contact object
+ *
+ */
+ Contact contact() default @Contact();
+
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/License.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/License.java
new file mode 100644
index 00000000..084dbf6c
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/License.java
@@ -0,0 +1,28 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation that identifies this class as being a license object. Can
+ * be populated to include name and url.
+ *
+ */
+@Retention(RUNTIME)
+@Target(ElementType.TYPE)
+public @interface License {
+
+ String name() default "";
+
+ String url() default "";
+
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Property.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Property.java
new file mode 100644
index 00000000..323d1dc2
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Property.java
@@ -0,0 +1,45 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Field and parameter level annotation defining a property of the class
+ * (identified by {@link DataType}) Can also be used on the parameters of
+ * transaction functions
+ *
+ * Example of using this annotation
+ *
+ *
+ *
+ * // max 15 character string, a-z with spaces
+ * @Property(schema = { "pattern", "^[a-zA-Z\\s]{0,15}$" })
+ * private String text;
+ *
+ * // How friendly is this on a scale of 1-5, 1 being formal, 5 being familar
+ * @Property(schema = { "minimum", "1", "maximum", "5" })
+ * private int friendliness = 1;
+ *
+ *
+ */
+@Retention(RUNTIME)
+@Target({ ElementType.FIELD, ElementType.PARAMETER })
+public @interface Property {
+
+ /**
+ * Allows each property to be defined a detail set of rules to determine the
+ * valid types of this data. The format follows the syntax of the OpenAPI Schema
+ * object.
+ *
+ * @return String array of the key-value pairs of the schema
+ */
+ String[] schema() default {};
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Transaction.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Transaction.java
new file mode 100644
index 00000000..661ca977
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/annotation/Transaction.java
@@ -0,0 +1,44 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.annotation;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation indicating the method to be a callable transaction
+ * function.
+ *
+ * These functions are called in client SDKs by the combination of
[contractname]:[transactioname]
+ * Unless specified otherwise, the contract name is the class name (without package) and the transaction
+ * name is the method name.
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface Transaction {
+ /**
+ * TRUE indicates that this function is intended to be called with the 'submit'
+ * semantics
+ *
+ * FALSE indicates that this is intended to be called with the evaluate
+ * semantics
+ *
+ * @return boolean, default is true
+ */
+ boolean submit() default true;
+
+ /**
+ * The name of the callable transaction if it should be different to the method
+ * name.
+ *
+ * @return the transaction name
+ */
+ String name() default "";
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/ExecutionFactory.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/ExecutionFactory.java
new file mode 100644
index 00000000..288ee4fb
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/ExecutionFactory.java
@@ -0,0 +1,35 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.execution;
+
+import org.hyperledger.fabric.contract.execution.impl.ContractExecutionService;
+import org.hyperledger.fabric.contract.execution.impl.ContractInvocationRequest;
+import org.hyperledger.fabric.contract.routing.TypeRegistry;
+import org.hyperledger.fabric.shim.ChaincodeStub;
+
+public class ExecutionFactory {
+ private static ExecutionFactory rf;
+ private static ExecutionService es;
+
+ public static ExecutionFactory getInstance() {
+ if (rf == null) {
+ rf = new ExecutionFactory();
+ }
+ return rf;
+ }
+
+ public InvocationRequest createRequest(ChaincodeStub context) {
+ return new ContractInvocationRequest(context);
+ }
+
+ public ExecutionService createExecutionService(TypeRegistry typeRegistry) {
+ if (es == null) {
+ es = new ContractExecutionService(typeRegistry);
+ }
+ return es;
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/ExecutionService.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/ExecutionService.java
new file mode 100644
index 00000000..e55a3a92
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/ExecutionService.java
@@ -0,0 +1,20 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.execution;
+
+import org.hyperledger.fabric.contract.routing.TxFunction;
+import org.hyperledger.fabric.contract.routing.TxFunction.Routing;
+import org.hyperledger.fabric.shim.Chaincode;
+import org.hyperledger.fabric.shim.ChaincodeStub;
+
+/**
+ * Service that executes {@link InvocationRequest} (wrapped Init/Invoke + extra data) using routing information {@link Routing}
+ */
+public interface ExecutionService {
+
+ Chaincode.Response executeRequest(TxFunction txFn, InvocationRequest req, ChaincodeStub stub);
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/InvocationRequest.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/InvocationRequest.java
new file mode 100644
index 00000000..fa0a5cbd
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/InvocationRequest.java
@@ -0,0 +1,21 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.execution;
+
+import java.util.List;
+
+/**
+ * All information needed to find {@link org.hyperledger.fabric.contract.annotation.Contract} and invoke the request
+ */
+public interface InvocationRequest {
+ String DEFAULT_NAMESPACE = "default";
+
+ String getNamespace();
+ String getMethod();
+ List getArgs();
+ String getRequestName();
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java
new file mode 100644
index 00000000..3ada8f92
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java
@@ -0,0 +1,185 @@
+/*
+Copyright IBM Corp. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.execution;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.nio.charset.StandardCharsets;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.hyperledger.fabric.contract.ContractRuntimeException;
+import org.hyperledger.fabric.contract.metadata.TypeSchema;
+import org.hyperledger.fabric.contract.routing.DataTypeDefinition;
+import org.hyperledger.fabric.contract.routing.PropertyDefinition;
+import org.hyperledger.fabric.contract.routing.TypeRegistry;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * Used as a the default serialisation for transmission from SDK to Contract
+ */
+public class JSONTransactionSerializer {
+ private static Logger logger = Logger.getLogger(JSONTransactionSerializer.class.getName());
+ private final TypeRegistry typeRegistry;
+
+ /**
+ * Create a new serialiser and maintain a reference to the TypeRegistry
+ *
+ * @param typeRegistry
+ */
+ public JSONTransactionSerializer(final TypeRegistry typeRegistry) {
+ this.typeRegistry = typeRegistry;
+ }
+
+ /**
+ * Convert the value supplied to a byte array, according to the TypeSchema
+ *
+ * @param value
+ * @param ts
+ * @return Byte buffer
+ */
+ public byte[] toBuffer(final Object value, final TypeSchema ts) {
+ logger.fine(() -> "Schema to convert is " + ts);
+ byte[] buffer = null;
+ if (value != null) {
+ final String type = ts.getType();
+ if (type != null) {
+ switch (type) {
+ case "array":
+ final JSONArray array = new JSONArray(value);
+ buffer = array.toString().getBytes(UTF_8);
+ break;
+ case "string":
+ buffer = ((String) value).getBytes(UTF_8);
+ break;
+ case "number":
+ case "integer":
+ case "boolean":
+ default:
+ buffer = (value).toString().getBytes(UTF_8);
+ }
+ } else {
+ final JSONObject obj = new JSONObject(value);
+ buffer = obj.toString().getBytes(UTF_8);
+ }
+ }
+ return buffer;
+ }
+
+ /**
+ * Take the byte buffer and return the object as required
+ *
+ * @param buffer Byte buffer from the wire
+ * @param ts TypeSchema representing the type
+ *
+ * @return Object created; relies on Java auto-boxing for primitives
+ *
+ * @throws InstantiationException
+ * @throws IllegalAccessException
+ */
+ public Object fromBuffer(final byte[] buffer, final TypeSchema ts) {
+ try {
+ final String stringData = new String(buffer, StandardCharsets.UTF_8);
+ Object value = null;
+
+ value = _convert(stringData, ts);
+
+ return value;
+ } catch (InstantiationException | IllegalAccessException e) {
+ final ContractRuntimeException cre = new ContractRuntimeException(e);
+ throw cre;
+ }
+ }
+
+ /*
+ * Internal method to do the conversion
+ */
+ private Object _convert(final String stringData, final TypeSchema ts)
+ throws IllegalArgumentException, IllegalAccessException, InstantiationException {
+ logger.fine(() -> "Schema to convert is " + ts);
+ String type = ts.getType();
+ String format = null;
+ Object value = null;
+ if (type == null) {
+ type = "object";
+ final String ref = ts.getRef();
+ format = ref.substring(ref.lastIndexOf("/") + 1);
+ }
+
+ if (type.contentEquals("string")) {
+ value = stringData;
+ } else if (type.contentEquals("integer")) {
+ final String intFormat = ts.getFormat();
+ if (intFormat.contentEquals("int32")) {
+ value = Integer.parseInt(stringData);
+ } else {
+ value = Long.parseLong(stringData);
+ }
+ } else if (type.contentEquals("number")) {
+ final String numFormat = ts.getFormat();
+ if (numFormat.contentEquals("float")) {
+ value = Float.parseFloat(stringData);
+ } else {
+ value = Double.parseDouble(stringData);
+ }
+ } else if (type.contentEquals("boolean")) {
+ value = Boolean.parseBoolean(stringData);
+ } else if (type.contentEquals("object")) {
+ value = createComponentInstance(format, stringData, ts);
+ } else if (type.contentEquals("array")) {
+ final JSONArray jsonArray = new JSONArray(stringData);
+ final TypeSchema itemSchema = ts.getItems();
+ final Object[] data = (Object[]) Array.newInstance(itemSchema.getTypeClass(this.typeRegistry),
+ jsonArray.length());
+ for (int i = 0; i < jsonArray.length(); i++) {
+ data[i] = _convert(jsonArray.get(i).toString(), itemSchema);
+ }
+ value = data;
+
+ }
+ return value;
+ }
+
+ Object createComponentInstance(final String format, final String jsonString, final TypeSchema ts) {
+
+ final DataTypeDefinition dtd = this.typeRegistry.getDataType(format);
+ Object obj;
+ try {
+ obj = dtd.getTypeClass().newInstance();
+ } catch (InstantiationException | IllegalAccessException e1) {
+ throw new ContractRuntimeException("Unable to to create new instance of type", e1);
+ }
+
+ final JSONObject json = new JSONObject(jsonString);
+ // request validation of the type may throw an exception if validation fails
+ ts.validate(json);
+
+ try {
+ final Map fields = dtd.getProperties();
+ for (final Iterator iterator = fields.values().iterator(); iterator.hasNext();) {
+ final PropertyDefinition prop = iterator.next();
+
+ final Field f = prop.getField();
+ f.setAccessible(true);
+ final Object newValue = _convert(json.get(prop.getName()).toString(), prop.getSchema());
+
+ f.set(obj, newValue);
+
+ }
+ return obj;
+ } catch (SecurityException | IllegalArgumentException | IllegalAccessException | InstantiationException
+ | JSONException e) {
+ throw new ContractRuntimeException("Unable to convert JSON to object", e);
+ }
+
+ }
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/impl/ContractExecutionService.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/impl/ContractExecutionService.java
new file mode 100644
index 00000000..3bef4cda
--- /dev/null
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/impl/ContractExecutionService.java
@@ -0,0 +1,100 @@
+/*
+Copyright IBM Corp., DTCC All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
+*/
+
+package org.hyperledger.fabric.contract.execution.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.hyperledger.fabric.contract.Context;
+import org.hyperledger.fabric.contract.ContractInterface;
+import org.hyperledger.fabric.contract.ContractRuntimeException;
+import org.hyperledger.fabric.contract.execution.ExecutionService;
+import org.hyperledger.fabric.contract.execution.InvocationRequest;
+import org.hyperledger.fabric.contract.execution.JSONTransactionSerializer;
+import org.hyperledger.fabric.contract.metadata.TypeSchema;
+import org.hyperledger.fabric.contract.routing.ParameterDefinition;
+import org.hyperledger.fabric.contract.routing.TxFunction;
+import org.hyperledger.fabric.contract.routing.TypeRegistry;
+import org.hyperledger.fabric.shim.Chaincode;
+import org.hyperledger.fabric.shim.ChaincodeException;
+import org.hyperledger.fabric.shim.ChaincodeStub;
+import org.hyperledger.fabric.shim.ResponseUtils;
+
+public class ContractExecutionService implements ExecutionService {
+
+ private static Logger logger = Logger.getLogger(ContractExecutionService.class.getName());
+
+ private JSONTransactionSerializer serializer;
+ Map proxies = new HashMap<>();
+
+ public ContractExecutionService(TypeRegistry typeRegistry) {
+ // FUTURE: Permit this to swapped out as per node.js
+ this.serializer = new JSONTransactionSerializer(typeRegistry);
+ }
+
+ @Override
+ public Chaincode.Response executeRequest(TxFunction txFn, InvocationRequest req, ChaincodeStub stub) {
+ logger.fine(() -> "Routing Request" + txFn);
+ TxFunction.Routing rd = txFn.getRouting();
+ Chaincode.Response response;
+
+ try {
+ ContractInterface contractObject = rd.getContractInstance();
+ Context context = contractObject.createContext(stub);
+
+ final List