// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tribuo-clustering-hdbscan.proto

package org.tribuo.clustering.hdbscan.protos;

/**
 * <pre>
 *HdbscanModel proto
 * </pre>
 *
 * Protobuf type {@code tribuo.clustering.hdbscan.HdbscanModelProto}
 */
public final class HdbscanModelProto extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tribuo.clustering.hdbscan.HdbscanModelProto)
    HdbscanModelProtoOrBuilder {
private static final long serialVersionUID = 0L;
  // Use HdbscanModelProto.newBuilder() to construct.
  private HdbscanModelProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private HdbscanModelProto() {
    clusterLabels_ = emptyIntList();
    clusterExemplars_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new HdbscanModelProto();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private HdbscanModelProto(
      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 10: {
            org.tribuo.protos.core.ModelDataProto.Builder subBuilder = null;
            if (metadata_ != null) {
              subBuilder = metadata_.toBuilder();
            }
            metadata_ = input.readMessage(org.tribuo.protos.core.ModelDataProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(metadata_);
              metadata_ = subBuilder.buildPartial();
            }

            break;
          }
          case 16: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              clusterLabels_ = newIntList();
              mutable_bitField0_ |= 0x00000001;
            }
            clusterLabels_.addInt(input.readInt32());
            break;
          }
          case 18: {
            int length = input.readRawVarint32();
            int limit = input.pushLimit(length);
            if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
              clusterLabels_ = newIntList();
              mutable_bitField0_ |= 0x00000001;
            }
            while (input.getBytesUntilLimit() > 0) {
              clusterLabels_.addInt(input.readInt32());
            }
            input.popLimit(limit);
            break;
          }
          case 26: {
            org.tribuo.math.protos.TensorProto.Builder subBuilder = null;
            if (outlierScoresVector_ != null) {
              subBuilder = outlierScoresVector_.toBuilder();
            }
            outlierScoresVector_ = input.readMessage(org.tribuo.math.protos.TensorProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(outlierScoresVector_);
              outlierScoresVector_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {
            org.tribuo.math.protos.DistanceProto.Builder subBuilder = null;
            if (distance_ != null) {
              subBuilder = distance_.toBuilder();
            }
            distance_ = input.readMessage(org.tribuo.math.protos.DistanceProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(distance_);
              distance_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              clusterExemplars_ = new java.util.ArrayList<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto>();
              mutable_bitField0_ |= 0x00000002;
            }
            clusterExemplars_.add(
                input.readMessage(org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.parser(), extensionRegistry));
            break;
          }
          case 49: {

            noisePointsOutlierScore_ = input.readDouble();
            break;
          }
          default: {
            if (!parseUnknownField(
                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 {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        clusterLabels_.makeImmutable(); // C
      }
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        clusterExemplars_ = java.util.Collections.unmodifiableList(clusterExemplars_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tribuo.clustering.hdbscan.protos.TribuoClusteringHdbscan.internal_static_tribuo_clustering_hdbscan_HdbscanModelProto_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tribuo.clustering.hdbscan.protos.TribuoClusteringHdbscan.internal_static_tribuo_clustering_hdbscan_HdbscanModelProto_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.class, org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.Builder.class);
  }

  public static final int METADATA_FIELD_NUMBER = 1;
  private org.tribuo.protos.core.ModelDataProto metadata_;
  /**
   * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
   * @return Whether the metadata field is set.
   */
  @java.lang.Override
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
   * @return The metadata.
   */
  @java.lang.Override
  public org.tribuo.protos.core.ModelDataProto getMetadata() {
    return metadata_ == null ? org.tribuo.protos.core.ModelDataProto.getDefaultInstance() : metadata_;
  }
  /**
   * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
   */
  @java.lang.Override
  public org.tribuo.protos.core.ModelDataProtoOrBuilder getMetadataOrBuilder() {
    return getMetadata();
  }

  public static final int CLUSTER_LABELS_FIELD_NUMBER = 2;
  private com.google.protobuf.Internal.IntList clusterLabels_;
  /**
   * <code>repeated int32 cluster_labels = 2;</code>
   * @return A list containing the clusterLabels.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer>
      getClusterLabelsList() {
    return clusterLabels_;
  }
  /**
   * <code>repeated int32 cluster_labels = 2;</code>
   * @return The count of clusterLabels.
   */
  public int getClusterLabelsCount() {
    return clusterLabels_.size();
  }
  /**
   * <code>repeated int32 cluster_labels = 2;</code>
   * @param index The index of the element to return.
   * @return The clusterLabels at the given index.
   */
  public int getClusterLabels(int index) {
    return clusterLabels_.getInt(index);
  }
  private int clusterLabelsMemoizedSerializedSize = -1;

  public static final int OUTLIER_SCORES_VECTOR_FIELD_NUMBER = 3;
  private org.tribuo.math.protos.TensorProto outlierScoresVector_;
  /**
   * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
   * @return Whether the outlierScoresVector field is set.
   */
  @java.lang.Override
  public boolean hasOutlierScoresVector() {
    return outlierScoresVector_ != null;
  }
  /**
   * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
   * @return The outlierScoresVector.
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProto getOutlierScoresVector() {
    return outlierScoresVector_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : outlierScoresVector_;
  }
  /**
   * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProtoOrBuilder getOutlierScoresVectorOrBuilder() {
    return getOutlierScoresVector();
  }

  public static final int DISTANCE_FIELD_NUMBER = 4;
  private org.tribuo.math.protos.DistanceProto distance_;
  /**
   * <code>.tribuo.math.DistanceProto distance = 4;</code>
   * @return Whether the distance field is set.
   */
  @java.lang.Override
  public boolean hasDistance() {
    return distance_ != null;
  }
  /**
   * <code>.tribuo.math.DistanceProto distance = 4;</code>
   * @return The distance.
   */
  @java.lang.Override
  public org.tribuo.math.protos.DistanceProto getDistance() {
    return distance_ == null ? org.tribuo.math.protos.DistanceProto.getDefaultInstance() : distance_;
  }
  /**
   * <code>.tribuo.math.DistanceProto distance = 4;</code>
   */
  @java.lang.Override
  public org.tribuo.math.protos.DistanceProtoOrBuilder getDistanceOrBuilder() {
    return getDistance();
  }

  public static final int CLUSTER_EXEMPLARS_FIELD_NUMBER = 5;
  private java.util.List<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto> clusterExemplars_;
  /**
   * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
   */
  @java.lang.Override
  public java.util.List<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto> getClusterExemplarsList() {
    return clusterExemplars_;
  }
  /**
   * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
   */
  @java.lang.Override
  public java.util.List<? extends org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder> 
      getClusterExemplarsOrBuilderList() {
    return clusterExemplars_;
  }
  /**
   * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
   */
  @java.lang.Override
  public int getClusterExemplarsCount() {
    return clusterExemplars_.size();
  }
  /**
   * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
   */
  @java.lang.Override
  public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto getClusterExemplars(int index) {
    return clusterExemplars_.get(index);
  }
  /**
   * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
   */
  @java.lang.Override
  public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder getClusterExemplarsOrBuilder(
      int index) {
    return clusterExemplars_.get(index);
  }

  public static final int NOISE_POINTS_OUTLIER_SCORE_FIELD_NUMBER = 6;
  private double noisePointsOutlierScore_;
  /**
   * <code>double noise_points_outlier_score = 6;</code>
   * @return The noisePointsOutlierScore.
   */
  @java.lang.Override
  public double getNoisePointsOutlierScore() {
    return noisePointsOutlierScore_;
  }

  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 {
    getSerializedSize();
    if (metadata_ != null) {
      output.writeMessage(1, getMetadata());
    }
    if (getClusterLabelsList().size() > 0) {
      output.writeUInt32NoTag(18);
      output.writeUInt32NoTag(clusterLabelsMemoizedSerializedSize);
    }
    for (int i = 0; i < clusterLabels_.size(); i++) {
      output.writeInt32NoTag(clusterLabels_.getInt(i));
    }
    if (outlierScoresVector_ != null) {
      output.writeMessage(3, getOutlierScoresVector());
    }
    if (distance_ != null) {
      output.writeMessage(4, getDistance());
    }
    for (int i = 0; i < clusterExemplars_.size(); i++) {
      output.writeMessage(5, clusterExemplars_.get(i));
    }
    if (java.lang.Double.doubleToRawLongBits(noisePointsOutlierScore_) != 0) {
      output.writeDouble(6, noisePointsOutlierScore_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (metadata_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, getMetadata());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < clusterLabels_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream
          .computeInt32SizeNoTag(clusterLabels_.getInt(i));
      }
      size += dataSize;
      if (!getClusterLabelsList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(dataSize);
      }
      clusterLabelsMemoizedSerializedSize = dataSize;
    }
    if (outlierScoresVector_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getOutlierScoresVector());
    }
    if (distance_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getDistance());
    }
    for (int i = 0; i < clusterExemplars_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, clusterExemplars_.get(i));
    }
    if (java.lang.Double.doubleToRawLongBits(noisePointsOutlierScore_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(6, noisePointsOutlierScore_);
    }
    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 org.tribuo.clustering.hdbscan.protos.HdbscanModelProto)) {
      return super.equals(obj);
    }
    org.tribuo.clustering.hdbscan.protos.HdbscanModelProto other = (org.tribuo.clustering.hdbscan.protos.HdbscanModelProto) obj;

    if (hasMetadata() != other.hasMetadata()) return false;
    if (hasMetadata()) {
      if (!getMetadata()
          .equals(other.getMetadata())) return false;
    }
    if (!getClusterLabelsList()
        .equals(other.getClusterLabelsList())) return false;
    if (hasOutlierScoresVector() != other.hasOutlierScoresVector()) return false;
    if (hasOutlierScoresVector()) {
      if (!getOutlierScoresVector()
          .equals(other.getOutlierScoresVector())) return false;
    }
    if (hasDistance() != other.hasDistance()) return false;
    if (hasDistance()) {
      if (!getDistance()
          .equals(other.getDistance())) return false;
    }
    if (!getClusterExemplarsList()
        .equals(other.getClusterExemplarsList())) return false;
    if (java.lang.Double.doubleToLongBits(getNoisePointsOutlierScore())
        != java.lang.Double.doubleToLongBits(
            other.getNoisePointsOutlierScore())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasMetadata()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getMetadata().hashCode();
    }
    if (getClusterLabelsCount() > 0) {
      hash = (37 * hash) + CLUSTER_LABELS_FIELD_NUMBER;
      hash = (53 * hash) + getClusterLabelsList().hashCode();
    }
    if (hasOutlierScoresVector()) {
      hash = (37 * hash) + OUTLIER_SCORES_VECTOR_FIELD_NUMBER;
      hash = (53 * hash) + getOutlierScoresVector().hashCode();
    }
    if (hasDistance()) {
      hash = (37 * hash) + DISTANCE_FIELD_NUMBER;
      hash = (53 * hash) + getDistance().hashCode();
    }
    if (getClusterExemplarsCount() > 0) {
      hash = (37 * hash) + CLUSTER_EXEMPLARS_FIELD_NUMBER;
      hash = (53 * hash) + getClusterExemplarsList().hashCode();
    }
    hash = (37 * hash) + NOISE_POINTS_OUTLIER_SCORE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getNoisePointsOutlierScore()));
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto 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.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto 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.tribuo.clustering.hdbscan.protos.HdbscanModelProto parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto 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(org.tribuo.clustering.hdbscan.protos.HdbscanModelProto 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;
  }
  /**
   * <pre>
   *HdbscanModel proto
   * </pre>
   *
   * Protobuf type {@code tribuo.clustering.hdbscan.HdbscanModelProto}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tribuo.clustering.hdbscan.HdbscanModelProto)
      org.tribuo.clustering.hdbscan.protos.HdbscanModelProtoOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tribuo.clustering.hdbscan.protos.TribuoClusteringHdbscan.internal_static_tribuo_clustering_hdbscan_HdbscanModelProto_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tribuo.clustering.hdbscan.protos.TribuoClusteringHdbscan.internal_static_tribuo_clustering_hdbscan_HdbscanModelProto_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.class, org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.Builder.class);
    }

    // Construct using org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getClusterExemplarsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (metadataBuilder_ == null) {
        metadata_ = null;
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }
      clusterLabels_ = emptyIntList();
      bitField0_ = (bitField0_ & ~0x00000001);
      if (outlierScoresVectorBuilder_ == null) {
        outlierScoresVector_ = null;
      } else {
        outlierScoresVector_ = null;
        outlierScoresVectorBuilder_ = null;
      }
      if (distanceBuilder_ == null) {
        distance_ = null;
      } else {
        distance_ = null;
        distanceBuilder_ = null;
      }
      if (clusterExemplarsBuilder_ == null) {
        clusterExemplars_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
      } else {
        clusterExemplarsBuilder_.clear();
      }
      noisePointsOutlierScore_ = 0D;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tribuo.clustering.hdbscan.protos.TribuoClusteringHdbscan.internal_static_tribuo_clustering_hdbscan_HdbscanModelProto_descriptor;
    }

    @java.lang.Override
    public org.tribuo.clustering.hdbscan.protos.HdbscanModelProto getDefaultInstanceForType() {
      return org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.getDefaultInstance();
    }

    @java.lang.Override
    public org.tribuo.clustering.hdbscan.protos.HdbscanModelProto build() {
      org.tribuo.clustering.hdbscan.protos.HdbscanModelProto result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tribuo.clustering.hdbscan.protos.HdbscanModelProto buildPartial() {
      org.tribuo.clustering.hdbscan.protos.HdbscanModelProto result = new org.tribuo.clustering.hdbscan.protos.HdbscanModelProto(this);
      int from_bitField0_ = bitField0_;
      if (metadataBuilder_ == null) {
        result.metadata_ = metadata_;
      } else {
        result.metadata_ = metadataBuilder_.build();
      }
      if (((bitField0_ & 0x00000001) != 0)) {
        clusterLabels_.makeImmutable();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.clusterLabels_ = clusterLabels_;
      if (outlierScoresVectorBuilder_ == null) {
        result.outlierScoresVector_ = outlierScoresVector_;
      } else {
        result.outlierScoresVector_ = outlierScoresVectorBuilder_.build();
      }
      if (distanceBuilder_ == null) {
        result.distance_ = distance_;
      } else {
        result.distance_ = distanceBuilder_.build();
      }
      if (clusterExemplarsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          clusterExemplars_ = java.util.Collections.unmodifiableList(clusterExemplars_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.clusterExemplars_ = clusterExemplars_;
      } else {
        result.clusterExemplars_ = clusterExemplarsBuilder_.build();
      }
      result.noisePointsOutlierScore_ = noisePointsOutlierScore_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tribuo.clustering.hdbscan.protos.HdbscanModelProto) {
        return mergeFrom((org.tribuo.clustering.hdbscan.protos.HdbscanModelProto)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tribuo.clustering.hdbscan.protos.HdbscanModelProto other) {
      if (other == org.tribuo.clustering.hdbscan.protos.HdbscanModelProto.getDefaultInstance()) return this;
      if (other.hasMetadata()) {
        mergeMetadata(other.getMetadata());
      }
      if (!other.clusterLabels_.isEmpty()) {
        if (clusterLabels_.isEmpty()) {
          clusterLabels_ = other.clusterLabels_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureClusterLabelsIsMutable();
          clusterLabels_.addAll(other.clusterLabels_);
        }
        onChanged();
      }
      if (other.hasOutlierScoresVector()) {
        mergeOutlierScoresVector(other.getOutlierScoresVector());
      }
      if (other.hasDistance()) {
        mergeDistance(other.getDistance());
      }
      if (clusterExemplarsBuilder_ == null) {
        if (!other.clusterExemplars_.isEmpty()) {
          if (clusterExemplars_.isEmpty()) {
            clusterExemplars_ = other.clusterExemplars_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureClusterExemplarsIsMutable();
            clusterExemplars_.addAll(other.clusterExemplars_);
          }
          onChanged();
        }
      } else {
        if (!other.clusterExemplars_.isEmpty()) {
          if (clusterExemplarsBuilder_.isEmpty()) {
            clusterExemplarsBuilder_.dispose();
            clusterExemplarsBuilder_ = null;
            clusterExemplars_ = other.clusterExemplars_;
            bitField0_ = (bitField0_ & ~0x00000002);
            clusterExemplarsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getClusterExemplarsFieldBuilder() : null;
          } else {
            clusterExemplarsBuilder_.addAllMessages(other.clusterExemplars_);
          }
        }
      }
      if (other.getNoisePointsOutlierScore() != 0D) {
        setNoisePointsOutlierScore(other.getNoisePointsOutlierScore());
      }
      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 {
      org.tribuo.clustering.hdbscan.protos.HdbscanModelProto parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tribuo.clustering.hdbscan.protos.HdbscanModelProto) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private org.tribuo.protos.core.ModelDataProto metadata_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.protos.core.ModelDataProto, org.tribuo.protos.core.ModelDataProto.Builder, org.tribuo.protos.core.ModelDataProtoOrBuilder> metadataBuilder_;
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     * @return Whether the metadata field is set.
     */
    public boolean hasMetadata() {
      return metadataBuilder_ != null || metadata_ != null;
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     * @return The metadata.
     */
    public org.tribuo.protos.core.ModelDataProto getMetadata() {
      if (metadataBuilder_ == null) {
        return metadata_ == null ? org.tribuo.protos.core.ModelDataProto.getDefaultInstance() : metadata_;
      } else {
        return metadataBuilder_.getMessage();
      }
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    public Builder setMetadata(org.tribuo.protos.core.ModelDataProto value) {
      if (metadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        metadata_ = value;
        onChanged();
      } else {
        metadataBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    public Builder setMetadata(
        org.tribuo.protos.core.ModelDataProto.Builder builderForValue) {
      if (metadataBuilder_ == null) {
        metadata_ = builderForValue.build();
        onChanged();
      } else {
        metadataBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    public Builder mergeMetadata(org.tribuo.protos.core.ModelDataProto value) {
      if (metadataBuilder_ == null) {
        if (metadata_ != null) {
          metadata_ =
            org.tribuo.protos.core.ModelDataProto.newBuilder(metadata_).mergeFrom(value).buildPartial();
        } else {
          metadata_ = value;
        }
        onChanged();
      } else {
        metadataBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    public Builder clearMetadata() {
      if (metadataBuilder_ == null) {
        metadata_ = null;
        onChanged();
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    public org.tribuo.protos.core.ModelDataProto.Builder getMetadataBuilder() {
      
      onChanged();
      return getMetadataFieldBuilder().getBuilder();
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    public org.tribuo.protos.core.ModelDataProtoOrBuilder getMetadataOrBuilder() {
      if (metadataBuilder_ != null) {
        return metadataBuilder_.getMessageOrBuilder();
      } else {
        return metadata_ == null ?
            org.tribuo.protos.core.ModelDataProto.getDefaultInstance() : metadata_;
      }
    }
    /**
     * <code>.tribuo.core.ModelDataProto metadata = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.protos.core.ModelDataProto, org.tribuo.protos.core.ModelDataProto.Builder, org.tribuo.protos.core.ModelDataProtoOrBuilder> 
        getMetadataFieldBuilder() {
      if (metadataBuilder_ == null) {
        metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tribuo.protos.core.ModelDataProto, org.tribuo.protos.core.ModelDataProto.Builder, org.tribuo.protos.core.ModelDataProtoOrBuilder>(
                getMetadata(),
                getParentForChildren(),
                isClean());
        metadata_ = null;
      }
      return metadataBuilder_;
    }

    private com.google.protobuf.Internal.IntList clusterLabels_ = emptyIntList();
    private void ensureClusterLabelsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        clusterLabels_ = mutableCopy(clusterLabels_);
        bitField0_ |= 0x00000001;
       }
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @return A list containing the clusterLabels.
     */
    public java.util.List<java.lang.Integer>
        getClusterLabelsList() {
      return ((bitField0_ & 0x00000001) != 0) ?
               java.util.Collections.unmodifiableList(clusterLabels_) : clusterLabels_;
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @return The count of clusterLabels.
     */
    public int getClusterLabelsCount() {
      return clusterLabels_.size();
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @param index The index of the element to return.
     * @return The clusterLabels at the given index.
     */
    public int getClusterLabels(int index) {
      return clusterLabels_.getInt(index);
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @param index The index to set the value at.
     * @param value The clusterLabels to set.
     * @return This builder for chaining.
     */
    public Builder setClusterLabels(
        int index, int value) {
      ensureClusterLabelsIsMutable();
      clusterLabels_.setInt(index, value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @param value The clusterLabels to add.
     * @return This builder for chaining.
     */
    public Builder addClusterLabels(int value) {
      ensureClusterLabelsIsMutable();
      clusterLabels_.addInt(value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @param values The clusterLabels to add.
     * @return This builder for chaining.
     */
    public Builder addAllClusterLabels(
        java.lang.Iterable<? extends java.lang.Integer> values) {
      ensureClusterLabelsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, clusterLabels_);
      onChanged();
      return this;
    }
    /**
     * <code>repeated int32 cluster_labels = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearClusterLabels() {
      clusterLabels_ = emptyIntList();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    private org.tribuo.math.protos.TensorProto outlierScoresVector_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> outlierScoresVectorBuilder_;
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     * @return Whether the outlierScoresVector field is set.
     */
    public boolean hasOutlierScoresVector() {
      return outlierScoresVectorBuilder_ != null || outlierScoresVector_ != null;
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     * @return The outlierScoresVector.
     */
    public org.tribuo.math.protos.TensorProto getOutlierScoresVector() {
      if (outlierScoresVectorBuilder_ == null) {
        return outlierScoresVector_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : outlierScoresVector_;
      } else {
        return outlierScoresVectorBuilder_.getMessage();
      }
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    public Builder setOutlierScoresVector(org.tribuo.math.protos.TensorProto value) {
      if (outlierScoresVectorBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        outlierScoresVector_ = value;
        onChanged();
      } else {
        outlierScoresVectorBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    public Builder setOutlierScoresVector(
        org.tribuo.math.protos.TensorProto.Builder builderForValue) {
      if (outlierScoresVectorBuilder_ == null) {
        outlierScoresVector_ = builderForValue.build();
        onChanged();
      } else {
        outlierScoresVectorBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    public Builder mergeOutlierScoresVector(org.tribuo.math.protos.TensorProto value) {
      if (outlierScoresVectorBuilder_ == null) {
        if (outlierScoresVector_ != null) {
          outlierScoresVector_ =
            org.tribuo.math.protos.TensorProto.newBuilder(outlierScoresVector_).mergeFrom(value).buildPartial();
        } else {
          outlierScoresVector_ = value;
        }
        onChanged();
      } else {
        outlierScoresVectorBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    public Builder clearOutlierScoresVector() {
      if (outlierScoresVectorBuilder_ == null) {
        outlierScoresVector_ = null;
        onChanged();
      } else {
        outlierScoresVector_ = null;
        outlierScoresVectorBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    public org.tribuo.math.protos.TensorProto.Builder getOutlierScoresVectorBuilder() {
      
      onChanged();
      return getOutlierScoresVectorFieldBuilder().getBuilder();
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    public org.tribuo.math.protos.TensorProtoOrBuilder getOutlierScoresVectorOrBuilder() {
      if (outlierScoresVectorBuilder_ != null) {
        return outlierScoresVectorBuilder_.getMessageOrBuilder();
      } else {
        return outlierScoresVector_ == null ?
            org.tribuo.math.protos.TensorProto.getDefaultInstance() : outlierScoresVector_;
      }
    }
    /**
     * <code>.tribuo.math.TensorProto outlier_scores_vector = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> 
        getOutlierScoresVectorFieldBuilder() {
      if (outlierScoresVectorBuilder_ == null) {
        outlierScoresVectorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder>(
                getOutlierScoresVector(),
                getParentForChildren(),
                isClean());
        outlierScoresVector_ = null;
      }
      return outlierScoresVectorBuilder_;
    }

    private org.tribuo.math.protos.DistanceProto distance_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.DistanceProto, org.tribuo.math.protos.DistanceProto.Builder, org.tribuo.math.protos.DistanceProtoOrBuilder> distanceBuilder_;
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     * @return Whether the distance field is set.
     */
    public boolean hasDistance() {
      return distanceBuilder_ != null || distance_ != null;
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     * @return The distance.
     */
    public org.tribuo.math.protos.DistanceProto getDistance() {
      if (distanceBuilder_ == null) {
        return distance_ == null ? org.tribuo.math.protos.DistanceProto.getDefaultInstance() : distance_;
      } else {
        return distanceBuilder_.getMessage();
      }
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    public Builder setDistance(org.tribuo.math.protos.DistanceProto value) {
      if (distanceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        distance_ = value;
        onChanged();
      } else {
        distanceBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    public Builder setDistance(
        org.tribuo.math.protos.DistanceProto.Builder builderForValue) {
      if (distanceBuilder_ == null) {
        distance_ = builderForValue.build();
        onChanged();
      } else {
        distanceBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    public Builder mergeDistance(org.tribuo.math.protos.DistanceProto value) {
      if (distanceBuilder_ == null) {
        if (distance_ != null) {
          distance_ =
            org.tribuo.math.protos.DistanceProto.newBuilder(distance_).mergeFrom(value).buildPartial();
        } else {
          distance_ = value;
        }
        onChanged();
      } else {
        distanceBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    public Builder clearDistance() {
      if (distanceBuilder_ == null) {
        distance_ = null;
        onChanged();
      } else {
        distance_ = null;
        distanceBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    public org.tribuo.math.protos.DistanceProto.Builder getDistanceBuilder() {
      
      onChanged();
      return getDistanceFieldBuilder().getBuilder();
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    public org.tribuo.math.protos.DistanceProtoOrBuilder getDistanceOrBuilder() {
      if (distanceBuilder_ != null) {
        return distanceBuilder_.getMessageOrBuilder();
      } else {
        return distance_ == null ?
            org.tribuo.math.protos.DistanceProto.getDefaultInstance() : distance_;
      }
    }
    /**
     * <code>.tribuo.math.DistanceProto distance = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.DistanceProto, org.tribuo.math.protos.DistanceProto.Builder, org.tribuo.math.protos.DistanceProtoOrBuilder> 
        getDistanceFieldBuilder() {
      if (distanceBuilder_ == null) {
        distanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tribuo.math.protos.DistanceProto, org.tribuo.math.protos.DistanceProto.Builder, org.tribuo.math.protos.DistanceProtoOrBuilder>(
                getDistance(),
                getParentForChildren(),
                isClean());
        distance_ = null;
      }
      return distanceBuilder_;
    }

    private java.util.List<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto> clusterExemplars_ =
      java.util.Collections.emptyList();
    private void ensureClusterExemplarsIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        clusterExemplars_ = new java.util.ArrayList<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto>(clusterExemplars_);
        bitField0_ |= 0x00000002;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder> clusterExemplarsBuilder_;

    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public java.util.List<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto> getClusterExemplarsList() {
      if (clusterExemplarsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(clusterExemplars_);
      } else {
        return clusterExemplarsBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public int getClusterExemplarsCount() {
      if (clusterExemplarsBuilder_ == null) {
        return clusterExemplars_.size();
      } else {
        return clusterExemplarsBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto getClusterExemplars(int index) {
      if (clusterExemplarsBuilder_ == null) {
        return clusterExemplars_.get(index);
      } else {
        return clusterExemplarsBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder setClusterExemplars(
        int index, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto value) {
      if (clusterExemplarsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.set(index, value);
        onChanged();
      } else {
        clusterExemplarsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder setClusterExemplars(
        int index, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder builderForValue) {
      if (clusterExemplarsBuilder_ == null) {
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.set(index, builderForValue.build());
        onChanged();
      } else {
        clusterExemplarsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder addClusterExemplars(org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto value) {
      if (clusterExemplarsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.add(value);
        onChanged();
      } else {
        clusterExemplarsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder addClusterExemplars(
        int index, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto value) {
      if (clusterExemplarsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.add(index, value);
        onChanged();
      } else {
        clusterExemplarsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder addClusterExemplars(
        org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder builderForValue) {
      if (clusterExemplarsBuilder_ == null) {
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.add(builderForValue.build());
        onChanged();
      } else {
        clusterExemplarsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder addClusterExemplars(
        int index, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder builderForValue) {
      if (clusterExemplarsBuilder_ == null) {
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.add(index, builderForValue.build());
        onChanged();
      } else {
        clusterExemplarsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder addAllClusterExemplars(
        java.lang.Iterable<? extends org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto> values) {
      if (clusterExemplarsBuilder_ == null) {
        ensureClusterExemplarsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, clusterExemplars_);
        onChanged();
      } else {
        clusterExemplarsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder clearClusterExemplars() {
      if (clusterExemplarsBuilder_ == null) {
        clusterExemplars_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        clusterExemplarsBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public Builder removeClusterExemplars(int index) {
      if (clusterExemplarsBuilder_ == null) {
        ensureClusterExemplarsIsMutable();
        clusterExemplars_.remove(index);
        onChanged();
      } else {
        clusterExemplarsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder getClusterExemplarsBuilder(
        int index) {
      return getClusterExemplarsFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder getClusterExemplarsOrBuilder(
        int index) {
      if (clusterExemplarsBuilder_ == null) {
        return clusterExemplars_.get(index);  } else {
        return clusterExemplarsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public java.util.List<? extends org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder> 
         getClusterExemplarsOrBuilderList() {
      if (clusterExemplarsBuilder_ != null) {
        return clusterExemplarsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(clusterExemplars_);
      }
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder addClusterExemplarsBuilder() {
      return getClusterExemplarsFieldBuilder().addBuilder(
          org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.getDefaultInstance());
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder addClusterExemplarsBuilder(
        int index) {
      return getClusterExemplarsFieldBuilder().addBuilder(
          index, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.getDefaultInstance());
    }
    /**
     * <code>repeated .tribuo.clustering.hdbscan.ClusterExemplarProto cluster_exemplars = 5;</code>
     */
    public java.util.List<org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder> 
         getClusterExemplarsBuilderList() {
      return getClusterExemplarsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder> 
        getClusterExemplarsFieldBuilder() {
      if (clusterExemplarsBuilder_ == null) {
        clusterExemplarsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProto.Builder, org.tribuo.clustering.hdbscan.protos.ClusterExemplarProtoOrBuilder>(
                clusterExemplars_,
                ((bitField0_ & 0x00000002) != 0),
                getParentForChildren(),
                isClean());
        clusterExemplars_ = null;
      }
      return clusterExemplarsBuilder_;
    }

    private double noisePointsOutlierScore_ ;
    /**
     * <code>double noise_points_outlier_score = 6;</code>
     * @return The noisePointsOutlierScore.
     */
    @java.lang.Override
    public double getNoisePointsOutlierScore() {
      return noisePointsOutlierScore_;
    }
    /**
     * <code>double noise_points_outlier_score = 6;</code>
     * @param value The noisePointsOutlierScore to set.
     * @return This builder for chaining.
     */
    public Builder setNoisePointsOutlierScore(double value) {
      
      noisePointsOutlierScore_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double noise_points_outlier_score = 6;</code>
     * @return This builder for chaining.
     */
    public Builder clearNoisePointsOutlierScore() {
      
      noisePointsOutlierScore_ = 0D;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:tribuo.clustering.hdbscan.HdbscanModelProto)
  }

  // @@protoc_insertion_point(class_scope:tribuo.clustering.hdbscan.HdbscanModelProto)
  private static final org.tribuo.clustering.hdbscan.protos.HdbscanModelProto DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tribuo.clustering.hdbscan.protos.HdbscanModelProto();
  }

  public static org.tribuo.clustering.hdbscan.protos.HdbscanModelProto getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<HdbscanModelProto>
      PARSER = new com.google.protobuf.AbstractParser<HdbscanModelProto>() {
    @java.lang.Override
    public HdbscanModelProto parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new HdbscanModelProto(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<HdbscanModelProto> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public org.tribuo.clustering.hdbscan.protos.HdbscanModelProto getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

