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

tech.confio.ics23.LeafOp Maven / Gradle / Ivy

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: confio/proofs.proto

package tech.confio.ics23;

/**
 * 
 **
 *LeafOp represents the raw key-value data we wish to prove, and
 *must be flexible to represent the internal transformation from
 *the original key-value pairs into the basis hash, for many existing
 *merkle trees.
 *key and value are passed in. So that the signature of this operation is:
 *leafOp(key, value) -> output
 *To process this, first prehash the keys and values if needed (ANY means no hash in this case):
 *hkey = prehashKey(key)
 *hvalue = prehashValue(value)
 *Then combine the bytes, and hash it
 *output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
 * 
* * Protobuf type {@code ics23.LeafOp} */ public final class LeafOp extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:ics23.LeafOp) LeafOpOrBuilder { private static final long serialVersionUID = 0L; // Use LeafOp.newBuilder() to construct. private LeafOp(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private LeafOp() { hash_ = 0; prehashKey_ = 0; prehashValue_ = 0; length_ = 0; prefix_ = com.google.protobuf.ByteString.EMPTY; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private LeafOp( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); hash_ = rawValue; break; } case 16: { int rawValue = input.readEnum(); prehashKey_ = rawValue; break; } case 24: { int rawValue = input.readEnum(); prehashValue_ = rawValue; break; } case 32: { int rawValue = input.readEnum(); length_ = rawValue; break; } case 42: { prefix_ = input.readBytes(); break; } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } 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 { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return tech.confio.ics23.Proofs.internal_static_ics23_LeafOp_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return tech.confio.ics23.Proofs.internal_static_ics23_LeafOp_fieldAccessorTable .ensureFieldAccessorsInitialized( tech.confio.ics23.LeafOp.class, tech.confio.ics23.LeafOp.Builder.class); } public static final int HASH_FIELD_NUMBER = 1; private int hash_; /** * .ics23.HashOp hash = 1; */ public int getHashValue() { return hash_; } /** * .ics23.HashOp hash = 1; */ public tech.confio.ics23.HashOp getHash() { @SuppressWarnings("deprecation") tech.confio.ics23.HashOp result = tech.confio.ics23.HashOp.valueOf(hash_); return result == null ? tech.confio.ics23.HashOp.UNRECOGNIZED : result; } public static final int PREHASH_KEY_FIELD_NUMBER = 2; private int prehashKey_; /** * .ics23.HashOp prehash_key = 2; */ public int getPrehashKeyValue() { return prehashKey_; } /** * .ics23.HashOp prehash_key = 2; */ public tech.confio.ics23.HashOp getPrehashKey() { @SuppressWarnings("deprecation") tech.confio.ics23.HashOp result = tech.confio.ics23.HashOp.valueOf(prehashKey_); return result == null ? tech.confio.ics23.HashOp.UNRECOGNIZED : result; } public static final int PREHASH_VALUE_FIELD_NUMBER = 3; private int prehashValue_; /** * .ics23.HashOp prehash_value = 3; */ public int getPrehashValueValue() { return prehashValue_; } /** * .ics23.HashOp prehash_value = 3; */ public tech.confio.ics23.HashOp getPrehashValue() { @SuppressWarnings("deprecation") tech.confio.ics23.HashOp result = tech.confio.ics23.HashOp.valueOf(prehashValue_); return result == null ? tech.confio.ics23.HashOp.UNRECOGNIZED : result; } public static final int LENGTH_FIELD_NUMBER = 4; private int length_; /** * .ics23.LengthOp length = 4; */ public int getLengthValue() { return length_; } /** * .ics23.LengthOp length = 4; */ public tech.confio.ics23.LengthOp getLength() { @SuppressWarnings("deprecation") tech.confio.ics23.LengthOp result = tech.confio.ics23.LengthOp.valueOf(length_); return result == null ? tech.confio.ics23.LengthOp.UNRECOGNIZED : result; } public static final int PREFIX_FIELD_NUMBER = 5; private com.google.protobuf.ByteString prefix_; /** *
   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
   * a leaf node from an inner node.
   * 
* * bytes prefix = 5; */ public com.google.protobuf.ByteString getPrefix() { return prefix_; } 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 (hash_ != tech.confio.ics23.HashOp.NO_HASH.getNumber()) { output.writeEnum(1, hash_); } if (prehashKey_ != tech.confio.ics23.HashOp.NO_HASH.getNumber()) { output.writeEnum(2, prehashKey_); } if (prehashValue_ != tech.confio.ics23.HashOp.NO_HASH.getNumber()) { output.writeEnum(3, prehashValue_); } if (length_ != tech.confio.ics23.LengthOp.NO_PREFIX.getNumber()) { output.writeEnum(4, length_); } if (!prefix_.isEmpty()) { output.writeBytes(5, prefix_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (hash_ != tech.confio.ics23.HashOp.NO_HASH.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, hash_); } if (prehashKey_ != tech.confio.ics23.HashOp.NO_HASH.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, prehashKey_); } if (prehashValue_ != tech.confio.ics23.HashOp.NO_HASH.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, prehashValue_); } if (length_ != tech.confio.ics23.LengthOp.NO_PREFIX.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, length_); } if (!prefix_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, prefix_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof tech.confio.ics23.LeafOp)) { return super.equals(obj); } tech.confio.ics23.LeafOp other = (tech.confio.ics23.LeafOp) obj; boolean result = true; result = result && hash_ == other.hash_; result = result && prehashKey_ == other.prehashKey_; result = result && prehashValue_ == other.prehashValue_; result = result && length_ == other.length_; result = result && getPrefix() .equals(other.getPrefix()); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + HASH_FIELD_NUMBER; hash = (53 * hash) + hash_; hash = (37 * hash) + PREHASH_KEY_FIELD_NUMBER; hash = (53 * hash) + prehashKey_; hash = (37 * hash) + PREHASH_VALUE_FIELD_NUMBER; hash = (53 * hash) + prehashValue_; hash = (37 * hash) + LENGTH_FIELD_NUMBER; hash = (53 * hash) + length_; hash = (37 * hash) + PREFIX_FIELD_NUMBER; hash = (53 * hash) + getPrefix().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static tech.confio.ics23.LeafOp parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static tech.confio.ics23.LeafOp parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static tech.confio.ics23.LeafOp parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static tech.confio.ics23.LeafOp parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static tech.confio.ics23.LeafOp parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static tech.confio.ics23.LeafOp parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static tech.confio.ics23.LeafOp parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static tech.confio.ics23.LeafOp 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 tech.confio.ics23.LeafOp parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static tech.confio.ics23.LeafOp 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 tech.confio.ics23.LeafOp parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static tech.confio.ics23.LeafOp parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(tech.confio.ics23.LeafOp 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.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   **
   *LeafOp represents the raw key-value data we wish to prove, and
   *must be flexible to represent the internal transformation from
   *the original key-value pairs into the basis hash, for many existing
   *merkle trees.
   *key and value are passed in. So that the signature of this operation is:
   *leafOp(key, value) -> output
   *To process this, first prehash the keys and values if needed (ANY means no hash in this case):
   *hkey = prehashKey(key)
   *hvalue = prehashValue(value)
   *Then combine the bytes, and hash it
   *output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
   * 
* * Protobuf type {@code ics23.LeafOp} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:ics23.LeafOp) tech.confio.ics23.LeafOpOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return tech.confio.ics23.Proofs.internal_static_ics23_LeafOp_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return tech.confio.ics23.Proofs.internal_static_ics23_LeafOp_fieldAccessorTable .ensureFieldAccessorsInitialized( tech.confio.ics23.LeafOp.class, tech.confio.ics23.LeafOp.Builder.class); } // Construct using tech.confio.ics23.LeafOp.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); hash_ = 0; prehashKey_ = 0; prehashValue_ = 0; length_ = 0; prefix_ = com.google.protobuf.ByteString.EMPTY; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return tech.confio.ics23.Proofs.internal_static_ics23_LeafOp_descriptor; } @java.lang.Override public tech.confio.ics23.LeafOp getDefaultInstanceForType() { return tech.confio.ics23.LeafOp.getDefaultInstance(); } @java.lang.Override public tech.confio.ics23.LeafOp build() { tech.confio.ics23.LeafOp result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public tech.confio.ics23.LeafOp buildPartial() { tech.confio.ics23.LeafOp result = new tech.confio.ics23.LeafOp(this); result.hash_ = hash_; result.prehashKey_ = prehashKey_; result.prehashValue_ = prehashValue_; result.length_ = length_; result.prefix_ = prefix_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof tech.confio.ics23.LeafOp) { return mergeFrom((tech.confio.ics23.LeafOp)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(tech.confio.ics23.LeafOp other) { if (other == tech.confio.ics23.LeafOp.getDefaultInstance()) return this; if (other.hash_ != 0) { setHashValue(other.getHashValue()); } if (other.prehashKey_ != 0) { setPrehashKeyValue(other.getPrehashKeyValue()); } if (other.prehashValue_ != 0) { setPrehashValueValue(other.getPrehashValueValue()); } if (other.length_ != 0) { setLengthValue(other.getLengthValue()); } if (other.getPrefix() != com.google.protobuf.ByteString.EMPTY) { setPrefix(other.getPrefix()); } this.mergeUnknownFields(other.unknownFields); 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 { tech.confio.ics23.LeafOp parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (tech.confio.ics23.LeafOp) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int hash_ = 0; /** * .ics23.HashOp hash = 1; */ public int getHashValue() { return hash_; } /** * .ics23.HashOp hash = 1; */ public Builder setHashValue(int value) { hash_ = value; onChanged(); return this; } /** * .ics23.HashOp hash = 1; */ public tech.confio.ics23.HashOp getHash() { @SuppressWarnings("deprecation") tech.confio.ics23.HashOp result = tech.confio.ics23.HashOp.valueOf(hash_); return result == null ? tech.confio.ics23.HashOp.UNRECOGNIZED : result; } /** * .ics23.HashOp hash = 1; */ public Builder setHash(tech.confio.ics23.HashOp value) { if (value == null) { throw new NullPointerException(); } hash_ = value.getNumber(); onChanged(); return this; } /** * .ics23.HashOp hash = 1; */ public Builder clearHash() { hash_ = 0; onChanged(); return this; } private int prehashKey_ = 0; /** * .ics23.HashOp prehash_key = 2; */ public int getPrehashKeyValue() { return prehashKey_; } /** * .ics23.HashOp prehash_key = 2; */ public Builder setPrehashKeyValue(int value) { prehashKey_ = value; onChanged(); return this; } /** * .ics23.HashOp prehash_key = 2; */ public tech.confio.ics23.HashOp getPrehashKey() { @SuppressWarnings("deprecation") tech.confio.ics23.HashOp result = tech.confio.ics23.HashOp.valueOf(prehashKey_); return result == null ? tech.confio.ics23.HashOp.UNRECOGNIZED : result; } /** * .ics23.HashOp prehash_key = 2; */ public Builder setPrehashKey(tech.confio.ics23.HashOp value) { if (value == null) { throw new NullPointerException(); } prehashKey_ = value.getNumber(); onChanged(); return this; } /** * .ics23.HashOp prehash_key = 2; */ public Builder clearPrehashKey() { prehashKey_ = 0; onChanged(); return this; } private int prehashValue_ = 0; /** * .ics23.HashOp prehash_value = 3; */ public int getPrehashValueValue() { return prehashValue_; } /** * .ics23.HashOp prehash_value = 3; */ public Builder setPrehashValueValue(int value) { prehashValue_ = value; onChanged(); return this; } /** * .ics23.HashOp prehash_value = 3; */ public tech.confio.ics23.HashOp getPrehashValue() { @SuppressWarnings("deprecation") tech.confio.ics23.HashOp result = tech.confio.ics23.HashOp.valueOf(prehashValue_); return result == null ? tech.confio.ics23.HashOp.UNRECOGNIZED : result; } /** * .ics23.HashOp prehash_value = 3; */ public Builder setPrehashValue(tech.confio.ics23.HashOp value) { if (value == null) { throw new NullPointerException(); } prehashValue_ = value.getNumber(); onChanged(); return this; } /** * .ics23.HashOp prehash_value = 3; */ public Builder clearPrehashValue() { prehashValue_ = 0; onChanged(); return this; } private int length_ = 0; /** * .ics23.LengthOp length = 4; */ public int getLengthValue() { return length_; } /** * .ics23.LengthOp length = 4; */ public Builder setLengthValue(int value) { length_ = value; onChanged(); return this; } /** * .ics23.LengthOp length = 4; */ public tech.confio.ics23.LengthOp getLength() { @SuppressWarnings("deprecation") tech.confio.ics23.LengthOp result = tech.confio.ics23.LengthOp.valueOf(length_); return result == null ? tech.confio.ics23.LengthOp.UNRECOGNIZED : result; } /** * .ics23.LengthOp length = 4; */ public Builder setLength(tech.confio.ics23.LengthOp value) { if (value == null) { throw new NullPointerException(); } length_ = value.getNumber(); onChanged(); return this; } /** * .ics23.LengthOp length = 4; */ public Builder clearLength() { length_ = 0; onChanged(); return this; } private com.google.protobuf.ByteString prefix_ = com.google.protobuf.ByteString.EMPTY; /** *
     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
     * a leaf node from an inner node.
     * 
* * bytes prefix = 5; */ public com.google.protobuf.ByteString getPrefix() { return prefix_; } /** *
     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
     * a leaf node from an inner node.
     * 
* * bytes prefix = 5; */ public Builder setPrefix(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } prefix_ = value; onChanged(); return this; } /** *
     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
     * a leaf node from an inner node.
     * 
* * bytes prefix = 5; */ public Builder clearPrefix() { prefix_ = getDefaultInstance().getPrefix(); onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:ics23.LeafOp) } // @@protoc_insertion_point(class_scope:ics23.LeafOp) private static final tech.confio.ics23.LeafOp DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new tech.confio.ics23.LeafOp(); } public static tech.confio.ics23.LeafOp getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public LeafOp parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new LeafOp(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public tech.confio.ics23.LeafOp getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy