// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/talent/v4beta1/common.proto

package com.google.cloud.talent.v4beta1;

/**
 *
 *
 * <pre>
 * Custom attribute values that are either filterable or non-filterable.
 * </pre>
 *
 * Protobuf type {@code google.cloud.talent.v4beta1.CustomAttribute}
 */
public final class CustomAttribute extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.talent.v4beta1.CustomAttribute)
    CustomAttributeOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use CustomAttribute.newBuilder() to construct.
  private CustomAttribute(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private CustomAttribute() {
    stringValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    longValues_ = emptyLongList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private CustomAttribute(
      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:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                stringValues_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000001;
              }
              stringValues_.add(s);
              break;
            }
          case 16:
            {
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                longValues_ = newLongList();
                mutable_bitField0_ |= 0x00000002;
              }
              longValues_.addLong(input.readInt64());
              break;
            }
          case 18:
            {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
                longValues_ = newLongList();
                mutable_bitField0_ |= 0x00000002;
              }
              while (input.getBytesUntilLimit() > 0) {
                longValues_.addLong(input.readInt64());
              }
              input.popLimit(limit);
              break;
            }
          case 24:
            {
              filterable_ = input.readBool();
              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)) {
        stringValues_ = stringValues_.getUnmodifiableView();
      }
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        longValues_.makeImmutable(); // C
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.talent.v4beta1.CommonProto
        .internal_static_google_cloud_talent_v4beta1_CustomAttribute_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.talent.v4beta1.CommonProto
        .internal_static_google_cloud_talent_v4beta1_CustomAttribute_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.talent.v4beta1.CustomAttribute.class,
            com.google.cloud.talent.v4beta1.CustomAttribute.Builder.class);
  }

  private int bitField0_;
  public static final int STRING_VALUES_FIELD_NUMBER = 1;
  private com.google.protobuf.LazyStringList stringValues_;
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
   * `CASE_INSENSITIVE_MATCH`) search.
   * For filterable `string_value`s, a maximum total number of 200 values
   * is allowed, with each `string_value` has a byte size of no more than
   * 255B. For unfilterable `string_values`, the maximum total byte size of
   * unfilterable `string_values` is 50KB.
   * Empty string isn't allowed.
   * </pre>
   *
   * <code>repeated string string_values = 1;</code>
   */
  public com.google.protobuf.ProtocolStringList getStringValuesList() {
    return stringValues_;
  }
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
   * `CASE_INSENSITIVE_MATCH`) search.
   * For filterable `string_value`s, a maximum total number of 200 values
   * is allowed, with each `string_value` has a byte size of no more than
   * 255B. For unfilterable `string_values`, the maximum total byte size of
   * unfilterable `string_values` is 50KB.
   * Empty string isn't allowed.
   * </pre>
   *
   * <code>repeated string string_values = 1;</code>
   */
  public int getStringValuesCount() {
    return stringValues_.size();
  }
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
   * `CASE_INSENSITIVE_MATCH`) search.
   * For filterable `string_value`s, a maximum total number of 200 values
   * is allowed, with each `string_value` has a byte size of no more than
   * 255B. For unfilterable `string_values`, the maximum total byte size of
   * unfilterable `string_values` is 50KB.
   * Empty string isn't allowed.
   * </pre>
   *
   * <code>repeated string string_values = 1;</code>
   */
  public java.lang.String getStringValues(int index) {
    return stringValues_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
   * `CASE_INSENSITIVE_MATCH`) search.
   * For filterable `string_value`s, a maximum total number of 200 values
   * is allowed, with each `string_value` has a byte size of no more than
   * 255B. For unfilterable `string_values`, the maximum total byte size of
   * unfilterable `string_values` is 50KB.
   * Empty string isn't allowed.
   * </pre>
   *
   * <code>repeated string string_values = 1;</code>
   */
  public com.google.protobuf.ByteString getStringValuesBytes(int index) {
    return stringValues_.getByteString(index);
  }

  public static final int LONG_VALUES_FIELD_NUMBER = 2;
  private com.google.protobuf.Internal.LongList longValues_;
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform number range search.
   * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
   * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
   * </pre>
   *
   * <code>repeated int64 long_values = 2;</code>
   */
  public java.util.List<java.lang.Long> getLongValuesList() {
    return longValues_;
  }
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform number range search.
   * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
   * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
   * </pre>
   *
   * <code>repeated int64 long_values = 2;</code>
   */
  public int getLongValuesCount() {
    return longValues_.size();
  }
  /**
   *
   *
   * <pre>
   * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
   * be specified.
   * This field is used to perform number range search.
   * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
   * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
   * </pre>
   *
   * <code>repeated int64 long_values = 2;</code>
   */
  public long getLongValues(int index) {
    return longValues_.getLong(index);
  }

  private int longValuesMemoizedSerializedSize = -1;

  public static final int FILTERABLE_FIELD_NUMBER = 3;
  private boolean filterable_;
  /**
   *
   *
   * <pre>
   * Optional.
   * If the `filterable` flag is true, custom field values are searchable.
   * If false, values are not searchable.
   * Default is false.
   * </pre>
   *
   * <code>bool filterable = 3;</code>
   */
  public boolean getFilterable() {
    return filterable_;
  }

  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();
    for (int i = 0; i < stringValues_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stringValues_.getRaw(i));
    }
    if (getLongValuesList().size() > 0) {
      output.writeUInt32NoTag(18);
      output.writeUInt32NoTag(longValuesMemoizedSerializedSize);
    }
    for (int i = 0; i < longValues_.size(); i++) {
      output.writeInt64NoTag(longValues_.getLong(i));
    }
    if (filterable_ != false) {
      output.writeBool(3, filterable_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    {
      int dataSize = 0;
      for (int i = 0; i < stringValues_.size(); i++) {
        dataSize += computeStringSizeNoTag(stringValues_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getStringValuesList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < longValues_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(longValues_.getLong(i));
      }
      size += dataSize;
      if (!getLongValuesList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      longValuesMemoizedSerializedSize = dataSize;
    }
    if (filterable_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, filterable_);
    }
    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.cloud.talent.v4beta1.CustomAttribute)) {
      return super.equals(obj);
    }
    com.google.cloud.talent.v4beta1.CustomAttribute other =
        (com.google.cloud.talent.v4beta1.CustomAttribute) obj;

    if (!getStringValuesList().equals(other.getStringValuesList())) return false;
    if (!getLongValuesList().equals(other.getLongValuesList())) return false;
    if (getFilterable() != other.getFilterable()) 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 (getStringValuesCount() > 0) {
      hash = (37 * hash) + STRING_VALUES_FIELD_NUMBER;
      hash = (53 * hash) + getStringValuesList().hashCode();
    }
    if (getLongValuesCount() > 0) {
      hash = (37 * hash) + LONG_VALUES_FIELD_NUMBER;
      hash = (53 * hash) + getLongValuesList().hashCode();
    }
    hash = (37 * hash) + FILTERABLE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFilterable());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute 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.cloud.talent.v4beta1.CustomAttribute parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute 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.cloud.talent.v4beta1.CustomAttribute parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute 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.cloud.talent.v4beta1.CustomAttribute parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute 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(com.google.cloud.talent.v4beta1.CustomAttribute 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>
   * Custom attribute values that are either filterable or non-filterable.
   * </pre>
   *
   * Protobuf type {@code google.cloud.talent.v4beta1.CustomAttribute}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.talent.v4beta1.CustomAttribute)
      com.google.cloud.talent.v4beta1.CustomAttributeOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.talent.v4beta1.CommonProto
          .internal_static_google_cloud_talent_v4beta1_CustomAttribute_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.talent.v4beta1.CommonProto
          .internal_static_google_cloud_talent_v4beta1_CustomAttribute_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.talent.v4beta1.CustomAttribute.class,
              com.google.cloud.talent.v4beta1.CustomAttribute.Builder.class);
    }

    // Construct using com.google.cloud.talent.v4beta1.CustomAttribute.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      stringValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      longValues_ = emptyLongList();
      bitField0_ = (bitField0_ & ~0x00000002);
      filterable_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.talent.v4beta1.CommonProto
          .internal_static_google_cloud_talent_v4beta1_CustomAttribute_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.CustomAttribute getDefaultInstanceForType() {
      return com.google.cloud.talent.v4beta1.CustomAttribute.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.CustomAttribute build() {
      com.google.cloud.talent.v4beta1.CustomAttribute result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.CustomAttribute buildPartial() {
      com.google.cloud.talent.v4beta1.CustomAttribute result =
          new com.google.cloud.talent.v4beta1.CustomAttribute(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((bitField0_ & 0x00000001) != 0)) {
        stringValues_ = stringValues_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.stringValues_ = stringValues_;
      if (((bitField0_ & 0x00000002) != 0)) {
        longValues_.makeImmutable();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.longValues_ = longValues_;
      result.filterable_ = filterable_;
      result.bitField0_ = to_bitField0_;
      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 com.google.cloud.talent.v4beta1.CustomAttribute) {
        return mergeFrom((com.google.cloud.talent.v4beta1.CustomAttribute) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.talent.v4beta1.CustomAttribute other) {
      if (other == com.google.cloud.talent.v4beta1.CustomAttribute.getDefaultInstance())
        return this;
      if (!other.stringValues_.isEmpty()) {
        if (stringValues_.isEmpty()) {
          stringValues_ = other.stringValues_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureStringValuesIsMutable();
          stringValues_.addAll(other.stringValues_);
        }
        onChanged();
      }
      if (!other.longValues_.isEmpty()) {
        if (longValues_.isEmpty()) {
          longValues_ = other.longValues_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureLongValuesIsMutable();
          longValues_.addAll(other.longValues_);
        }
        onChanged();
      }
      if (other.getFilterable() != false) {
        setFilterable(other.getFilterable());
      }
      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 {
      com.google.cloud.talent.v4beta1.CustomAttribute parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.talent.v4beta1.CustomAttribute) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.LazyStringList stringValues_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureStringValuesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        stringValues_ = new com.google.protobuf.LazyStringArrayList(stringValues_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public com.google.protobuf.ProtocolStringList getStringValuesList() {
      return stringValues_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public int getStringValuesCount() {
      return stringValues_.size();
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public java.lang.String getStringValues(int index) {
      return stringValues_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public com.google.protobuf.ByteString getStringValuesBytes(int index) {
      return stringValues_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public Builder setStringValues(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureStringValuesIsMutable();
      stringValues_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public Builder addStringValues(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureStringValuesIsMutable();
      stringValues_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public Builder addAllStringValues(java.lang.Iterable<java.lang.String> values) {
      ensureStringValuesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stringValues_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public Builder clearStringValues() {
      stringValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
     * `CASE_INSENSITIVE_MATCH`) search.
     * For filterable `string_value`s, a maximum total number of 200 values
     * is allowed, with each `string_value` has a byte size of no more than
     * 255B. For unfilterable `string_values`, the maximum total byte size of
     * unfilterable `string_values` is 50KB.
     * Empty string isn't allowed.
     * </pre>
     *
     * <code>repeated string string_values = 1;</code>
     */
    public Builder addStringValuesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureStringValuesIsMutable();
      stringValues_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.Internal.LongList longValues_ = emptyLongList();

    private void ensureLongValuesIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        longValues_ = mutableCopy(longValues_);
        bitField0_ |= 0x00000002;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public java.util.List<java.lang.Long> getLongValuesList() {
      return ((bitField0_ & 0x00000002) != 0)
          ? java.util.Collections.unmodifiableList(longValues_)
          : longValues_;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public int getLongValuesCount() {
      return longValues_.size();
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public long getLongValues(int index) {
      return longValues_.getLong(index);
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public Builder setLongValues(int index, long value) {
      ensureLongValuesIsMutable();
      longValues_.setLong(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public Builder addLongValues(long value) {
      ensureLongValuesIsMutable();
      longValues_.addLong(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public Builder addAllLongValues(java.lang.Iterable<? extends java.lang.Long> values) {
      ensureLongValuesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, longValues_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional but exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must
     * be specified.
     * This field is used to perform number range search.
     * (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
     * Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported.
     * </pre>
     *
     * <code>repeated int64 long_values = 2;</code>
     */
    public Builder clearLongValues() {
      longValues_ = emptyLongList();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }

    private boolean filterable_;
    /**
     *
     *
     * <pre>
     * Optional.
     * If the `filterable` flag is true, custom field values are searchable.
     * If false, values are not searchable.
     * Default is false.
     * </pre>
     *
     * <code>bool filterable = 3;</code>
     */
    public boolean getFilterable() {
      return filterable_;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * If the `filterable` flag is true, custom field values are searchable.
     * If false, values are not searchable.
     * Default is false.
     * </pre>
     *
     * <code>bool filterable = 3;</code>
     */
    public Builder setFilterable(boolean value) {

      filterable_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * If the `filterable` flag is true, custom field values are searchable.
     * If false, values are not searchable.
     * Default is false.
     * </pre>
     *
     * <code>bool filterable = 3;</code>
     */
    public Builder clearFilterable() {

      filterable_ = false;
      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:google.cloud.talent.v4beta1.CustomAttribute)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CustomAttribute)
  private static final com.google.cloud.talent.v4beta1.CustomAttribute DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.talent.v4beta1.CustomAttribute();
  }

  public static com.google.cloud.talent.v4beta1.CustomAttribute getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.cloud.talent.v4beta1.CustomAttribute getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
