/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/dataflow/v1beta3/streaming.proto

package com.google.dataflow.v1beta3;

/**
 *
 *
 * <pre>
 * Describes a stream of data, either as input to be processed or as
 * output of a streaming Dataflow job.
 * </pre>
 *
 * Protobuf type {@code google.dataflow.v1beta3.StreamLocation}
 */
public final class StreamLocation extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.dataflow.v1beta3.StreamLocation)
    StreamLocationOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use StreamLocation.newBuilder() to construct.
  private StreamLocation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private StreamLocation() {}

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

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.dataflow.v1beta3.StreamingProto
        .internal_static_google_dataflow_v1beta3_StreamLocation_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.dataflow.v1beta3.StreamingProto
        .internal_static_google_dataflow_v1beta3_StreamLocation_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.dataflow.v1beta3.StreamLocation.class,
            com.google.dataflow.v1beta3.StreamLocation.Builder.class);
  }

  private int locationCase_ = 0;
  private java.lang.Object location_;

  public enum LocationCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    STREAMING_STAGE_LOCATION(1),
    PUBSUB_LOCATION(2),
    SIDE_INPUT_LOCATION(3),
    CUSTOM_SOURCE_LOCATION(4),
    LOCATION_NOT_SET(0);
    private final int value;

    private LocationCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static LocationCase valueOf(int value) {
      return forNumber(value);
    }

    public static LocationCase forNumber(int value) {
      switch (value) {
        case 1:
          return STREAMING_STAGE_LOCATION;
        case 2:
          return PUBSUB_LOCATION;
        case 3:
          return SIDE_INPUT_LOCATION;
        case 4:
          return CUSTOM_SOURCE_LOCATION;
        case 0:
          return LOCATION_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public LocationCase getLocationCase() {
    return LocationCase.forNumber(locationCase_);
  }

  public static final int STREAMING_STAGE_LOCATION_FIELD_NUMBER = 1;
  /**
   *
   *
   * <pre>
   * The stream is part of another computation within the current
   * streaming Dataflow job.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
   *
   * @return Whether the streamingStageLocation field is set.
   */
  @java.lang.Override
  public boolean hasStreamingStageLocation() {
    return locationCase_ == 1;
  }
  /**
   *
   *
   * <pre>
   * The stream is part of another computation within the current
   * streaming Dataflow job.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
   *
   * @return The streamingStageLocation.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.StreamingStageLocation getStreamingStageLocation() {
    if (locationCase_ == 1) {
      return (com.google.dataflow.v1beta3.StreamingStageLocation) location_;
    }
    return com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The stream is part of another computation within the current
   * streaming Dataflow job.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.StreamingStageLocationOrBuilder
      getStreamingStageLocationOrBuilder() {
    if (locationCase_ == 1) {
      return (com.google.dataflow.v1beta3.StreamingStageLocation) location_;
    }
    return com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance();
  }

  public static final int PUBSUB_LOCATION_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * The stream is a pubsub stream.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
   *
   * @return Whether the pubsubLocation field is set.
   */
  @java.lang.Override
  public boolean hasPubsubLocation() {
    return locationCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * The stream is a pubsub stream.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
   *
   * @return The pubsubLocation.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.PubsubLocation getPubsubLocation() {
    if (locationCase_ == 2) {
      return (com.google.dataflow.v1beta3.PubsubLocation) location_;
    }
    return com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The stream is a pubsub stream.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.PubsubLocationOrBuilder getPubsubLocationOrBuilder() {
    if (locationCase_ == 2) {
      return (com.google.dataflow.v1beta3.PubsubLocation) location_;
    }
    return com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
  }

  public static final int SIDE_INPUT_LOCATION_FIELD_NUMBER = 3;
  /**
   *
   *
   * <pre>
   * The stream is a streaming side input.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
   *
   * @return Whether the sideInputLocation field is set.
   */
  @java.lang.Override
  public boolean hasSideInputLocation() {
    return locationCase_ == 3;
  }
  /**
   *
   *
   * <pre>
   * The stream is a streaming side input.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
   *
   * @return The sideInputLocation.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.StreamingSideInputLocation getSideInputLocation() {
    if (locationCase_ == 3) {
      return (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_;
    }
    return com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The stream is a streaming side input.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.StreamingSideInputLocationOrBuilder
      getSideInputLocationOrBuilder() {
    if (locationCase_ == 3) {
      return (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_;
    }
    return com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance();
  }

  public static final int CUSTOM_SOURCE_LOCATION_FIELD_NUMBER = 4;
  /**
   *
   *
   * <pre>
   * The stream is a custom source.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
   *
   * @return Whether the customSourceLocation field is set.
   */
  @java.lang.Override
  public boolean hasCustomSourceLocation() {
    return locationCase_ == 4;
  }
  /**
   *
   *
   * <pre>
   * The stream is a custom source.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
   *
   * @return The customSourceLocation.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.CustomSourceLocation getCustomSourceLocation() {
    if (locationCase_ == 4) {
      return (com.google.dataflow.v1beta3.CustomSourceLocation) location_;
    }
    return com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The stream is a custom source.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.CustomSourceLocationOrBuilder
      getCustomSourceLocationOrBuilder() {
    if (locationCase_ == 4) {
      return (com.google.dataflow.v1beta3.CustomSourceLocation) location_;
    }
    return com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance();
  }

  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 (locationCase_ == 1) {
      output.writeMessage(1, (com.google.dataflow.v1beta3.StreamingStageLocation) location_);
    }
    if (locationCase_ == 2) {
      output.writeMessage(2, (com.google.dataflow.v1beta3.PubsubLocation) location_);
    }
    if (locationCase_ == 3) {
      output.writeMessage(3, (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_);
    }
    if (locationCase_ == 4) {
      output.writeMessage(4, (com.google.dataflow.v1beta3.CustomSourceLocation) location_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (locationCase_ == 1) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              1, (com.google.dataflow.v1beta3.StreamingStageLocation) location_);
    }
    if (locationCase_ == 2) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              2, (com.google.dataflow.v1beta3.PubsubLocation) location_);
    }
    if (locationCase_ == 3) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_);
    }
    if (locationCase_ == 4) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              4, (com.google.dataflow.v1beta3.CustomSourceLocation) location_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.dataflow.v1beta3.StreamLocation)) {
      return super.equals(obj);
    }
    com.google.dataflow.v1beta3.StreamLocation other =
        (com.google.dataflow.v1beta3.StreamLocation) obj;

    if (!getLocationCase().equals(other.getLocationCase())) return false;
    switch (locationCase_) {
      case 1:
        if (!getStreamingStageLocation().equals(other.getStreamingStageLocation())) return false;
        break;
      case 2:
        if (!getPubsubLocation().equals(other.getPubsubLocation())) return false;
        break;
      case 3:
        if (!getSideInputLocation().equals(other.getSideInputLocation())) return false;
        break;
      case 4:
        if (!getCustomSourceLocation().equals(other.getCustomSourceLocation())) return false;
        break;
      case 0:
      default:
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    switch (locationCase_) {
      case 1:
        hash = (37 * hash) + STREAMING_STAGE_LOCATION_FIELD_NUMBER;
        hash = (53 * hash) + getStreamingStageLocation().hashCode();
        break;
      case 2:
        hash = (37 * hash) + PUBSUB_LOCATION_FIELD_NUMBER;
        hash = (53 * hash) + getPubsubLocation().hashCode();
        break;
      case 3:
        hash = (37 * hash) + SIDE_INPUT_LOCATION_FIELD_NUMBER;
        hash = (53 * hash) + getSideInputLocation().hashCode();
        break;
      case 4:
        hash = (37 * hash) + CUSTOM_SOURCE_LOCATION_FIELD_NUMBER;
        hash = (53 * hash) + getCustomSourceLocation().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.dataflow.v1beta3.StreamLocation parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.StreamLocation parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.StreamLocation parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.dataflow.v1beta3.StreamLocation parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.StreamLocation parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.dataflow.v1beta3.StreamLocation 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.dataflow.v1beta3.StreamLocation 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>
   * Describes a stream of data, either as input to be processed or as
   * output of a streaming Dataflow job.
   * </pre>
   *
   * Protobuf type {@code google.dataflow.v1beta3.StreamLocation}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.dataflow.v1beta3.StreamLocation)
      com.google.dataflow.v1beta3.StreamLocationOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_StreamLocation_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_StreamLocation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.dataflow.v1beta3.StreamLocation.class,
              com.google.dataflow.v1beta3.StreamLocation.Builder.class);
    }

    // Construct using com.google.dataflow.v1beta3.StreamLocation.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (streamingStageLocationBuilder_ != null) {
        streamingStageLocationBuilder_.clear();
      }
      if (pubsubLocationBuilder_ != null) {
        pubsubLocationBuilder_.clear();
      }
      if (sideInputLocationBuilder_ != null) {
        sideInputLocationBuilder_.clear();
      }
      if (customSourceLocationBuilder_ != null) {
        customSourceLocationBuilder_.clear();
      }
      locationCase_ = 0;
      location_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_StreamLocation_descriptor;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamLocation getDefaultInstanceForType() {
      return com.google.dataflow.v1beta3.StreamLocation.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamLocation build() {
      com.google.dataflow.v1beta3.StreamLocation result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamLocation buildPartial() {
      com.google.dataflow.v1beta3.StreamLocation result =
          new com.google.dataflow.v1beta3.StreamLocation(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      buildPartialOneofs(result);
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.dataflow.v1beta3.StreamLocation result) {
      int from_bitField0_ = bitField0_;
    }

    private void buildPartialOneofs(com.google.dataflow.v1beta3.StreamLocation result) {
      result.locationCase_ = locationCase_;
      result.location_ = this.location_;
      if (locationCase_ == 1 && streamingStageLocationBuilder_ != null) {
        result.location_ = streamingStageLocationBuilder_.build();
      }
      if (locationCase_ == 2 && pubsubLocationBuilder_ != null) {
        result.location_ = pubsubLocationBuilder_.build();
      }
      if (locationCase_ == 3 && sideInputLocationBuilder_ != null) {
        result.location_ = sideInputLocationBuilder_.build();
      }
      if (locationCase_ == 4 && customSourceLocationBuilder_ != null) {
        result.location_ = customSourceLocationBuilder_.build();
      }
    }

    @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.dataflow.v1beta3.StreamLocation) {
        return mergeFrom((com.google.dataflow.v1beta3.StreamLocation) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.dataflow.v1beta3.StreamLocation other) {
      if (other == com.google.dataflow.v1beta3.StreamLocation.getDefaultInstance()) return this;
      switch (other.getLocationCase()) {
        case STREAMING_STAGE_LOCATION:
          {
            mergeStreamingStageLocation(other.getStreamingStageLocation());
            break;
          }
        case PUBSUB_LOCATION:
          {
            mergePubsubLocation(other.getPubsubLocation());
            break;
          }
        case SIDE_INPUT_LOCATION:
          {
            mergeSideInputLocation(other.getSideInputLocation());
            break;
          }
        case CUSTOM_SOURCE_LOCATION:
          {
            mergeCustomSourceLocation(other.getCustomSourceLocation());
            break;
          }
        case LOCATION_NOT_SET:
          {
            break;
          }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                input.readMessage(
                    getStreamingStageLocationFieldBuilder().getBuilder(), extensionRegistry);
                locationCase_ = 1;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getPubsubLocationFieldBuilder().getBuilder(), extensionRegistry);
                locationCase_ = 2;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(
                    getSideInputLocationFieldBuilder().getBuilder(), extensionRegistry);
                locationCase_ = 3;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(
                    getCustomSourceLocationFieldBuilder().getBuilder(), extensionRegistry);
                locationCase_ = 4;
                break;
              } // case 34
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int locationCase_ = 0;
    private java.lang.Object location_;

    public LocationCase getLocationCase() {
      return LocationCase.forNumber(locationCase_);
    }

    public Builder clearLocation() {
      locationCase_ = 0;
      location_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.StreamingStageLocation,
            com.google.dataflow.v1beta3.StreamingStageLocation.Builder,
            com.google.dataflow.v1beta3.StreamingStageLocationOrBuilder>
        streamingStageLocationBuilder_;
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     *
     * @return Whether the streamingStageLocation field is set.
     */
    @java.lang.Override
    public boolean hasStreamingStageLocation() {
      return locationCase_ == 1;
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     *
     * @return The streamingStageLocation.
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamingStageLocation getStreamingStageLocation() {
      if (streamingStageLocationBuilder_ == null) {
        if (locationCase_ == 1) {
          return (com.google.dataflow.v1beta3.StreamingStageLocation) location_;
        }
        return com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance();
      } else {
        if (locationCase_ == 1) {
          return streamingStageLocationBuilder_.getMessage();
        }
        return com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    public Builder setStreamingStageLocation(
        com.google.dataflow.v1beta3.StreamingStageLocation value) {
      if (streamingStageLocationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        location_ = value;
        onChanged();
      } else {
        streamingStageLocationBuilder_.setMessage(value);
      }
      locationCase_ = 1;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    public Builder setStreamingStageLocation(
        com.google.dataflow.v1beta3.StreamingStageLocation.Builder builderForValue) {
      if (streamingStageLocationBuilder_ == null) {
        location_ = builderForValue.build();
        onChanged();
      } else {
        streamingStageLocationBuilder_.setMessage(builderForValue.build());
      }
      locationCase_ = 1;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    public Builder mergeStreamingStageLocation(
        com.google.dataflow.v1beta3.StreamingStageLocation value) {
      if (streamingStageLocationBuilder_ == null) {
        if (locationCase_ == 1
            && location_
                != com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance()) {
          location_ =
              com.google.dataflow.v1beta3.StreamingStageLocation.newBuilder(
                      (com.google.dataflow.v1beta3.StreamingStageLocation) location_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          location_ = value;
        }
        onChanged();
      } else {
        if (locationCase_ == 1) {
          streamingStageLocationBuilder_.mergeFrom(value);
        } else {
          streamingStageLocationBuilder_.setMessage(value);
        }
      }
      locationCase_ = 1;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    public Builder clearStreamingStageLocation() {
      if (streamingStageLocationBuilder_ == null) {
        if (locationCase_ == 1) {
          locationCase_ = 0;
          location_ = null;
          onChanged();
        }
      } else {
        if (locationCase_ == 1) {
          locationCase_ = 0;
          location_ = null;
        }
        streamingStageLocationBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    public com.google.dataflow.v1beta3.StreamingStageLocation.Builder
        getStreamingStageLocationBuilder() {
      return getStreamingStageLocationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamingStageLocationOrBuilder
        getStreamingStageLocationOrBuilder() {
      if ((locationCase_ == 1) && (streamingStageLocationBuilder_ != null)) {
        return streamingStageLocationBuilder_.getMessageOrBuilder();
      } else {
        if (locationCase_ == 1) {
          return (com.google.dataflow.v1beta3.StreamingStageLocation) location_;
        }
        return com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.StreamingStageLocation,
            com.google.dataflow.v1beta3.StreamingStageLocation.Builder,
            com.google.dataflow.v1beta3.StreamingStageLocationOrBuilder>
        getStreamingStageLocationFieldBuilder() {
      if (streamingStageLocationBuilder_ == null) {
        if (!(locationCase_ == 1)) {
          location_ = com.google.dataflow.v1beta3.StreamingStageLocation.getDefaultInstance();
        }
        streamingStageLocationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.StreamingStageLocation,
                com.google.dataflow.v1beta3.StreamingStageLocation.Builder,
                com.google.dataflow.v1beta3.StreamingStageLocationOrBuilder>(
                (com.google.dataflow.v1beta3.StreamingStageLocation) location_,
                getParentForChildren(),
                isClean());
        location_ = null;
      }
      locationCase_ = 1;
      onChanged();
      return streamingStageLocationBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.PubsubLocation,
            com.google.dataflow.v1beta3.PubsubLocation.Builder,
            com.google.dataflow.v1beta3.PubsubLocationOrBuilder>
        pubsubLocationBuilder_;
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     *
     * @return Whether the pubsubLocation field is set.
     */
    @java.lang.Override
    public boolean hasPubsubLocation() {
      return locationCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     *
     * @return The pubsubLocation.
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.PubsubLocation getPubsubLocation() {
      if (pubsubLocationBuilder_ == null) {
        if (locationCase_ == 2) {
          return (com.google.dataflow.v1beta3.PubsubLocation) location_;
        }
        return com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
      } else {
        if (locationCase_ == 2) {
          return pubsubLocationBuilder_.getMessage();
        }
        return com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    public Builder setPubsubLocation(com.google.dataflow.v1beta3.PubsubLocation value) {
      if (pubsubLocationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        location_ = value;
        onChanged();
      } else {
        pubsubLocationBuilder_.setMessage(value);
      }
      locationCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    public Builder setPubsubLocation(
        com.google.dataflow.v1beta3.PubsubLocation.Builder builderForValue) {
      if (pubsubLocationBuilder_ == null) {
        location_ = builderForValue.build();
        onChanged();
      } else {
        pubsubLocationBuilder_.setMessage(builderForValue.build());
      }
      locationCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    public Builder mergePubsubLocation(com.google.dataflow.v1beta3.PubsubLocation value) {
      if (pubsubLocationBuilder_ == null) {
        if (locationCase_ == 2
            && location_ != com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance()) {
          location_ =
              com.google.dataflow.v1beta3.PubsubLocation.newBuilder(
                      (com.google.dataflow.v1beta3.PubsubLocation) location_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          location_ = value;
        }
        onChanged();
      } else {
        if (locationCase_ == 2) {
          pubsubLocationBuilder_.mergeFrom(value);
        } else {
          pubsubLocationBuilder_.setMessage(value);
        }
      }
      locationCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    public Builder clearPubsubLocation() {
      if (pubsubLocationBuilder_ == null) {
        if (locationCase_ == 2) {
          locationCase_ = 0;
          location_ = null;
          onChanged();
        }
      } else {
        if (locationCase_ == 2) {
          locationCase_ = 0;
          location_ = null;
        }
        pubsubLocationBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    public com.google.dataflow.v1beta3.PubsubLocation.Builder getPubsubLocationBuilder() {
      return getPubsubLocationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.PubsubLocationOrBuilder getPubsubLocationOrBuilder() {
      if ((locationCase_ == 2) && (pubsubLocationBuilder_ != null)) {
        return pubsubLocationBuilder_.getMessageOrBuilder();
      } else {
        if (locationCase_ == 2) {
          return (com.google.dataflow.v1beta3.PubsubLocation) location_;
        }
        return com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is a pubsub stream.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.PubsubLocation,
            com.google.dataflow.v1beta3.PubsubLocation.Builder,
            com.google.dataflow.v1beta3.PubsubLocationOrBuilder>
        getPubsubLocationFieldBuilder() {
      if (pubsubLocationBuilder_ == null) {
        if (!(locationCase_ == 2)) {
          location_ = com.google.dataflow.v1beta3.PubsubLocation.getDefaultInstance();
        }
        pubsubLocationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.PubsubLocation,
                com.google.dataflow.v1beta3.PubsubLocation.Builder,
                com.google.dataflow.v1beta3.PubsubLocationOrBuilder>(
                (com.google.dataflow.v1beta3.PubsubLocation) location_,
                getParentForChildren(),
                isClean());
        location_ = null;
      }
      locationCase_ = 2;
      onChanged();
      return pubsubLocationBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.StreamingSideInputLocation,
            com.google.dataflow.v1beta3.StreamingSideInputLocation.Builder,
            com.google.dataflow.v1beta3.StreamingSideInputLocationOrBuilder>
        sideInputLocationBuilder_;
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     *
     * @return Whether the sideInputLocation field is set.
     */
    @java.lang.Override
    public boolean hasSideInputLocation() {
      return locationCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     *
     * @return The sideInputLocation.
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamingSideInputLocation getSideInputLocation() {
      if (sideInputLocationBuilder_ == null) {
        if (locationCase_ == 3) {
          return (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_;
        }
        return com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance();
      } else {
        if (locationCase_ == 3) {
          return sideInputLocationBuilder_.getMessage();
        }
        return com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    public Builder setSideInputLocation(
        com.google.dataflow.v1beta3.StreamingSideInputLocation value) {
      if (sideInputLocationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        location_ = value;
        onChanged();
      } else {
        sideInputLocationBuilder_.setMessage(value);
      }
      locationCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    public Builder setSideInputLocation(
        com.google.dataflow.v1beta3.StreamingSideInputLocation.Builder builderForValue) {
      if (sideInputLocationBuilder_ == null) {
        location_ = builderForValue.build();
        onChanged();
      } else {
        sideInputLocationBuilder_.setMessage(builderForValue.build());
      }
      locationCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    public Builder mergeSideInputLocation(
        com.google.dataflow.v1beta3.StreamingSideInputLocation value) {
      if (sideInputLocationBuilder_ == null) {
        if (locationCase_ == 3
            && location_
                != com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance()) {
          location_ =
              com.google.dataflow.v1beta3.StreamingSideInputLocation.newBuilder(
                      (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          location_ = value;
        }
        onChanged();
      } else {
        if (locationCase_ == 3) {
          sideInputLocationBuilder_.mergeFrom(value);
        } else {
          sideInputLocationBuilder_.setMessage(value);
        }
      }
      locationCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    public Builder clearSideInputLocation() {
      if (sideInputLocationBuilder_ == null) {
        if (locationCase_ == 3) {
          locationCase_ = 0;
          location_ = null;
          onChanged();
        }
      } else {
        if (locationCase_ == 3) {
          locationCase_ = 0;
          location_ = null;
        }
        sideInputLocationBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    public com.google.dataflow.v1beta3.StreamingSideInputLocation.Builder
        getSideInputLocationBuilder() {
      return getSideInputLocationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.StreamingSideInputLocationOrBuilder
        getSideInputLocationOrBuilder() {
      if ((locationCase_ == 3) && (sideInputLocationBuilder_ != null)) {
        return sideInputLocationBuilder_.getMessageOrBuilder();
      } else {
        if (locationCase_ == 3) {
          return (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_;
        }
        return com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is a streaming side input.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.StreamingSideInputLocation,
            com.google.dataflow.v1beta3.StreamingSideInputLocation.Builder,
            com.google.dataflow.v1beta3.StreamingSideInputLocationOrBuilder>
        getSideInputLocationFieldBuilder() {
      if (sideInputLocationBuilder_ == null) {
        if (!(locationCase_ == 3)) {
          location_ = com.google.dataflow.v1beta3.StreamingSideInputLocation.getDefaultInstance();
        }
        sideInputLocationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.StreamingSideInputLocation,
                com.google.dataflow.v1beta3.StreamingSideInputLocation.Builder,
                com.google.dataflow.v1beta3.StreamingSideInputLocationOrBuilder>(
                (com.google.dataflow.v1beta3.StreamingSideInputLocation) location_,
                getParentForChildren(),
                isClean());
        location_ = null;
      }
      locationCase_ = 3;
      onChanged();
      return sideInputLocationBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.CustomSourceLocation,
            com.google.dataflow.v1beta3.CustomSourceLocation.Builder,
            com.google.dataflow.v1beta3.CustomSourceLocationOrBuilder>
        customSourceLocationBuilder_;
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     *
     * @return Whether the customSourceLocation field is set.
     */
    @java.lang.Override
    public boolean hasCustomSourceLocation() {
      return locationCase_ == 4;
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     *
     * @return The customSourceLocation.
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.CustomSourceLocation getCustomSourceLocation() {
      if (customSourceLocationBuilder_ == null) {
        if (locationCase_ == 4) {
          return (com.google.dataflow.v1beta3.CustomSourceLocation) location_;
        }
        return com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance();
      } else {
        if (locationCase_ == 4) {
          return customSourceLocationBuilder_.getMessage();
        }
        return com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    public Builder setCustomSourceLocation(com.google.dataflow.v1beta3.CustomSourceLocation value) {
      if (customSourceLocationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        location_ = value;
        onChanged();
      } else {
        customSourceLocationBuilder_.setMessage(value);
      }
      locationCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    public Builder setCustomSourceLocation(
        com.google.dataflow.v1beta3.CustomSourceLocation.Builder builderForValue) {
      if (customSourceLocationBuilder_ == null) {
        location_ = builderForValue.build();
        onChanged();
      } else {
        customSourceLocationBuilder_.setMessage(builderForValue.build());
      }
      locationCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    public Builder mergeCustomSourceLocation(
        com.google.dataflow.v1beta3.CustomSourceLocation value) {
      if (customSourceLocationBuilder_ == null) {
        if (locationCase_ == 4
            && location_ != com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance()) {
          location_ =
              com.google.dataflow.v1beta3.CustomSourceLocation.newBuilder(
                      (com.google.dataflow.v1beta3.CustomSourceLocation) location_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          location_ = value;
        }
        onChanged();
      } else {
        if (locationCase_ == 4) {
          customSourceLocationBuilder_.mergeFrom(value);
        } else {
          customSourceLocationBuilder_.setMessage(value);
        }
      }
      locationCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    public Builder clearCustomSourceLocation() {
      if (customSourceLocationBuilder_ == null) {
        if (locationCase_ == 4) {
          locationCase_ = 0;
          location_ = null;
          onChanged();
        }
      } else {
        if (locationCase_ == 4) {
          locationCase_ = 0;
          location_ = null;
        }
        customSourceLocationBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    public com.google.dataflow.v1beta3.CustomSourceLocation.Builder
        getCustomSourceLocationBuilder() {
      return getCustomSourceLocationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.CustomSourceLocationOrBuilder
        getCustomSourceLocationOrBuilder() {
      if ((locationCase_ == 4) && (customSourceLocationBuilder_ != null)) {
        return customSourceLocationBuilder_.getMessageOrBuilder();
      } else {
        if (locationCase_ == 4) {
          return (com.google.dataflow.v1beta3.CustomSourceLocation) location_;
        }
        return com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The stream is a custom source.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.CustomSourceLocation,
            com.google.dataflow.v1beta3.CustomSourceLocation.Builder,
            com.google.dataflow.v1beta3.CustomSourceLocationOrBuilder>
        getCustomSourceLocationFieldBuilder() {
      if (customSourceLocationBuilder_ == null) {
        if (!(locationCase_ == 4)) {
          location_ = com.google.dataflow.v1beta3.CustomSourceLocation.getDefaultInstance();
        }
        customSourceLocationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.CustomSourceLocation,
                com.google.dataflow.v1beta3.CustomSourceLocation.Builder,
                com.google.dataflow.v1beta3.CustomSourceLocationOrBuilder>(
                (com.google.dataflow.v1beta3.CustomSourceLocation) location_,
                getParentForChildren(),
                isClean());
        location_ = null;
      }
      locationCase_ = 4;
      onChanged();
      return customSourceLocationBuilder_;
    }

    @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.dataflow.v1beta3.StreamLocation)
  }

  // @@protoc_insertion_point(class_scope:google.dataflow.v1beta3.StreamLocation)
  private static final com.google.dataflow.v1beta3.StreamLocation DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.dataflow.v1beta3.StreamLocation();
  }

  public static com.google.dataflow.v1beta3.StreamLocation getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<StreamLocation> PARSER =
      new com.google.protobuf.AbstractParser<StreamLocation>() {
        @java.lang.Override
        public StreamLocation parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.dataflow.v1beta3.StreamLocation getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
