All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hyperledger.fabric.protos.common.Metadata Maven / Gradle / Ivy

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: common/common.proto
// Protobuf Java Version: 4.28.2

package org.hyperledger.fabric.protos.common;

/**
 * 
 * Metadata is a common structure to be used to encode block metadata
 * 
* * Protobuf type {@code common.Metadata} */ public final class Metadata extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:common.Metadata) MetadataOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 28, /* patch= */ 2, /* suffix= */ "", Metadata.class.getName()); } // Use Metadata.newBuilder() to construct. private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Metadata() { value_ = com.google.protobuf.ByteString.EMPTY; signatures_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.hyperledger.fabric.protos.common.CommonProto.internal_static_common_Metadata_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.hyperledger.fabric.protos.common.CommonProto.internal_static_common_Metadata_fieldAccessorTable .ensureFieldAccessorsInitialized( org.hyperledger.fabric.protos.common.Metadata.class, org.hyperledger.fabric.protos.common.Metadata.Builder.class); } public static final int VALUE_FIELD_NUMBER = 1; private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; /** * bytes value = 1 [json_name = "value"]; * @return The value. */ @java.lang.Override public com.google.protobuf.ByteString getValue() { return value_; } public static final int SIGNATURES_FIELD_NUMBER = 2; @SuppressWarnings("serial") private java.util.List signatures_; /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ @java.lang.Override public java.util.List getSignaturesList() { return signatures_; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ @java.lang.Override public java.util.List getSignaturesOrBuilderList() { return signatures_; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ @java.lang.Override public int getSignaturesCount() { return signatures_.size(); } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ @java.lang.Override public org.hyperledger.fabric.protos.common.MetadataSignature getSignatures(int index) { return signatures_.get(index); } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ @java.lang.Override public org.hyperledger.fabric.protos.common.MetadataSignatureOrBuilder getSignaturesOrBuilder( int index) { return signatures_.get(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!value_.isEmpty()) { output.writeBytes(1, value_); } for (int i = 0; i < signatures_.size(); i++) { output.writeMessage(2, signatures_.get(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!value_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, value_); } for (int i = 0; i < signatures_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, signatures_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.hyperledger.fabric.protos.common.Metadata)) { return super.equals(obj); } org.hyperledger.fabric.protos.common.Metadata other = (org.hyperledger.fabric.protos.common.Metadata) obj; if (!getValue() .equals(other.getValue())) return false; if (!getSignaturesList() .equals(other.getSignaturesList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); if (getSignaturesCount() > 0) { hash = (37 * hash) + SIGNATURES_FIELD_NUMBER; hash = (53 * hash) + getSignaturesList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static org.hyperledger.fabric.protos.common.Metadata parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.hyperledger.fabric.protos.common.Metadata parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.hyperledger.fabric.protos.common.Metadata parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.hyperledger.fabric.protos.common.Metadata 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.Metadata parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.hyperledger.fabric.protos.common.Metadata 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.Metadata parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } public static org.hyperledger.fabric.protos.common.Metadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input, extensionRegistry); } public static org.hyperledger.fabric.protos.common.Metadata parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } public static org.hyperledger.fabric.protos.common.Metadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static org.hyperledger.fabric.protos.common.Metadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } public static org.hyperledger.fabric.protos.common.Metadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(org.hyperledger.fabric.protos.common.Metadata prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * Metadata is a common structure to be used to encode block metadata
   * 
