
org.hyperledger.fabric.protos.common.Ledger Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: common/ledger.proto
package org.hyperledger.fabric.protos.common;
public final class Ledger {
private Ledger() {}
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 BlockchainInfoOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.BlockchainInfo)
com.google.protobuf.MessageOrBuilder {
/**
* uint64 height = 1;
*/
long getHeight();
/**
* bytes currentBlockHash = 2;
*/
com.google.protobuf.ByteString getCurrentBlockHash();
/**
* bytes previousBlockHash = 3;
*/
com.google.protobuf.ByteString getPreviousBlockHash();
}
/**
*
* Contains information about the blockchain ledger such as height, current
* block hash, and previous block hash.
*
*
* Protobuf type {@code common.BlockchainInfo}
*/
public static final class BlockchainInfo extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.BlockchainInfo)
BlockchainInfoOrBuilder {
// Use BlockchainInfo.newBuilder() to construct.
private BlockchainInfo(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private BlockchainInfo() {
height_ = 0L;
currentBlockHash_ = com.google.protobuf.ByteString.EMPTY;
previousBlockHash_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private BlockchainInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
height_ = input.readUInt64();
break;
}
case 18: {
currentBlockHash_ = input.readBytes();
break;
}
case 26: {
previousBlockHash_ = 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.Ledger.internal_static_common_BlockchainInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Ledger.internal_static_common_BlockchainInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.class, org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.Builder.class);
}
public static final int HEIGHT_FIELD_NUMBER = 1;
private long height_;
/**
* uint64 height = 1;
*/
public long getHeight() {
return height_;
}
public static final int CURRENTBLOCKHASH_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString currentBlockHash_;
/**
* bytes currentBlockHash = 2;
*/
public com.google.protobuf.ByteString getCurrentBlockHash() {
return currentBlockHash_;
}
public static final int PREVIOUSBLOCKHASH_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString previousBlockHash_;
/**
* bytes previousBlockHash = 3;
*/
public com.google.protobuf.ByteString getPreviousBlockHash() {
return previousBlockHash_;
}
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 (height_ != 0L) {
output.writeUInt64(1, height_);
}
if (!currentBlockHash_.isEmpty()) {
output.writeBytes(2, currentBlockHash_);
}
if (!previousBlockHash_.isEmpty()) {
output.writeBytes(3, previousBlockHash_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (height_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, height_);
}
if (!currentBlockHash_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, currentBlockHash_);
}
if (!previousBlockHash_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, previousBlockHash_);
}
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.Ledger.BlockchainInfo)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo other = (org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo) obj;
boolean result = true;
result = result && (getHeight()
== other.getHeight());
result = result && getCurrentBlockHash()
.equals(other.getCurrentBlockHash());
result = result && getPreviousBlockHash()
.equals(other.getPreviousBlockHash());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + HEIGHT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getHeight());
hash = (37 * hash) + CURRENTBLOCKHASH_FIELD_NUMBER;
hash = (53 * hash) + getCurrentBlockHash().hashCode();
hash = (37 * hash) + PREVIOUSBLOCKHASH_FIELD_NUMBER;
hash = (53 * hash) + getPreviousBlockHash().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo 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.Ledger.BlockchainInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo 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.Ledger.BlockchainInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo 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.Ledger.BlockchainInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo 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.Ledger.BlockchainInfo 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.Ledger.BlockchainInfo 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.Ledger.BlockchainInfo 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;
}
/**
*
* Contains information about the blockchain ledger such as height, current
* block hash, and previous block hash.
*
*
* Protobuf type {@code common.BlockchainInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.BlockchainInfo)
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Ledger.internal_static_common_BlockchainInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Ledger.internal_static_common_BlockchainInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.class, org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.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();
height_ = 0L;
currentBlockHash_ = com.google.protobuf.ByteString.EMPTY;
previousBlockHash_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Ledger.internal_static_common_BlockchainInfo_descriptor;
}
public org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.getDefaultInstance();
}
public org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo build() {
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo buildPartial() {
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo result = new org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo(this);
result.height_ = height_;
result.currentBlockHash_ = currentBlockHash_;
result.previousBlockHash_ = previousBlockHash_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo) {
return mergeFrom((org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo other) {
if (other == org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo.getDefaultInstance()) return this;
if (other.getHeight() != 0L) {
setHeight(other.getHeight());
}
if (other.getCurrentBlockHash() != com.google.protobuf.ByteString.EMPTY) {
setCurrentBlockHash(other.getCurrentBlockHash());
}
if (other.getPreviousBlockHash() != com.google.protobuf.ByteString.EMPTY) {
setPreviousBlockHash(other.getPreviousBlockHash());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private long height_ ;
/**
* uint64 height = 1;
*/
public long getHeight() {
return height_;
}
/**
* uint64 height = 1;
*/
public Builder setHeight(long value) {
height_ = value;
onChanged();
return this;
}
/**
* uint64 height = 1;
*/
public Builder clearHeight() {
height_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.ByteString currentBlockHash_ = com.google.protobuf.ByteString.EMPTY;
/**
* bytes currentBlockHash = 2;
*/
public com.google.protobuf.ByteString getCurrentBlockHash() {
return currentBlockHash_;
}
/**
* bytes currentBlockHash = 2;
*/
public Builder setCurrentBlockHash(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
currentBlockHash_ = value;
onChanged();
return this;
}
/**
* bytes currentBlockHash = 2;
*/
public Builder clearCurrentBlockHash() {
currentBlockHash_ = getDefaultInstance().getCurrentBlockHash();
onChanged();
return this;
}
private com.google.protobuf.ByteString previousBlockHash_ = com.google.protobuf.ByteString.EMPTY;
/**
* bytes previousBlockHash = 3;
*/
public com.google.protobuf.ByteString getPreviousBlockHash() {
return previousBlockHash_;
}
/**
* bytes previousBlockHash = 3;
*/
public Builder setPreviousBlockHash(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
previousBlockHash_ = value;
onChanged();
return this;
}
/**
* bytes previousBlockHash = 3;
*/
public Builder clearPreviousBlockHash() {
previousBlockHash_ = getDefaultInstance().getPreviousBlockHash();
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.BlockchainInfo)
}
// @@protoc_insertion_point(class_scope:common.BlockchainInfo)
private static final org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo();
}
public static org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public BlockchainInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new BlockchainInfo(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.hyperledger.fabric.protos.common.Ledger.BlockchainInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_BlockchainInfo_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_BlockchainInfo_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\023common/ledger.proto\022\006common\"U\n\016Blockch" +
"ainInfo\022\016\n\006height\030\001 \001(\004\022\030\n\020currentBlockH" +
"ash\030\002 \001(\014\022\031\n\021previousBlockHash\030\003 \001(\014BS\n$" +
"org.hyperledger.fabric.protos.commonZ+gi" +
"thub.com/hyperledger/fabric/protos/commo" +
"nb\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_common_BlockchainInfo_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_common_BlockchainInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_BlockchainInfo_descriptor,
new java.lang.String[] { "Height", "CurrentBlockHash", "PreviousBlockHash", });
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy