ObjectIdentifierValuePair.java

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

package dev.sigstore.proto.common.v1;

/**
 * <pre>
 * An OID and the corresponding (byte) value.
 * </pre>
 *
 * Protobuf type {@code dev.sigstore.common.v1.ObjectIdentifierValuePair}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:ObjectIdentifierValuePair.java.pb.meta")
public final class ObjectIdentifierValuePair extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:dev.sigstore.common.v1.ObjectIdentifierValuePair)
    ObjectIdentifierValuePairOrBuilder {
private static final long serialVersionUID = 0L;
  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
      /* major= */ 4,
      /* minor= */ 30,
      /* patch= */ 2,
      /* suffix= */ "",
      ObjectIdentifierValuePair.class.getName());
  }
  // Use ObjectIdentifierValuePair.newBuilder() to construct.
  private ObjectIdentifierValuePair(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }
  private ObjectIdentifierValuePair() {
    value_ = com.google.protobuf.ByteString.EMPTY;
  }

  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_ObjectIdentifierValuePair_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_ObjectIdentifierValuePair_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.class, dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.Builder.class);
  }

  private int bitField0_;
  public static final int OID_FIELD_NUMBER = 1;
  private dev.sigstore.proto.common.v1.ObjectIdentifier oid_;
  /**
   * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
   * @return Whether the oid field is set.
   */
  @java.lang.Override
  public boolean hasOid() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
   * @return The oid.
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.ObjectIdentifier getOid() {
    return oid_ == null ? dev.sigstore.proto.common.v1.ObjectIdentifier.getDefaultInstance() : oid_;
  }
  /**
   * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.ObjectIdentifierOrBuilder getOidOrBuilder() {
    return oid_ == null ? dev.sigstore.proto.common.v1.ObjectIdentifier.getDefaultInstance() : oid_;
  }

  public static final int VALUE_FIELD_NUMBER = 2;
  private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
  /**
   * <code>bytes value = 2;</code>
   * @return The value.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getValue() {
    return value_;
  }

  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 (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(1, getOid());
    }
    if (!value_.isEmpty()) {
      output.writeBytes(2, value_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, getOid());
    }
    if (!value_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(2, value_);
    }
    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 dev.sigstore.proto.common.v1.ObjectIdentifierValuePair)) {
      return super.equals(obj);
    }
    dev.sigstore.proto.common.v1.ObjectIdentifierValuePair other = (dev.sigstore.proto.common.v1.ObjectIdentifierValuePair) obj;

    if (hasOid() != other.hasOid()) return false;
    if (hasOid()) {
      if (!getOid()
          .equals(other.getOid())) return false;
    }
    if (!getValue()
        .equals(other.getValue())) 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();
    if (hasOid()) {
      hash = (37 * hash) + OID_FIELD_NUMBER;
      hash = (53 * hash) + getOid().hashCode();
    }
    hash = (37 * hash) + VALUE_FIELD_NUMBER;
    hash = (53 * hash) + getValue().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair 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 dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair 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 dev.sigstore.proto.common.v1.ObjectIdentifierValuePair parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair 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(dev.sigstore.proto.common.v1.ObjectIdentifierValuePair 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;
  }
  /**
   * <pre>
   * An OID and the corresponding (byte) value.
   * </pre>
   *
   * Protobuf type {@code dev.sigstore.common.v1.ObjectIdentifierValuePair}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:dev.sigstore.common.v1.ObjectIdentifierValuePair)
      dev.sigstore.proto.common.v1.ObjectIdentifierValuePairOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_ObjectIdentifierValuePair_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_ObjectIdentifierValuePair_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.class, dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.Builder.class);
    }

    // Construct using dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage
              .alwaysUseFieldBuilders) {
        internalGetOidFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      oid_ = null;
      if (oidBuilder_ != null) {
        oidBuilder_.dispose();
        oidBuilder_ = null;
      }
      value_ = com.google.protobuf.ByteString.EMPTY;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_ObjectIdentifierValuePair_descriptor;
    }

    @java.lang.Override
    public dev.sigstore.proto.common.v1.ObjectIdentifierValuePair getDefaultInstanceForType() {
      return dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.getDefaultInstance();
    }

    @java.lang.Override
    public dev.sigstore.proto.common.v1.ObjectIdentifierValuePair build() {
      dev.sigstore.proto.common.v1.ObjectIdentifierValuePair result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public dev.sigstore.proto.common.v1.ObjectIdentifierValuePair buildPartial() {
      dev.sigstore.proto.common.v1.ObjectIdentifierValuePair result = new dev.sigstore.proto.common.v1.ObjectIdentifierValuePair(this);
      if (bitField0_ != 0) { buildPartial0(result); }
      onBuilt();
      return result;
    }

    private void buildPartial0(dev.sigstore.proto.common.v1.ObjectIdentifierValuePair result) {
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.oid_ = oidBuilder_ == null
            ? oid_
            : oidBuilder_.build();
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.value_ = value_;
      }
      result.bitField0_ |= to_bitField0_;
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof dev.sigstore.proto.common.v1.ObjectIdentifierValuePair) {
        return mergeFrom((dev.sigstore.proto.common.v1.ObjectIdentifierValuePair)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(dev.sigstore.proto.common.v1.ObjectIdentifierValuePair other) {
      if (other == dev.sigstore.proto.common.v1.ObjectIdentifierValuePair.getDefaultInstance()) return this;
      if (other.hasOid()) {
        mergeOid(other.getOid());
      }
      if (!other.getValue().isEmpty()) {
        setValue(other.getValue());
      }
      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: {
              input.readMessage(
                  internalGetOidFieldBuilder().getBuilder(),
                  extensionRegistry);
              bitField0_ |= 0x00000001;
              break;
            } // case 10
            case 18: {
              value_ = input.readBytes();
              bitField0_ |= 0x00000002;
              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 dev.sigstore.proto.common.v1.ObjectIdentifier oid_;
    private com.google.protobuf.SingleFieldBuilder<
        dev.sigstore.proto.common.v1.ObjectIdentifier, dev.sigstore.proto.common.v1.ObjectIdentifier.Builder, dev.sigstore.proto.common.v1.ObjectIdentifierOrBuilder> oidBuilder_;
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     * @return Whether the oid field is set.
     */
    public boolean hasOid() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     * @return The oid.
     */
    public dev.sigstore.proto.common.v1.ObjectIdentifier getOid() {
      if (oidBuilder_ == null) {
        return oid_ == null ? dev.sigstore.proto.common.v1.ObjectIdentifier.getDefaultInstance() : oid_;
      } else {
        return oidBuilder_.getMessage();
      }
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    public Builder setOid(dev.sigstore.proto.common.v1.ObjectIdentifier value) {
      if (oidBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        oid_ = value;
      } else {
        oidBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    public Builder setOid(
        dev.sigstore.proto.common.v1.ObjectIdentifier.Builder builderForValue) {
      if (oidBuilder_ == null) {
        oid_ = builderForValue.build();
      } else {
        oidBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    public Builder mergeOid(dev.sigstore.proto.common.v1.ObjectIdentifier value) {
      if (oidBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0) &&
          oid_ != null &&
          oid_ != dev.sigstore.proto.common.v1.ObjectIdentifier.getDefaultInstance()) {
          getOidBuilder().mergeFrom(value);
        } else {
          oid_ = value;
        }
      } else {
        oidBuilder_.mergeFrom(value);
      }
      if (oid_ != null) {
        bitField0_ |= 0x00000001;
        onChanged();
      }
      return this;
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    public Builder clearOid() {
      bitField0_ = (bitField0_ & ~0x00000001);
      oid_ = null;
      if (oidBuilder_ != null) {
        oidBuilder_.dispose();
        oidBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    public dev.sigstore.proto.common.v1.ObjectIdentifier.Builder getOidBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return internalGetOidFieldBuilder().getBuilder();
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    public dev.sigstore.proto.common.v1.ObjectIdentifierOrBuilder getOidOrBuilder() {
      if (oidBuilder_ != null) {
        return oidBuilder_.getMessageOrBuilder();
      } else {
        return oid_ == null ?
            dev.sigstore.proto.common.v1.ObjectIdentifier.getDefaultInstance() : oid_;
      }
    }
    /**
     * <code>.dev.sigstore.common.v1.ObjectIdentifier oid = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilder<
        dev.sigstore.proto.common.v1.ObjectIdentifier, dev.sigstore.proto.common.v1.ObjectIdentifier.Builder, dev.sigstore.proto.common.v1.ObjectIdentifierOrBuilder> 
        internalGetOidFieldBuilder() {
      if (oidBuilder_ == null) {
        oidBuilder_ = new com.google.protobuf.SingleFieldBuilder<
            dev.sigstore.proto.common.v1.ObjectIdentifier, dev.sigstore.proto.common.v1.ObjectIdentifier.Builder, dev.sigstore.proto.common.v1.ObjectIdentifierOrBuilder>(
                getOid(),
                getParentForChildren(),
                isClean());
        oid_ = null;
      }
      return oidBuilder_;
    }

    private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
    /**
     * <code>bytes value = 2;</code>
     * @return The value.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getValue() {
      return value_;
    }
    /**
     * <code>bytes value = 2;</code>
     * @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_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     * <code>bytes value = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearValue() {
      bitField0_ = (bitField0_ & ~0x00000002);
      value_ = getDefaultInstance().getValue();
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:dev.sigstore.common.v1.ObjectIdentifierValuePair)
  }

  // @@protoc_insertion_point(class_scope:dev.sigstore.common.v1.ObjectIdentifierValuePair)
  private static final dev.sigstore.proto.common.v1.ObjectIdentifierValuePair DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new dev.sigstore.proto.common.v1.ObjectIdentifierValuePair();
  }

  public static dev.sigstore.proto.common.v1.ObjectIdentifierValuePair getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ObjectIdentifierValuePair>
      PARSER = new com.google.protobuf.AbstractParser<ObjectIdentifierValuePair>() {
    @java.lang.Override
    public ObjectIdentifierValuePair 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<ObjectIdentifierValuePair> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ObjectIdentifierValuePair> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public dev.sigstore.proto.common.v1.ObjectIdentifierValuePair getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}