// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/privacy/dlp/v2/dlp.proto

package com.google.privacy.dlp.v2;

/**
 * <pre>
 * Generalization function that buckets values based on ranges. The ranges and
 * replacement values are dynamically provided by the user for custom behavior,
 * such as 1-30 -&gt; LOW 31-65 -&gt; MEDIUM 66-100 -&gt; HIGH
 * This can be used on
 * data of type: number, long, string, timestamp.
 * If the bound `Value` type differs from the type of data being transformed, we
 * will first attempt converting the type of the data to be transformed to match
 * the type of the bound before comparing.
 * </pre>
 *
 * Protobuf type {@code google.privacy.dlp.v2.BucketingConfig}
 */
public  final class BucketingConfig extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.BucketingConfig)
    BucketingConfigOrBuilder {
private static final long serialVersionUID = 0L;
  // Use BucketingConfig.newBuilder() to construct.
  private BucketingConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private BucketingConfig() {
    buckets_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private BucketingConfig(
      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;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
              buckets_ = new java.util.ArrayList<com.google.privacy.dlp.v2.BucketingConfig.Bucket>();
              mutable_bitField0_ |= 0x00000001;
            }
            buckets_.add(
                input.readMessage(com.google.privacy.dlp.v2.BucketingConfig.Bucket.parser(), extensionRegistry));
            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) == 0x00000001)) {
        buckets_ = java.util.Collections.unmodifiableList(buckets_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.privacy.dlp.v2.BucketingConfig.class, com.google.privacy.dlp.v2.BucketingConfig.Builder.class);
  }

  public interface BucketOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.BucketingConfig.Bucket)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * Lower bound of the range, inclusive. Type should be the same as max if
     * used.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value min = 1;</code>
     */
    boolean hasMin();
    /**
     * <pre>
     * Lower bound of the range, inclusive. Type should be the same as max if
     * used.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value min = 1;</code>
     */
    com.google.privacy.dlp.v2.Value getMin();
    /**
     * <pre>
     * Lower bound of the range, inclusive. Type should be the same as max if
     * used.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value min = 1;</code>
     */
    com.google.privacy.dlp.v2.ValueOrBuilder getMinOrBuilder();

    /**
     * <pre>
     * Upper bound of the range, exclusive; type must match min.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value max = 2;</code>
     */
    boolean hasMax();
    /**
     * <pre>
     * Upper bound of the range, exclusive; type must match min.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value max = 2;</code>
     */
    com.google.privacy.dlp.v2.Value getMax();
    /**
     * <pre>
     * Upper bound of the range, exclusive; type must match min.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value max = 2;</code>
     */
    com.google.privacy.dlp.v2.ValueOrBuilder getMaxOrBuilder();

    /**
     * <pre>
     * Replacement value for this bucket. If not provided
     * the default behavior will be to hyphenate the min-max range.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
     */
    boolean hasReplacementValue();
    /**
     * <pre>
     * Replacement value for this bucket. If not provided
     * the default behavior will be to hyphenate the min-max range.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
     */
    com.google.privacy.dlp.v2.Value getReplacementValue();
    /**
     * <pre>
     * Replacement value for this bucket. If not provided
     * the default behavior will be to hyphenate the min-max range.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
     */
    com.google.privacy.dlp.v2.ValueOrBuilder getReplacementValueOrBuilder();
  }
  /**
   * <pre>
   * Bucket is represented as a range, along with replacement values.
   * </pre>
   *
   * Protobuf type {@code google.privacy.dlp.v2.BucketingConfig.Bucket}
   */
  public  static final class Bucket extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.BucketingConfig.Bucket)
      BucketOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use Bucket.newBuilder() to construct.
    private Bucket(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private Bucket() {
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private Bucket(
        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;
            default: {
              if (!parseUnknownFieldProto3(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              com.google.privacy.dlp.v2.Value.Builder subBuilder = null;
              if (min_ != null) {
                subBuilder = min_.toBuilder();
              }
              min_ = input.readMessage(com.google.privacy.dlp.v2.Value.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(min_);
                min_ = subBuilder.buildPartial();
              }

              break;
            }
            case 18: {
              com.google.privacy.dlp.v2.Value.Builder subBuilder = null;
              if (max_ != null) {
                subBuilder = max_.toBuilder();
              }
              max_ = input.readMessage(com.google.privacy.dlp.v2.Value.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(max_);
                max_ = subBuilder.buildPartial();
              }

              break;
            }
            case 26: {
              com.google.privacy.dlp.v2.Value.Builder subBuilder = null;
              if (replacementValue_ != null) {
                subBuilder = replacementValue_.toBuilder();
              }
              replacementValue_ = input.readMessage(com.google.privacy.dlp.v2.Value.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(replacementValue_);
                replacementValue_ = subBuilder.buildPartial();
              }

              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 com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_Bucket_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_Bucket_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.privacy.dlp.v2.BucketingConfig.Bucket.class, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder.class);
    }

    public static final int MIN_FIELD_NUMBER = 1;
    private com.google.privacy.dlp.v2.Value min_;
    /**
     * <pre>
     * Lower bound of the range, inclusive. Type should be the same as max if
     * used.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value min = 1;</code>
     */
    public boolean hasMin() {
      return min_ != null;
    }
    /**
     * <pre>
     * Lower bound of the range, inclusive. Type should be the same as max if
     * used.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value min = 1;</code>
     */
    public com.google.privacy.dlp.v2.Value getMin() {
      return min_ == null ? com.google.privacy.dlp.v2.Value.getDefaultInstance() : min_;
    }
    /**
     * <pre>
     * Lower bound of the range, inclusive. Type should be the same as max if
     * used.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value min = 1;</code>
     */
    public com.google.privacy.dlp.v2.ValueOrBuilder getMinOrBuilder() {
      return getMin();
    }

    public static final int MAX_FIELD_NUMBER = 2;
    private com.google.privacy.dlp.v2.Value max_;
    /**
     * <pre>
     * Upper bound of the range, exclusive; type must match min.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value max = 2;</code>
     */
    public boolean hasMax() {
      return max_ != null;
    }
    /**
     * <pre>
     * Upper bound of the range, exclusive; type must match min.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value max = 2;</code>
     */
    public com.google.privacy.dlp.v2.Value getMax() {
      return max_ == null ? com.google.privacy.dlp.v2.Value.getDefaultInstance() : max_;
    }
    /**
     * <pre>
     * Upper bound of the range, exclusive; type must match min.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value max = 2;</code>
     */
    public com.google.privacy.dlp.v2.ValueOrBuilder getMaxOrBuilder() {
      return getMax();
    }

    public static final int REPLACEMENT_VALUE_FIELD_NUMBER = 3;
    private com.google.privacy.dlp.v2.Value replacementValue_;
    /**
     * <pre>
     * Replacement value for this bucket. If not provided
     * the default behavior will be to hyphenate the min-max range.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
     */
    public boolean hasReplacementValue() {
      return replacementValue_ != null;
    }
    /**
     * <pre>
     * Replacement value for this bucket. If not provided
     * the default behavior will be to hyphenate the min-max range.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
     */
    public com.google.privacy.dlp.v2.Value getReplacementValue() {
      return replacementValue_ == null ? com.google.privacy.dlp.v2.Value.getDefaultInstance() : replacementValue_;
    }
    /**
     * <pre>
     * Replacement value for this bucket. If not provided
     * the default behavior will be to hyphenate the min-max range.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
     */
    public com.google.privacy.dlp.v2.ValueOrBuilder getReplacementValueOrBuilder() {
      return getReplacementValue();
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (min_ != null) {
        output.writeMessage(1, getMin());
      }
      if (max_ != null) {
        output.writeMessage(2, getMax());
      }
      if (replacementValue_ != null) {
        output.writeMessage(3, getReplacementValue());
      }
      unknownFields.writeTo(output);
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (min_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, getMin());
      }
      if (max_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, getMax());
      }
      if (replacementValue_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, getReplacementValue());
      }
      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 com.google.privacy.dlp.v2.BucketingConfig.Bucket)) {
        return super.equals(obj);
      }
      com.google.privacy.dlp.v2.BucketingConfig.Bucket other = (com.google.privacy.dlp.v2.BucketingConfig.Bucket) obj;

      boolean result = true;
      result = result && (hasMin() == other.hasMin());
      if (hasMin()) {
        result = result && getMin()
            .equals(other.getMin());
      }
      result = result && (hasMax() == other.hasMax());
      if (hasMax()) {
        result = result && getMax()
            .equals(other.getMax());
      }
      result = result && (hasReplacementValue() == other.hasReplacementValue());
      if (hasReplacementValue()) {
        result = result && getReplacementValue()
            .equals(other.getReplacementValue());
      }
      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();
      if (hasMin()) {
        hash = (37 * hash) + MIN_FIELD_NUMBER;
        hash = (53 * hash) + getMin().hashCode();
      }
      if (hasMax()) {
        hash = (37 * hash) + MAX_FIELD_NUMBER;
        hash = (53 * hash) + getMax().hashCode();
      }
      if (hasReplacementValue()) {
        hash = (37 * hash) + REPLACEMENT_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getReplacementValue().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket 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 com.google.privacy.dlp.v2.BucketingConfig.Bucket parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket 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 com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.google.privacy.dlp.v2.BucketingConfig.Bucket prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * Bucket is represented as a range, along with replacement values.
     * </pre>
     *
     * Protobuf type {@code google.privacy.dlp.v2.BucketingConfig.Bucket}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.BucketingConfig.Bucket)
        com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_Bucket_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_Bucket_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.privacy.dlp.v2.BucketingConfig.Bucket.class, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder.class);
      }

      // Construct using com.google.privacy.dlp.v2.BucketingConfig.Bucket.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        if (minBuilder_ == null) {
          min_ = null;
        } else {
          min_ = null;
          minBuilder_ = null;
        }
        if (maxBuilder_ == null) {
          max_ = null;
        } else {
          max_ = null;
          maxBuilder_ = null;
        }
        if (replacementValueBuilder_ == null) {
          replacementValue_ = null;
        } else {
          replacementValue_ = null;
          replacementValueBuilder_ = null;
        }
        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_Bucket_descriptor;
      }

      public com.google.privacy.dlp.v2.BucketingConfig.Bucket getDefaultInstanceForType() {
        return com.google.privacy.dlp.v2.BucketingConfig.Bucket.getDefaultInstance();
      }

      public com.google.privacy.dlp.v2.BucketingConfig.Bucket build() {
        com.google.privacy.dlp.v2.BucketingConfig.Bucket result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public com.google.privacy.dlp.v2.BucketingConfig.Bucket buildPartial() {
        com.google.privacy.dlp.v2.BucketingConfig.Bucket result = new com.google.privacy.dlp.v2.BucketingConfig.Bucket(this);
        if (minBuilder_ == null) {
          result.min_ = min_;
        } else {
          result.min_ = minBuilder_.build();
        }
        if (maxBuilder_ == null) {
          result.max_ = max_;
        } else {
          result.max_ = maxBuilder_.build();
        }
        if (replacementValueBuilder_ == null) {
          result.replacementValue_ = replacementValue_;
        } else {
          result.replacementValue_ = replacementValueBuilder_.build();
        }
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, java.lang.Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.privacy.dlp.v2.BucketingConfig.Bucket) {
          return mergeFrom((com.google.privacy.dlp.v2.BucketingConfig.Bucket)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.privacy.dlp.v2.BucketingConfig.Bucket other) {
        if (other == com.google.privacy.dlp.v2.BucketingConfig.Bucket.getDefaultInstance()) return this;
        if (other.hasMin()) {
          mergeMin(other.getMin());
        }
        if (other.hasMax()) {
          mergeMax(other.getMax());
        }
        if (other.hasReplacementValue()) {
          mergeReplacementValue(other.getReplacementValue());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.privacy.dlp.v2.BucketingConfig.Bucket parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.privacy.dlp.v2.BucketingConfig.Bucket) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private com.google.privacy.dlp.v2.Value min_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder> minBuilder_;
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public boolean hasMin() {
        return minBuilder_ != null || min_ != null;
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public com.google.privacy.dlp.v2.Value getMin() {
        if (minBuilder_ == null) {
          return min_ == null ? com.google.privacy.dlp.v2.Value.getDefaultInstance() : min_;
        } else {
          return minBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public Builder setMin(com.google.privacy.dlp.v2.Value value) {
        if (minBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          min_ = value;
          onChanged();
        } else {
          minBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public Builder setMin(
          com.google.privacy.dlp.v2.Value.Builder builderForValue) {
        if (minBuilder_ == null) {
          min_ = builderForValue.build();
          onChanged();
        } else {
          minBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public Builder mergeMin(com.google.privacy.dlp.v2.Value value) {
        if (minBuilder_ == null) {
          if (min_ != null) {
            min_ =
              com.google.privacy.dlp.v2.Value.newBuilder(min_).mergeFrom(value).buildPartial();
          } else {
            min_ = value;
          }
          onChanged();
        } else {
          minBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public Builder clearMin() {
        if (minBuilder_ == null) {
          min_ = null;
          onChanged();
        } else {
          min_ = null;
          minBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public com.google.privacy.dlp.v2.Value.Builder getMinBuilder() {
        
        onChanged();
        return getMinFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      public com.google.privacy.dlp.v2.ValueOrBuilder getMinOrBuilder() {
        if (minBuilder_ != null) {
          return minBuilder_.getMessageOrBuilder();
        } else {
          return min_ == null ?
              com.google.privacy.dlp.v2.Value.getDefaultInstance() : min_;
        }
      }
      /**
       * <pre>
       * Lower bound of the range, inclusive. Type should be the same as max if
       * used.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value min = 1;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder> 
          getMinFieldBuilder() {
        if (minBuilder_ == null) {
          minBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder>(
                  getMin(),
                  getParentForChildren(),
                  isClean());
          min_ = null;
        }
        return minBuilder_;
      }

      private com.google.privacy.dlp.v2.Value max_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder> maxBuilder_;
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public boolean hasMax() {
        return maxBuilder_ != null || max_ != null;
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public com.google.privacy.dlp.v2.Value getMax() {
        if (maxBuilder_ == null) {
          return max_ == null ? com.google.privacy.dlp.v2.Value.getDefaultInstance() : max_;
        } else {
          return maxBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public Builder setMax(com.google.privacy.dlp.v2.Value value) {
        if (maxBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          max_ = value;
          onChanged();
        } else {
          maxBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public Builder setMax(
          com.google.privacy.dlp.v2.Value.Builder builderForValue) {
        if (maxBuilder_ == null) {
          max_ = builderForValue.build();
          onChanged();
        } else {
          maxBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public Builder mergeMax(com.google.privacy.dlp.v2.Value value) {
        if (maxBuilder_ == null) {
          if (max_ != null) {
            max_ =
              com.google.privacy.dlp.v2.Value.newBuilder(max_).mergeFrom(value).buildPartial();
          } else {
            max_ = value;
          }
          onChanged();
        } else {
          maxBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public Builder clearMax() {
        if (maxBuilder_ == null) {
          max_ = null;
          onChanged();
        } else {
          max_ = null;
          maxBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public com.google.privacy.dlp.v2.Value.Builder getMaxBuilder() {
        
        onChanged();
        return getMaxFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      public com.google.privacy.dlp.v2.ValueOrBuilder getMaxOrBuilder() {
        if (maxBuilder_ != null) {
          return maxBuilder_.getMessageOrBuilder();
        } else {
          return max_ == null ?
              com.google.privacy.dlp.v2.Value.getDefaultInstance() : max_;
        }
      }
      /**
       * <pre>
       * Upper bound of the range, exclusive; type must match min.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value max = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder> 
          getMaxFieldBuilder() {
        if (maxBuilder_ == null) {
          maxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder>(
                  getMax(),
                  getParentForChildren(),
                  isClean());
          max_ = null;
        }
        return maxBuilder_;
      }

      private com.google.privacy.dlp.v2.Value replacementValue_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder> replacementValueBuilder_;
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public boolean hasReplacementValue() {
        return replacementValueBuilder_ != null || replacementValue_ != null;
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public com.google.privacy.dlp.v2.Value getReplacementValue() {
        if (replacementValueBuilder_ == null) {
          return replacementValue_ == null ? com.google.privacy.dlp.v2.Value.getDefaultInstance() : replacementValue_;
        } else {
          return replacementValueBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public Builder setReplacementValue(com.google.privacy.dlp.v2.Value value) {
        if (replacementValueBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          replacementValue_ = value;
          onChanged();
        } else {
          replacementValueBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public Builder setReplacementValue(
          com.google.privacy.dlp.v2.Value.Builder builderForValue) {
        if (replacementValueBuilder_ == null) {
          replacementValue_ = builderForValue.build();
          onChanged();
        } else {
          replacementValueBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public Builder mergeReplacementValue(com.google.privacy.dlp.v2.Value value) {
        if (replacementValueBuilder_ == null) {
          if (replacementValue_ != null) {
            replacementValue_ =
              com.google.privacy.dlp.v2.Value.newBuilder(replacementValue_).mergeFrom(value).buildPartial();
          } else {
            replacementValue_ = value;
          }
          onChanged();
        } else {
          replacementValueBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public Builder clearReplacementValue() {
        if (replacementValueBuilder_ == null) {
          replacementValue_ = null;
          onChanged();
        } else {
          replacementValue_ = null;
          replacementValueBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public com.google.privacy.dlp.v2.Value.Builder getReplacementValueBuilder() {
        
        onChanged();
        return getReplacementValueFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      public com.google.privacy.dlp.v2.ValueOrBuilder getReplacementValueOrBuilder() {
        if (replacementValueBuilder_ != null) {
          return replacementValueBuilder_.getMessageOrBuilder();
        } else {
          return replacementValue_ == null ?
              com.google.privacy.dlp.v2.Value.getDefaultInstance() : replacementValue_;
        }
      }
      /**
       * <pre>
       * Replacement value for this bucket. If not provided
       * the default behavior will be to hyphenate the min-max range.
       * </pre>
       *
       * <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder> 
          getReplacementValueFieldBuilder() {
        if (replacementValueBuilder_ == null) {
          replacementValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.privacy.dlp.v2.Value, com.google.privacy.dlp.v2.Value.Builder, com.google.privacy.dlp.v2.ValueOrBuilder>(
                  getReplacementValue(),
                  getParentForChildren(),
                  isClean());
          replacementValue_ = null;
        }
        return replacementValueBuilder_;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFieldsProto3(unknownFields);
      }

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


      // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.BucketingConfig.Bucket)
    }

    // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BucketingConfig.Bucket)
    private static final com.google.privacy.dlp.v2.BucketingConfig.Bucket DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.BucketingConfig.Bucket();
    }

    public static com.google.privacy.dlp.v2.BucketingConfig.Bucket getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public com.google.privacy.dlp.v2.BucketingConfig.Bucket getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public static final int BUCKETS_FIELD_NUMBER = 1;
  private java.util.List<com.google.privacy.dlp.v2.BucketingConfig.Bucket> buckets_;
  /**
   * <pre>
   * Set of buckets. Ranges must be non-overlapping.
   * </pre>
   *
   * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
   */
  public java.util.List<com.google.privacy.dlp.v2.BucketingConfig.Bucket> getBucketsList() {
    return buckets_;
  }
  /**
   * <pre>
   * Set of buckets. Ranges must be non-overlapping.
   * </pre>
   *
   * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
   */
  public java.util.List<? extends com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder> 
      getBucketsOrBuilderList() {
    return buckets_;
  }
  /**
   * <pre>
   * Set of buckets. Ranges must be non-overlapping.
   * </pre>
   *
   * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
   */
  public int getBucketsCount() {
    return buckets_.size();
  }
  /**
   * <pre>
   * Set of buckets. Ranges must be non-overlapping.
   * </pre>
   *
   * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
   */
  public com.google.privacy.dlp.v2.BucketingConfig.Bucket getBuckets(int index) {
    return buckets_.get(index);
  }
  /**
   * <pre>
   * Set of buckets. Ranges must be non-overlapping.
   * </pre>
   *
   * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
   */
  public com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder getBucketsOrBuilder(
      int index) {
    return buckets_.get(index);
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    for (int i = 0; i < buckets_.size(); i++) {
      output.writeMessage(1, buckets_.get(i));
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < buckets_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, buckets_.get(i));
    }
    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 com.google.privacy.dlp.v2.BucketingConfig)) {
      return super.equals(obj);
    }
    com.google.privacy.dlp.v2.BucketingConfig other = (com.google.privacy.dlp.v2.BucketingConfig) obj;

    boolean result = true;
    result = result && getBucketsList()
        .equals(other.getBucketsList());
    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();
    if (getBucketsCount() > 0) {
      hash = (37 * hash) + BUCKETS_FIELD_NUMBER;
      hash = (53 * hash) + getBucketsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig 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 com.google.privacy.dlp.v2.BucketingConfig parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig 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 com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2.BucketingConfig parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.privacy.dlp.v2.BucketingConfig prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Generalization function that buckets values based on ranges. The ranges and
   * replacement values are dynamically provided by the user for custom behavior,
   * such as 1-30 -&gt; LOW 31-65 -&gt; MEDIUM 66-100 -&gt; HIGH
   * This can be used on
   * data of type: number, long, string, timestamp.
   * If the bound `Value` type differs from the type of data being transformed, we
   * will first attempt converting the type of the data to be transformed to match
   * the type of the bound before comparing.
   * </pre>
   *
   * Protobuf type {@code google.privacy.dlp.v2.BucketingConfig}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.BucketingConfig)
      com.google.privacy.dlp.v2.BucketingConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.privacy.dlp.v2.BucketingConfig.class, com.google.privacy.dlp.v2.BucketingConfig.Builder.class);
    }

    // Construct using com.google.privacy.dlp.v2.BucketingConfig.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getBucketsFieldBuilder();
      }
    }
    public Builder clear() {
      super.clear();
      if (bucketsBuilder_ == null) {
        buckets_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        bucketsBuilder_.clear();
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_BucketingConfig_descriptor;
    }

    public com.google.privacy.dlp.v2.BucketingConfig getDefaultInstanceForType() {
      return com.google.privacy.dlp.v2.BucketingConfig.getDefaultInstance();
    }

    public com.google.privacy.dlp.v2.BucketingConfig build() {
      com.google.privacy.dlp.v2.BucketingConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.privacy.dlp.v2.BucketingConfig buildPartial() {
      com.google.privacy.dlp.v2.BucketingConfig result = new com.google.privacy.dlp.v2.BucketingConfig(this);
      int from_bitField0_ = bitField0_;
      if (bucketsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          buckets_ = java.util.Collections.unmodifiableList(buckets_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.buckets_ = buckets_;
      } else {
        result.buckets_ = bucketsBuilder_.build();
      }
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.privacy.dlp.v2.BucketingConfig) {
        return mergeFrom((com.google.privacy.dlp.v2.BucketingConfig)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.privacy.dlp.v2.BucketingConfig other) {
      if (other == com.google.privacy.dlp.v2.BucketingConfig.getDefaultInstance()) return this;
      if (bucketsBuilder_ == null) {
        if (!other.buckets_.isEmpty()) {
          if (buckets_.isEmpty()) {
            buckets_ = other.buckets_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureBucketsIsMutable();
            buckets_.addAll(other.buckets_);
          }
          onChanged();
        }
      } else {
        if (!other.buckets_.isEmpty()) {
          if (bucketsBuilder_.isEmpty()) {
            bucketsBuilder_.dispose();
            bucketsBuilder_ = null;
            buckets_ = other.buckets_;
            bitField0_ = (bitField0_ & ~0x00000001);
            bucketsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getBucketsFieldBuilder() : null;
          } else {
            bucketsBuilder_.addAllMessages(other.buckets_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.privacy.dlp.v2.BucketingConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.privacy.dlp.v2.BucketingConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.util.List<com.google.privacy.dlp.v2.BucketingConfig.Bucket> buckets_ =
      java.util.Collections.emptyList();
    private void ensureBucketsIsMutable() {
      if (!((bitField0_ & 0x00000001) == 0x00000001)) {
        buckets_ = new java.util.ArrayList<com.google.privacy.dlp.v2.BucketingConfig.Bucket>(buckets_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.privacy.dlp.v2.BucketingConfig.Bucket, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder, com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder> bucketsBuilder_;

    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public java.util.List<com.google.privacy.dlp.v2.BucketingConfig.Bucket> getBucketsList() {
      if (bucketsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(buckets_);
      } else {
        return bucketsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public int getBucketsCount() {
      if (bucketsBuilder_ == null) {
        return buckets_.size();
      } else {
        return bucketsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public com.google.privacy.dlp.v2.BucketingConfig.Bucket getBuckets(int index) {
      if (bucketsBuilder_ == null) {
        return buckets_.get(index);
      } else {
        return bucketsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder setBuckets(
        int index, com.google.privacy.dlp.v2.BucketingConfig.Bucket value) {
      if (bucketsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBucketsIsMutable();
        buckets_.set(index, value);
        onChanged();
      } else {
        bucketsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder setBuckets(
        int index, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder builderForValue) {
      if (bucketsBuilder_ == null) {
        ensureBucketsIsMutable();
        buckets_.set(index, builderForValue.build());
        onChanged();
      } else {
        bucketsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder addBuckets(com.google.privacy.dlp.v2.BucketingConfig.Bucket value) {
      if (bucketsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBucketsIsMutable();
        buckets_.add(value);
        onChanged();
      } else {
        bucketsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder addBuckets(
        int index, com.google.privacy.dlp.v2.BucketingConfig.Bucket value) {
      if (bucketsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBucketsIsMutable();
        buckets_.add(index, value);
        onChanged();
      } else {
        bucketsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder addBuckets(
        com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder builderForValue) {
      if (bucketsBuilder_ == null) {
        ensureBucketsIsMutable();
        buckets_.add(builderForValue.build());
        onChanged();
      } else {
        bucketsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder addBuckets(
        int index, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder builderForValue) {
      if (bucketsBuilder_ == null) {
        ensureBucketsIsMutable();
        buckets_.add(index, builderForValue.build());
        onChanged();
      } else {
        bucketsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder addAllBuckets(
        java.lang.Iterable<? extends com.google.privacy.dlp.v2.BucketingConfig.Bucket> values) {
      if (bucketsBuilder_ == null) {
        ensureBucketsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, buckets_);
        onChanged();
      } else {
        bucketsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder clearBuckets() {
      if (bucketsBuilder_ == null) {
        buckets_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        bucketsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public Builder removeBuckets(int index) {
      if (bucketsBuilder_ == null) {
        ensureBucketsIsMutable();
        buckets_.remove(index);
        onChanged();
      } else {
        bucketsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder getBucketsBuilder(
        int index) {
      return getBucketsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder getBucketsOrBuilder(
        int index) {
      if (bucketsBuilder_ == null) {
        return buckets_.get(index);  } else {
        return bucketsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public java.util.List<? extends com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder> 
         getBucketsOrBuilderList() {
      if (bucketsBuilder_ != null) {
        return bucketsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(buckets_);
      }
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder addBucketsBuilder() {
      return getBucketsFieldBuilder().addBuilder(
          com.google.privacy.dlp.v2.BucketingConfig.Bucket.getDefaultInstance());
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder addBucketsBuilder(
        int index) {
      return getBucketsFieldBuilder().addBuilder(
          index, com.google.privacy.dlp.v2.BucketingConfig.Bucket.getDefaultInstance());
    }
    /**
     * <pre>
     * Set of buckets. Ranges must be non-overlapping.
     * </pre>
     *
     * <code>repeated .google.privacy.dlp.v2.BucketingConfig.Bucket buckets = 1;</code>
     */
    public java.util.List<com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder> 
         getBucketsBuilderList() {
      return getBucketsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.privacy.dlp.v2.BucketingConfig.Bucket, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder, com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder> 
        getBucketsFieldBuilder() {
      if (bucketsBuilder_ == null) {
        bucketsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.privacy.dlp.v2.BucketingConfig.Bucket, com.google.privacy.dlp.v2.BucketingConfig.Bucket.Builder, com.google.privacy.dlp.v2.BucketingConfig.BucketOrBuilder>(
                buckets_,
                ((bitField0_ & 0x00000001) == 0x00000001),
                getParentForChildren(),
                isClean());
        buckets_ = null;
      }
      return bucketsBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.BucketingConfig)
  }

  // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BucketingConfig)
  private static final com.google.privacy.dlp.v2.BucketingConfig DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.BucketingConfig();
  }

  public static com.google.privacy.dlp.v2.BucketingConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.privacy.dlp.v2.BucketingConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

