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

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

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

package tech.confio.ics23;

/**
 * 
 **
 *InnerOp represents a merkle-proof step that is not a leaf.
 *It represents concatenating two children and hashing them to provide the next result.
 *The result of the previous step is passed in, so the signature of this op is:
 *innerOp(child) -> output
 *The result of applying InnerOp should be:
 *output = op.hash(op.prefix || child || op.suffix)
 *where the || operator is concatenation of binary data,
 *and child is the result of hashing all the tree below this step.
 *Any special data, like prepending child with the length, or prepending the entire operation with
 *some value to differentiate from leaf nodes, should be included in prefix and suffix.
 *If either of prefix or suffix is empty, we just treat it as an empty string
 * 
* * Protobuf type {@code ics23.InnerOp} */ public final class InnerOp extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:ics23.InnerOp) InnerOpOrBuilder { private static final long serialVersionUID = 0L; // Use InnerOp.newBuilder() to construct. private InnerOp(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private InnerOp() { hash_ = 0; prefix_ = com.google.protobuf.ByteString.EMPTY; suffix_ = com.google.protobuf.ByteString.EMPTY; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private InnerOp( 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 18: { prefix_ = input.readBytes(); break; } case 26: { suffix_ = 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_InnerOp_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return tech.confio.ics23.Proofs.internal_static_ics23_InnerOp_fieldAccessorTable .ensureFieldAccessorsInitialized( tech.confio.ics23.InnerOp.class, tech.confio.ics23.InnerOp.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 PREFIX_FIELD_NUMBER = 2; private com.google.protobuf.ByteString prefix_; /** * bytes prefix = 2; */ public com.google.protobuf.ByteString getPrefix() { return prefix_; } public static final int SUFFIX_FIELD_NUMBER = 3; private com.google.protobuf.ByteString suffix_; /** * bytes suffix = 3; */ public com.google.protobuf.ByteString getSuffix() { return suffix_; } 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 (!prefix_.isEmpty()) { output.writeBytes(2, prefix_); } if (!suffix_.isEmpty()) { output.writeBytes(3, suffix_); } 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 (!prefix_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, prefix_); } if (!suffix_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, suffix_); } 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.InnerOp)) { return super.equals(obj); } tech.confio.ics23.InnerOp other = (tech.confio.ics23.InnerOp) obj; boolean result = true; result = result && hash_ == other.hash_; result = result && getPrefix() .equals(other.getPrefix()); result = result && getSuffix() .equals(other.getSuffix()); 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) + PREFIX_FIELD_NUMBER; hash = (53 * hash) + getPrefix().hashCode(); hash = (37 * hash) + SUFFIX_FIELD_NUMBER; hash = (53 * hash) + getSuffix().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static tech.confio.ics23.InnerOp parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static tech.confio.ics23.InnerOp 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.InnerOp parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static tech.confio.ics23.InnerOp 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.InnerOp parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static tech.confio.ics23.InnerOp parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static tech.confio.ics23.InnerOp parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static tech.confio.ics23.InnerOp 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.InnerOp parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static tech.confio.ics23.InnerOp 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.InnerOp parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static tech.confio.ics23.InnerOp 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.InnerOp 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; } /** *
   **
   *InnerOp represents a merkle-proof step that is not a leaf.
   *It represents concatenating two children and hashing them to provide the next result.
   *The result of the previous step is passed in, so the signature of this op is:
   *innerOp(child) -> output
   *The result of applying InnerOp should be:
   *output = op.hash(op.prefix || child || op.suffix)
   *where the || operator is concatenation of binary data,
   *and child is the result of hashing all the tree below this step.
   *Any special data, like prepending child with the length, or prepending the entire operation with
   *some value to differentiate from leaf nodes, should be included in prefix and suffix.
   *If either of prefix or suffix is empty, we just treat it as an empty string
   * 
* * Protobuf type {@code ics23.InnerOp} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:ics23.InnerOp) tech.confio.ics23.InnerOpOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return tech.confio.ics23.Proofs.internal_static_ics23_InnerOp_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return tech.confio.ics23.Proofs.internal_static_ics23_InnerOp_fieldAccessorTable .ensureFieldAccessorsInitialized( tech.confio.ics23.InnerOp.class, tech.confio.ics23.InnerOp.Builder.class); } // Construct using tech.confio.ics23.InnerOp.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; prefix_ = com.google.protobuf.ByteString.EMPTY; suffix_ = 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_InnerOp_descriptor; } @java.lang.Override public tech.confio.ics23.InnerOp getDefaultInstanceForType() { return tech.confio.ics23.InnerOp.getDefaultInstance(); } @java.lang.Override public tech.confio.ics23.InnerOp build() { tech.confio.ics23.InnerOp result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public tech.confio.ics23.InnerOp buildPartial() { tech.confio.ics23.InnerOp result = new tech.confio.ics23.InnerOp(this); result.hash_ = hash_; result.prefix_ = prefix_; result.suffix_ = suffix_; 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.InnerOp) { return mergeFrom((tech.confio.ics23.InnerOp)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(tech.confio.ics23.InnerOp other) { if (other == tech.confio.ics23.InnerOp.getDefaultInstance()) return this; if (other.hash_ != 0) { setHashValue(other.getHashValue()); } if (other.getPrefix() != com.google.protobuf.ByteString.EMPTY) { setPrefix(other.getPrefix()); } if (other.getSuffix() != com.google.protobuf.ByteString.EMPTY) { setSuffix(other.getSuffix()); } 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.InnerOp parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (tech.confio.ics23.InnerOp) 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 com.google.protobuf.ByteString prefix_ = com.google.protobuf.ByteString.EMPTY; /** * bytes prefix = 2; */ public com.google.protobuf.ByteString getPrefix() { return prefix_; } /** * bytes prefix = 2; */ public Builder setPrefix(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } prefix_ = value; onChanged(); return this; } /** * bytes prefix = 2; */ public Builder clearPrefix() { prefix_ = getDefaultInstance().getPrefix(); onChanged(); return this; } private com.google.protobuf.ByteString suffix_ = com.google.protobuf.ByteString.EMPTY; /** * bytes suffix = 3; */ public com.google.protobuf.ByteString getSuffix() { return suffix_; } /** * bytes suffix = 3; */ public Builder setSuffix(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } suffix_ = value; onChanged(); return this; } /** * bytes suffix = 3; */ public Builder clearSuffix() { suffix_ = getDefaultInstance().getSuffix(); 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.InnerOp) } // @@protoc_insertion_point(class_scope:ics23.InnerOp) private static final tech.confio.ics23.InnerOp DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new tech.confio.ics23.InnerOp(); } public static tech.confio.ics23.InnerOp getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public InnerOp parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new InnerOp(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.InnerOp getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy