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

package com.google.cloud.talent.v4beta1;

/**
 *
 *
 * <pre>
 * Input only.
 * Geographic region of the search.
 * </pre>
 *
 * Protobuf type {@code google.cloud.talent.v4beta1.LocationFilter}
 */
public final class LocationFilter extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.talent.v4beta1.LocationFilter)
    LocationFilterOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use LocationFilter.newBuilder() to construct.
  private LocationFilter(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private LocationFilter() {
    address_ = "";
    regionCode_ = "";
    telecommutePreference_ = 0;
  }

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

  private LocationFilter(
      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();

              address_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              regionCode_ = s;
              break;
            }
          case 26:
            {
              com.google.type.LatLng.Builder subBuilder = null;
              if (latLng_ != null) {
                subBuilder = latLng_.toBuilder();
              }
              latLng_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(latLng_);
                latLng_ = subBuilder.buildPartial();
              }

              break;
            }
          case 33:
            {
              distanceInMiles_ = input.readDouble();
              break;
            }
          case 40:
            {
              int rawValue = input.readEnum();

              telecommutePreference_ = rawValue;
              break;
            }
          case 48:
            {
              negated_ = 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 {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

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

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

  /**
   *
   *
   * <pre>
   * Specify whether including telecommute jobs.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference}
   */
  public enum TelecommutePreference implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Default value if the telecommute preference isn't specified.
     * </pre>
     *
     * <code>TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0;</code>
     */
    TELECOMMUTE_PREFERENCE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * Exclude telecommute jobs.
     * </pre>
     *
     * <code>TELECOMMUTE_EXCLUDED = 1;</code>
     */
    TELECOMMUTE_EXCLUDED(1),
    /**
     *
     *
     * <pre>
     * Allow telecommute jobs.
     * </pre>
     *
     * <code>TELECOMMUTE_ALLOWED = 2;</code>
     */
    TELECOMMUTE_ALLOWED(2),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Default value if the telecommute preference isn't specified.
     * </pre>
     *
     * <code>TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0;</code>
     */
    public static final int TELECOMMUTE_PREFERENCE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * Exclude telecommute jobs.
     * </pre>
     *
     * <code>TELECOMMUTE_EXCLUDED = 1;</code>
     */
    public static final int TELECOMMUTE_EXCLUDED_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Allow telecommute jobs.
     * </pre>
     *
     * <code>TELECOMMUTE_ALLOWED = 2;</code>
     */
    public static final int TELECOMMUTE_ALLOWED_VALUE = 2;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /** @deprecated Use {@link #forNumber(int)} instead. */
    @java.lang.Deprecated
    public static TelecommutePreference valueOf(int value) {
      return forNumber(value);
    }

    public static TelecommutePreference forNumber(int value) {
      switch (value) {
        case 0:
          return TELECOMMUTE_PREFERENCE_UNSPECIFIED;
        case 1:
          return TELECOMMUTE_EXCLUDED;
        case 2:
          return TELECOMMUTE_ALLOWED;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<TelecommutePreference>
        internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<TelecommutePreference>
        internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<TelecommutePreference>() {
              public TelecommutePreference findValueByNumber(int number) {
                return TelecommutePreference.forNumber(number);
              }
            };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.talent.v4beta1.LocationFilter.getDescriptor().getEnumTypes().get(0);
    }

    private static final TelecommutePreference[] VALUES = values();

    public static TelecommutePreference valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private TelecommutePreference(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference)
  }

  public static final int ADDRESS_FIELD_NUMBER = 1;
  private volatile java.lang.Object address_;
  /**
   *
   *
   * <pre>
   * Optional.
   * The address name, such as "Mountain View" or "Bay Area".
   * </pre>
   *
   * <code>string address = 1;</code>
   */
  public java.lang.String getAddress() {
    java.lang.Object ref = address_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      address_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional.
   * The address name, such as "Mountain View" or "Bay Area".
   * </pre>
   *
   * <code>string address = 1;</code>
   */
  public com.google.protobuf.ByteString getAddressBytes() {
    java.lang.Object ref = address_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      address_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REGION_CODE_FIELD_NUMBER = 2;
  private volatile java.lang.Object regionCode_;
  /**
   *
   *
   * <pre>
   * Optional.
   * CLDR region code of the country/region of the address. This is used
   * to address ambiguity of the user-input location, for example, "Liverpool"
   * against "Liverpool, NY, US" or "Liverpool, UK".
   * Set this field if all the jobs to search against are from a same region,
   * or jobs are world-wide, but the job seeker is from a specific region.
   * See http://cldr.unicode.org/ and
   * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
   * for details. Example: "CH" for Switzerland.
   * </pre>
   *
   * <code>string region_code = 2;</code>
   */
  public java.lang.String getRegionCode() {
    java.lang.Object ref = regionCode_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      regionCode_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional.
   * CLDR region code of the country/region of the address. This is used
   * to address ambiguity of the user-input location, for example, "Liverpool"
   * against "Liverpool, NY, US" or "Liverpool, UK".
   * Set this field if all the jobs to search against are from a same region,
   * or jobs are world-wide, but the job seeker is from a specific region.
   * See http://cldr.unicode.org/ and
   * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
   * for details. Example: "CH" for Switzerland.
   * </pre>
   *
   * <code>string region_code = 2;</code>
   */
  public com.google.protobuf.ByteString getRegionCodeBytes() {
    java.lang.Object ref = regionCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      regionCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LAT_LNG_FIELD_NUMBER = 3;
  private com.google.type.LatLng latLng_;
  /**
   *
   *
   * <pre>
   * Optional.
   * The latitude and longitude of the geographic center from which to
   * search. This field's ignored if `address` is provided.
   * </pre>
   *
   * <code>.google.type.LatLng lat_lng = 3;</code>
   */
  public boolean hasLatLng() {
    return latLng_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional.
   * The latitude and longitude of the geographic center from which to
   * search. This field's ignored if `address` is provided.
   * </pre>
   *
   * <code>.google.type.LatLng lat_lng = 3;</code>
   */
  public com.google.type.LatLng getLatLng() {
    return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_;
  }
  /**
   *
   *
   * <pre>
   * Optional.
   * The latitude and longitude of the geographic center from which to
   * search. This field's ignored if `address` is provided.
   * </pre>
   *
   * <code>.google.type.LatLng lat_lng = 3;</code>
   */
  public com.google.type.LatLngOrBuilder getLatLngOrBuilder() {
    return getLatLng();
  }

  public static final int DISTANCE_IN_MILES_FIELD_NUMBER = 4;
  private double distanceInMiles_;
  /**
   *
   *
   * <pre>
   * Optional.
   * The distance_in_miles is applied when the location being searched for is
   * identified as a city or smaller. When the location being searched for is a
   * state or larger, this field is ignored.
   * </pre>
   *
   * <code>double distance_in_miles = 4;</code>
   */
  public double getDistanceInMiles() {
    return distanceInMiles_;
  }

  public static final int TELECOMMUTE_PREFERENCE_FIELD_NUMBER = 5;
  private int telecommutePreference_;
  /**
   *
   *
   * <pre>
   * Optional.
   * Allows the client to return jobs without a
   * set location, specifically, telecommuting jobs (telecomuting is considered
   * by the service as a special location.
   * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
   * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
   * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
   * ignored. If not set or set to
   * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
   * searched.
   * This filter can be used by itself to search exclusively for telecommuting
   * jobs, or it can be combined with another location
   * filter to search for a combination of job locations,
   * such as "Mountain View" or "telecommuting" jobs. However, when used in
   * combination with other location filters, telecommuting jobs can be
   * treated as less relevant than other jobs in the search response.
   * </pre>
   *
   * <code>
   * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
   * </code>
   */
  public int getTelecommutePreferenceValue() {
    return telecommutePreference_;
  }
  /**
   *
   *
   * <pre>
   * Optional.
   * Allows the client to return jobs without a
   * set location, specifically, telecommuting jobs (telecomuting is considered
   * by the service as a special location.
   * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
   * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
   * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
   * ignored. If not set or set to
   * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
   * searched.
   * This filter can be used by itself to search exclusively for telecommuting
   * jobs, or it can be combined with another location
   * filter to search for a combination of job locations,
   * such as "Mountain View" or "telecommuting" jobs. However, when used in
   * combination with other location filters, telecommuting jobs can be
   * treated as less relevant than other jobs in the search response.
   * </pre>
   *
   * <code>
   * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
   * </code>
   */
  public com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference
      getTelecommutePreference() {
    @SuppressWarnings("deprecation")
    com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference result =
        com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.valueOf(
            telecommutePreference_);
    return result == null
        ? com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.UNRECOGNIZED
        : result;
  }

  public static final int NEGATED_FIELD_NUMBER = 6;
  private boolean negated_;
  /**
   *
   *
   * <pre>
   * Optional.
   * Whether to apply negation to the filter so profiles matching the filter
   * are excluded.
   * Currently only supported in profile search.
   * </pre>
   *
   * <code>bool negated = 6;</code>
   */
  public boolean getNegated() {
    return negated_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!getAddressBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, address_);
    }
    if (!getRegionCodeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, regionCode_);
    }
    if (latLng_ != null) {
      output.writeMessage(3, getLatLng());
    }
    if (distanceInMiles_ != 0D) {
      output.writeDouble(4, distanceInMiles_);
    }
    if (telecommutePreference_
        != com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference
            .TELECOMMUTE_PREFERENCE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(5, telecommutePreference_);
    }
    if (negated_ != false) {
      output.writeBool(6, negated_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getAddressBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_);
    }
    if (!getRegionCodeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, regionCode_);
    }
    if (latLng_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLatLng());
    }
    if (distanceInMiles_ != 0D) {
      size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, distanceInMiles_);
    }
    if (telecommutePreference_
        != com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference
            .TELECOMMUTE_PREFERENCE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, telecommutePreference_);
    }
    if (negated_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, negated_);
    }
    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.LocationFilter)) {
      return super.equals(obj);
    }
    com.google.cloud.talent.v4beta1.LocationFilter other =
        (com.google.cloud.talent.v4beta1.LocationFilter) obj;

    if (!getAddress().equals(other.getAddress())) return false;
    if (!getRegionCode().equals(other.getRegionCode())) return false;
    if (hasLatLng() != other.hasLatLng()) return false;
    if (hasLatLng()) {
      if (!getLatLng().equals(other.getLatLng())) return false;
    }
    if (java.lang.Double.doubleToLongBits(getDistanceInMiles())
        != java.lang.Double.doubleToLongBits(other.getDistanceInMiles())) return false;
    if (telecommutePreference_ != other.telecommutePreference_) return false;
    if (getNegated() != other.getNegated()) 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();
    hash = (37 * hash) + ADDRESS_FIELD_NUMBER;
    hash = (53 * hash) + getAddress().hashCode();
    hash = (37 * hash) + REGION_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getRegionCode().hashCode();
    if (hasLatLng()) {
      hash = (37 * hash) + LAT_LNG_FIELD_NUMBER;
      hash = (53 * hash) + getLatLng().hashCode();
    }
    hash = (37 * hash) + DISTANCE_IN_MILES_FIELD_NUMBER;
    hash =
        (53 * hash)
            + com.google.protobuf.Internal.hashLong(
                java.lang.Double.doubleToLongBits(getDistanceInMiles()));
    hash = (37 * hash) + TELECOMMUTE_PREFERENCE_FIELD_NUMBER;
    hash = (53 * hash) + telecommutePreference_;
    hash = (37 * hash) + NEGATED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNegated());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.talent.v4beta1.LocationFilter 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.LocationFilter 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.LocationFilter 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.LocationFilter 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>
   * Input only.
   * Geographic region of the search.
   * </pre>
   *
   * Protobuf type {@code google.cloud.talent.v4beta1.LocationFilter}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.talent.v4beta1.LocationFilter)
      com.google.cloud.talent.v4beta1.LocationFilterOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.talent.v4beta1.FiltersProto
          .internal_static_google_cloud_talent_v4beta1_LocationFilter_descriptor;
    }

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

    // Construct using com.google.cloud.talent.v4beta1.LocationFilter.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();
      address_ = "";

      regionCode_ = "";

      if (latLngBuilder_ == null) {
        latLng_ = null;
      } else {
        latLng_ = null;
        latLngBuilder_ = null;
      }
      distanceInMiles_ = 0D;

      telecommutePreference_ = 0;

      negated_ = false;

      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.LocationFilter buildPartial() {
      com.google.cloud.talent.v4beta1.LocationFilter result =
          new com.google.cloud.talent.v4beta1.LocationFilter(this);
      result.address_ = address_;
      result.regionCode_ = regionCode_;
      if (latLngBuilder_ == null) {
        result.latLng_ = latLng_;
      } else {
        result.latLng_ = latLngBuilder_.build();
      }
      result.distanceInMiles_ = distanceInMiles_;
      result.telecommutePreference_ = telecommutePreference_;
      result.negated_ = negated_;
      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.LocationFilter) {
        return mergeFrom((com.google.cloud.talent.v4beta1.LocationFilter) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.talent.v4beta1.LocationFilter other) {
      if (other == com.google.cloud.talent.v4beta1.LocationFilter.getDefaultInstance()) return this;
      if (!other.getAddress().isEmpty()) {
        address_ = other.address_;
        onChanged();
      }
      if (!other.getRegionCode().isEmpty()) {
        regionCode_ = other.regionCode_;
        onChanged();
      }
      if (other.hasLatLng()) {
        mergeLatLng(other.getLatLng());
      }
      if (other.getDistanceInMiles() != 0D) {
        setDistanceInMiles(other.getDistanceInMiles());
      }
      if (other.telecommutePreference_ != 0) {
        setTelecommutePreferenceValue(other.getTelecommutePreferenceValue());
      }
      if (other.getNegated() != false) {
        setNegated(other.getNegated());
      }
      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.LocationFilter parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.talent.v4beta1.LocationFilter) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object address_ = "";
    /**
     *
     *
     * <pre>
     * Optional.
     * The address name, such as "Mountain View" or "Bay Area".
     * </pre>
     *
     * <code>string address = 1;</code>
     */
    public java.lang.String getAddress() {
      java.lang.Object ref = address_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        address_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The address name, such as "Mountain View" or "Bay Area".
     * </pre>
     *
     * <code>string address = 1;</code>
     */
    public com.google.protobuf.ByteString getAddressBytes() {
      java.lang.Object ref = address_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        address_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The address name, such as "Mountain View" or "Bay Area".
     * </pre>
     *
     * <code>string address = 1;</code>
     */
    public Builder setAddress(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      address_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The address name, such as "Mountain View" or "Bay Area".
     * </pre>
     *
     * <code>string address = 1;</code>
     */
    public Builder clearAddress() {

      address_ = getDefaultInstance().getAddress();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The address name, such as "Mountain View" or "Bay Area".
     * </pre>
     *
     * <code>string address = 1;</code>
     */
    public Builder setAddressBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      address_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object regionCode_ = "";
    /**
     *
     *
     * <pre>
     * Optional.
     * CLDR region code of the country/region of the address. This is used
     * to address ambiguity of the user-input location, for example, "Liverpool"
     * against "Liverpool, NY, US" or "Liverpool, UK".
     * Set this field if all the jobs to search against are from a same region,
     * or jobs are world-wide, but the job seeker is from a specific region.
     * See http://cldr.unicode.org/ and
     * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
     * for details. Example: "CH" for Switzerland.
     * </pre>
     *
     * <code>string region_code = 2;</code>
     */
    public java.lang.String getRegionCode() {
      java.lang.Object ref = regionCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        regionCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * CLDR region code of the country/region of the address. This is used
     * to address ambiguity of the user-input location, for example, "Liverpool"
     * against "Liverpool, NY, US" or "Liverpool, UK".
     * Set this field if all the jobs to search against are from a same region,
     * or jobs are world-wide, but the job seeker is from a specific region.
     * See http://cldr.unicode.org/ and
     * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
     * for details. Example: "CH" for Switzerland.
     * </pre>
     *
     * <code>string region_code = 2;</code>
     */
    public com.google.protobuf.ByteString getRegionCodeBytes() {
      java.lang.Object ref = regionCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        regionCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * CLDR region code of the country/region of the address. This is used
     * to address ambiguity of the user-input location, for example, "Liverpool"
     * against "Liverpool, NY, US" or "Liverpool, UK".
     * Set this field if all the jobs to search against are from a same region,
     * or jobs are world-wide, but the job seeker is from a specific region.
     * See http://cldr.unicode.org/ and
     * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
     * for details. Example: "CH" for Switzerland.
     * </pre>
     *
     * <code>string region_code = 2;</code>
     */
    public Builder setRegionCode(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      regionCode_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * CLDR region code of the country/region of the address. This is used
     * to address ambiguity of the user-input location, for example, "Liverpool"
     * against "Liverpool, NY, US" or "Liverpool, UK".
     * Set this field if all the jobs to search against are from a same region,
     * or jobs are world-wide, but the job seeker is from a specific region.
     * See http://cldr.unicode.org/ and
     * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
     * for details. Example: "CH" for Switzerland.
     * </pre>
     *
     * <code>string region_code = 2;</code>
     */
    public Builder clearRegionCode() {

      regionCode_ = getDefaultInstance().getRegionCode();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * CLDR region code of the country/region of the address. This is used
     * to address ambiguity of the user-input location, for example, "Liverpool"
     * against "Liverpool, NY, US" or "Liverpool, UK".
     * Set this field if all the jobs to search against are from a same region,
     * or jobs are world-wide, but the job seeker is from a specific region.
     * See http://cldr.unicode.org/ and
     * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
     * for details. Example: "CH" for Switzerland.
     * </pre>
     *
     * <code>string region_code = 2;</code>
     */
    public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      regionCode_ = value;
      onChanged();
      return this;
    }

    private com.google.type.LatLng latLng_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>
        latLngBuilder_;
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public boolean hasLatLng() {
      return latLngBuilder_ != null || latLng_ != null;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public com.google.type.LatLng getLatLng() {
      if (latLngBuilder_ == null) {
        return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_;
      } else {
        return latLngBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder setLatLng(com.google.type.LatLng value) {
      if (latLngBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        latLng_ = value;
        onChanged();
      } else {
        latLngBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder setLatLng(com.google.type.LatLng.Builder builderForValue) {
      if (latLngBuilder_ == null) {
        latLng_ = builderForValue.build();
        onChanged();
      } else {
        latLngBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder mergeLatLng(com.google.type.LatLng value) {
      if (latLngBuilder_ == null) {
        if (latLng_ != null) {
          latLng_ = com.google.type.LatLng.newBuilder(latLng_).mergeFrom(value).buildPartial();
        } else {
          latLng_ = value;
        }
        onChanged();
      } else {
        latLngBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder clearLatLng() {
      if (latLngBuilder_ == null) {
        latLng_ = null;
        onChanged();
      } else {
        latLng_ = null;
        latLngBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public com.google.type.LatLng.Builder getLatLngBuilder() {

      onChanged();
      return getLatLngFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public com.google.type.LatLngOrBuilder getLatLngOrBuilder() {
      if (latLngBuilder_ != null) {
        return latLngBuilder_.getMessageOrBuilder();
      } else {
        return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The latitude and longitude of the geographic center from which to
     * search. This field's ignored if `address` is provided.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>
        getLatLngFieldBuilder() {
      if (latLngBuilder_ == null) {
        latLngBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.type.LatLng,
                com.google.type.LatLng.Builder,
                com.google.type.LatLngOrBuilder>(getLatLng(), getParentForChildren(), isClean());
        latLng_ = null;
      }
      return latLngBuilder_;
    }

    private double distanceInMiles_;
    /**
     *
     *
     * <pre>
     * Optional.
     * The distance_in_miles is applied when the location being searched for is
     * identified as a city or smaller. When the location being searched for is a
     * state or larger, this field is ignored.
     * </pre>
     *
     * <code>double distance_in_miles = 4;</code>
     */
    public double getDistanceInMiles() {
      return distanceInMiles_;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The distance_in_miles is applied when the location being searched for is
     * identified as a city or smaller. When the location being searched for is a
     * state or larger, this field is ignored.
     * </pre>
     *
     * <code>double distance_in_miles = 4;</code>
     */
    public Builder setDistanceInMiles(double value) {

      distanceInMiles_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * The distance_in_miles is applied when the location being searched for is
     * identified as a city or smaller. When the location being searched for is a
     * state or larger, this field is ignored.
     * </pre>
     *
     * <code>double distance_in_miles = 4;</code>
     */
    public Builder clearDistanceInMiles() {

      distanceInMiles_ = 0D;
      onChanged();
      return this;
    }

    private int telecommutePreference_ = 0;
    /**
     *
     *
     * <pre>
     * Optional.
     * Allows the client to return jobs without a
     * set location, specifically, telecommuting jobs (telecomuting is considered
     * by the service as a special location.
     * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
     * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
     * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
     * ignored. If not set or set to
     * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
     * searched.
     * This filter can be used by itself to search exclusively for telecommuting
     * jobs, or it can be combined with another location
     * filter to search for a combination of job locations,
     * such as "Mountain View" or "telecommuting" jobs. However, when used in
     * combination with other location filters, telecommuting jobs can be
     * treated as less relevant than other jobs in the search response.
     * </pre>
     *
     * <code>
     * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
     * </code>
     */
    public int getTelecommutePreferenceValue() {
      return telecommutePreference_;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * Allows the client to return jobs without a
     * set location, specifically, telecommuting jobs (telecomuting is considered
     * by the service as a special location.
     * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
     * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
     * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
     * ignored. If not set or set to
     * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
     * searched.
     * This filter can be used by itself to search exclusively for telecommuting
     * jobs, or it can be combined with another location
     * filter to search for a combination of job locations,
     * such as "Mountain View" or "telecommuting" jobs. However, when used in
     * combination with other location filters, telecommuting jobs can be
     * treated as less relevant than other jobs in the search response.
     * </pre>
     *
     * <code>
     * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
     * </code>
     */
    public Builder setTelecommutePreferenceValue(int value) {
      telecommutePreference_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * Allows the client to return jobs without a
     * set location, specifically, telecommuting jobs (telecomuting is considered
     * by the service as a special location.
     * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
     * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
     * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
     * ignored. If not set or set to
     * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
     * searched.
     * This filter can be used by itself to search exclusively for telecommuting
     * jobs, or it can be combined with another location
     * filter to search for a combination of job locations,
     * such as "Mountain View" or "telecommuting" jobs. However, when used in
     * combination with other location filters, telecommuting jobs can be
     * treated as less relevant than other jobs in the search response.
     * </pre>
     *
     * <code>
     * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
     * </code>
     */
    public com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference
        getTelecommutePreference() {
      @SuppressWarnings("deprecation")
      com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference result =
          com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.valueOf(
              telecommutePreference_);
      return result == null
          ? com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * Allows the client to return jobs without a
     * set location, specifically, telecommuting jobs (telecomuting is considered
     * by the service as a special location.
     * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
     * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
     * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
     * ignored. If not set or set to
     * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
     * searched.
     * This filter can be used by itself to search exclusively for telecommuting
     * jobs, or it can be combined with another location
     * filter to search for a combination of job locations,
     * such as "Mountain View" or "telecommuting" jobs. However, when used in
     * combination with other location filters, telecommuting jobs can be
     * treated as less relevant than other jobs in the search response.
     * </pre>
     *
     * <code>
     * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
     * </code>
     */
    public Builder setTelecommutePreference(
        com.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference value) {
      if (value == null) {
        throw new NullPointerException();
      }

      telecommutePreference_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * Allows the client to return jobs without a
     * set location, specifically, telecommuting jobs (telecomuting is considered
     * by the service as a special location.
     * [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting.
     * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED],
     * telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are
     * ignored. If not set or set to
     * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not
     * searched.
     * This filter can be used by itself to search exclusively for telecommuting
     * jobs, or it can be combined with another location
     * filter to search for a combination of job locations,
     * such as "Mountain View" or "telecommuting" jobs. However, when used in
     * combination with other location filters, telecommuting jobs can be
     * treated as less relevant than other jobs in the search response.
     * </pre>
     *
     * <code>
     * .google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference telecommute_preference = 5;
     * </code>
     */
    public Builder clearTelecommutePreference() {

      telecommutePreference_ = 0;
      onChanged();
      return this;
    }

    private boolean negated_;
    /**
     *
     *
     * <pre>
     * Optional.
     * Whether to apply negation to the filter so profiles matching the filter
     * are excluded.
     * Currently only supported in profile search.
     * </pre>
     *
     * <code>bool negated = 6;</code>
     */
    public boolean getNegated() {
      return negated_;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * Whether to apply negation to the filter so profiles matching the filter
     * are excluded.
     * Currently only supported in profile search.
     * </pre>
     *
     * <code>bool negated = 6;</code>
     */
    public Builder setNegated(boolean value) {

      negated_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional.
     * Whether to apply negation to the filter so profiles matching the filter
     * are excluded.
     * Currently only supported in profile search.
     * </pre>
     *
     * <code>bool negated = 6;</code>
     */
    public Builder clearNegated() {

      negated_ = 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.LocationFilter)
  }

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

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

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

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

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

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

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