* * Protobuf type {@code common.Metadata} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:common.Metadata) org.hyperledger.fabric.protos.common.MetadataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.hyperledger.fabric.protos.common.CommonProto.internal_static_common_Metadata_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.hyperledger.fabric.protos.common.CommonProto.internal_static_common_Metadata_fieldAccessorTable .ensureFieldAccessorsInitialized( org.hyperledger.fabric.protos.common.Metadata.class, org.hyperledger.fabric.protos.common.Metadata.Builder.class); } // Construct using org.hyperledger.fabric.protos.common.Metadata.newBuilder() private Builder() { } private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; value_ = com.google.protobuf.ByteString.EMPTY; if (signaturesBuilder_ == null) { signatures_ = java.util.Collections.emptyList(); } else { signatures_ = null; signaturesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.hyperledger.fabric.protos.common.CommonProto.internal_static_common_Metadata_descriptor; } @java.lang.Override public org.hyperledger.fabric.protos.common.Metadata getDefaultInstanceForType() { return org.hyperledger.fabric.protos.common.Metadata.getDefaultInstance(); } @java.lang.Override public org.hyperledger.fabric.protos.common.Metadata build() { org.hyperledger.fabric.protos.common.Metadata result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.hyperledger.fabric.protos.common.Metadata buildPartial() { org.hyperledger.fabric.protos.common.Metadata result = new org.hyperledger.fabric.protos.common.Metadata(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields(org.hyperledger.fabric.protos.common.Metadata result) { if (signaturesBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { signatures_ = java.util.Collections.unmodifiableList(signatures_); bitField0_ = (bitField0_ & ~0x00000002); } result.signatures_ = signatures_; } else { result.signatures_ = signaturesBuilder_.build(); } } private void buildPartial0(org.hyperledger.fabric.protos.common.Metadata result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.value_ = value_; } } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.hyperledger.fabric.protos.common.Metadata) { return mergeFrom((org.hyperledger.fabric.protos.common.Metadata)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.hyperledger.fabric.protos.common.Metadata other) { if (other == org.hyperledger.fabric.protos.common.Metadata.getDefaultInstance()) return this; if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { setValue(other.getValue()); } if (signaturesBuilder_ == null) { if (!other.signatures_.isEmpty()) { if (signatures_.isEmpty()) { signatures_ = other.signatures_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureSignaturesIsMutable(); signatures_.addAll(other.signatures_); } onChanged(); } } else { if (!other.signatures_.isEmpty()) { if (signaturesBuilder_.isEmpty()) { signaturesBuilder_.dispose(); signaturesBuilder_ = null; signatures_ = other.signatures_; bitField0_ = (bitField0_ & ~0x00000002); signaturesBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getSignaturesFieldBuilder() : null; } else { signaturesBuilder_.addAllMessages(other.signatures_); } } } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { value_ = input.readBytes(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { org.hyperledger.fabric.protos.common.MetadataSignature m = input.readMessage( org.hyperledger.fabric.protos.common.MetadataSignature.parser(), extensionRegistry); if (signaturesBuilder_ == null) { ensureSignaturesIsMutable(); signatures_.add(m); } else { signaturesBuilder_.addMessage(m); } break; } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; /** * bytes value = 1 [json_name = "value"]; * @return The value. */ @java.lang.Override public com.google.protobuf.ByteString getValue() { return value_; } /** * bytes value = 1 [json_name = "value"]; * @param value The value to set. * @return This builder for chaining. */ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } value_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * bytes value = 1 [json_name = "value"]; * @return This builder for chaining. */ public Builder clearValue() { bitField0_ = (bitField0_ & ~0x00000001); value_ = getDefaultInstance().getValue(); onChanged(); return this; } private java.util.List signatures_ = java.util.Collections.emptyList(); private void ensureSignaturesIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { signatures_ = new java.util.ArrayList(signatures_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilder< org.hyperledger.fabric.protos.common.MetadataSignature, org.hyperledger.fabric.protos.common.MetadataSignature.Builder, org.hyperledger.fabric.protos.common.MetadataSignatureOrBuilder> signaturesBuilder_; /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public java.util.List getSignaturesList() { if (signaturesBuilder_ == null) { return java.util.Collections.unmodifiableList(signatures_); } else { return signaturesBuilder_.getMessageList(); } } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public int getSignaturesCount() { if (signaturesBuilder_ == null) { return signatures_.size(); } else { return signaturesBuilder_.getCount(); } } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public org.hyperledger.fabric.protos.common.MetadataSignature getSignatures(int index) { if (signaturesBuilder_ == null) { return signatures_.get(index); } else { return signaturesBuilder_.getMessage(index); } } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder setSignatures( int index, org.hyperledger.fabric.protos.common.MetadataSignature value) { if (signaturesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSignaturesIsMutable(); signatures_.set(index, value); onChanged(); } else { signaturesBuilder_.setMessage(index, value); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder setSignatures( int index, org.hyperledger.fabric.protos.common.MetadataSignature.Builder builderForValue) { if (signaturesBuilder_ == null) { ensureSignaturesIsMutable(); signatures_.set(index, builderForValue.build()); onChanged(); } else { signaturesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder addSignatures(org.hyperledger.fabric.protos.common.MetadataSignature value) { if (signaturesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSignaturesIsMutable(); signatures_.add(value); onChanged(); } else { signaturesBuilder_.addMessage(value); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder addSignatures( int index, org.hyperledger.fabric.protos.common.MetadataSignature value) { if (signaturesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSignaturesIsMutable(); signatures_.add(index, value); onChanged(); } else { signaturesBuilder_.addMessage(index, value); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder addSignatures( org.hyperledger.fabric.protos.common.MetadataSignature.Builder builderForValue) { if (signaturesBuilder_ == null) { ensureSignaturesIsMutable(); signatures_.add(builderForValue.build()); onChanged(); } else { signaturesBuilder_.addMessage(builderForValue.build()); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder addSignatures( int index, org.hyperledger.fabric.protos.common.MetadataSignature.Builder builderForValue) { if (signaturesBuilder_ == null) { ensureSignaturesIsMutable(); signatures_.add(index, builderForValue.build()); onChanged(); } else { signaturesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder addAllSignatures( java.lang.Iterable values) { if (signaturesBuilder_ == null) { ensureSignaturesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, signatures_); onChanged(); } else { signaturesBuilder_.addAllMessages(values); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder clearSignatures() { if (signaturesBuilder_ == null) { signatures_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { signaturesBuilder_.clear(); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public Builder removeSignatures(int index) { if (signaturesBuilder_ == null) { ensureSignaturesIsMutable(); signatures_.remove(index); onChanged(); } else { signaturesBuilder_.remove(index); } return this; } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public org.hyperledger.fabric.protos.common.MetadataSignature.Builder getSignaturesBuilder( int index) { return getSignaturesFieldBuilder().getBuilder(index); } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public org.hyperledger.fabric.protos.common.MetadataSignatureOrBuilder getSignaturesOrBuilder( int index) { if (signaturesBuilder_ == null) { return signatures_.get(index); } else { return signaturesBuilder_.getMessageOrBuilder(index); } } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public java.util.List getSignaturesOrBuilderList() { if (signaturesBuilder_ != null) { return signaturesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(signatures_); } } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public org.hyperledger.fabric.protos.common.MetadataSignature.Builder addSignaturesBuilder() { return getSignaturesFieldBuilder().addBuilder( org.hyperledger.fabric.protos.common.MetadataSignature.getDefaultInstance()); } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public org.hyperledger.fabric.protos.common.MetadataSignature.Builder addSignaturesBuilder( int index) { return getSignaturesFieldBuilder().addBuilder( index, org.hyperledger.fabric.protos.common.MetadataSignature.getDefaultInstance()); } /** * repeated .common.MetadataSignature signatures = 2 [json_name = "signatures"]; */ public java.util.List getSignaturesBuilderList() { return getSignaturesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< org.hyperledger.fabric.protos.common.MetadataSignature, org.hyperledger.fabric.protos.common.MetadataSignature.Builder, org.hyperledger.fabric.protos.common.MetadataSignatureOrBuilder> getSignaturesFieldBuilder() { if (signaturesBuilder_ == null) { signaturesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.hyperledger.fabric.protos.common.MetadataSignature, org.hyperledger.fabric.protos.common.MetadataSignature.Builder, org.hyperledger.fabric.protos.common.MetadataSignatureOrBuilder>( signatures_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); signatures_ = null; } return signaturesBuilder_; } // @@protoc_insertion_point(builder_scope:common.Metadata) } // @@protoc_insertion_point(class_scope:common.Metadata) private static final org.hyperledger.fabric.protos.common.Metadata DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Metadata(); } public static org.hyperledger.fabric.protos.common.Metadata getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Metadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public org.hyperledger.fabric.protos.common.Metadata getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy