/*
 * 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/analytics/data/v1alpha/data.proto

package com.google.analytics.data.v1alpha;

/**
 *
 *
 * <pre>
 * Expresses combinations of segment filters.
 * </pre>
 *
 * Protobuf type {@code google.analytics.data.v1alpha.SegmentFilterExpression}
 */
public final class SegmentFilterExpression extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.analytics.data.v1alpha.SegmentFilterExpression)
    SegmentFilterExpressionOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SegmentFilterExpression.newBuilder() to construct.
  private SegmentFilterExpression(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SegmentFilterExpression() {}

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

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

  private SegmentFilterExpression(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    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:
            {
              com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder subBuilder =
                  null;
              if (exprCase_ == 1) {
                subBuilder =
                    ((com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_)
                        .toBuilder();
              }
              expr_ =
                  input.readMessage(
                      com.google.analytics.data.v1alpha.SegmentFilterExpressionList.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(
                    (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_);
                expr_ = subBuilder.buildPartial();
              }
              exprCase_ = 1;
              break;
            }
          case 18:
            {
              com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder subBuilder =
                  null;
              if (exprCase_ == 2) {
                subBuilder =
                    ((com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_)
                        .toBuilder();
              }
              expr_ =
                  input.readMessage(
                      com.google.analytics.data.v1alpha.SegmentFilterExpressionList.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(
                    (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_);
                expr_ = subBuilder.buildPartial();
              }
              exprCase_ = 2;
              break;
            }
          case 26:
            {
              com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder subBuilder = null;
              if (exprCase_ == 3) {
                subBuilder =
                    ((com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_).toBuilder();
              }
              expr_ =
                  input.readMessage(
                      com.google.analytics.data.v1alpha.SegmentFilterExpression.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(
                    (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_);
                expr_ = subBuilder.buildPartial();
              }
              exprCase_ = 3;
              break;
            }
          case 34:
            {
              com.google.analytics.data.v1alpha.SegmentFilter.Builder subBuilder = null;
              if (exprCase_ == 4) {
                subBuilder = ((com.google.analytics.data.v1alpha.SegmentFilter) expr_).toBuilder();
              }
              expr_ =
                  input.readMessage(
                      com.google.analytics.data.v1alpha.SegmentFilter.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom((com.google.analytics.data.v1alpha.SegmentFilter) expr_);
                expr_ = subBuilder.buildPartial();
              }
              exprCase_ = 4;
              break;
            }
          case 42:
            {
              com.google.analytics.data.v1alpha.SegmentEventFilter.Builder subBuilder = null;
              if (exprCase_ == 5) {
                subBuilder =
                    ((com.google.analytics.data.v1alpha.SegmentEventFilter) expr_).toBuilder();
              }
              expr_ =
                  input.readMessage(
                      com.google.analytics.data.v1alpha.SegmentEventFilter.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom((com.google.analytics.data.v1alpha.SegmentEventFilter) expr_);
                expr_ = subBuilder.buildPartial();
              }
              exprCase_ = 5;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (com.google.protobuf.UninitializedMessageException e) {
      throw e.asInvalidProtocolBufferException().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.analytics.data.v1alpha.ReportingApiProto
        .internal_static_google_analytics_data_v1alpha_SegmentFilterExpression_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.analytics.data.v1alpha.ReportingApiProto
        .internal_static_google_analytics_data_v1alpha_SegmentFilterExpression_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.analytics.data.v1alpha.SegmentFilterExpression.class,
            com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder.class);
  }

  private int exprCase_ = 0;
  private java.lang.Object expr_;

  public enum ExprCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    AND_GROUP(1),
    OR_GROUP(2),
    NOT_EXPRESSION(3),
    SEGMENT_FILTER(4),
    SEGMENT_EVENT_FILTER(5),
    EXPR_NOT_SET(0);
    private final int value;

    private ExprCase(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 ExprCase valueOf(int value) {
      return forNumber(value);
    }

    public static ExprCase forNumber(int value) {
      switch (value) {
        case 1:
          return AND_GROUP;
        case 2:
          return OR_GROUP;
        case 3:
          return NOT_EXPRESSION;
        case 4:
          return SEGMENT_FILTER;
        case 5:
          return SEGMENT_EVENT_FILTER;
        case 0:
          return EXPR_NOT_SET;
        default:
          return null;
      }
    }

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

  public ExprCase getExprCase() {
    return ExprCase.forNumber(exprCase_);
  }

  public static final int AND_GROUP_FIELD_NUMBER = 1;
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression in `andGroup` have an AND relationship.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
   *
   * @return Whether the andGroup field is set.
   */
  @java.lang.Override
  public boolean hasAndGroup() {
    return exprCase_ == 1;
  }
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression in `andGroup` have an AND relationship.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
   *
   * @return The andGroup.
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpressionList getAndGroup() {
    if (exprCase_ == 1) {
      return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression in `andGroup` have an AND relationship.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder
      getAndGroupOrBuilder() {
    if (exprCase_ == 1) {
      return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
  }

  public static final int OR_GROUP_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression in `orGroup` have an OR relationship.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
   *
   * @return Whether the orGroup field is set.
   */
  @java.lang.Override
  public boolean hasOrGroup() {
    return exprCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression in `orGroup` have an OR relationship.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
   *
   * @return The orGroup.
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpressionList getOrGroup() {
    if (exprCase_ == 2) {
      return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression in `orGroup` have an OR relationship.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder
      getOrGroupOrBuilder() {
    if (exprCase_ == 2) {
      return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
  }

  public static final int NOT_EXPRESSION_FIELD_NUMBER = 3;
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression is NOT of `notExpression`.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
   *
   * @return Whether the notExpression field is set.
   */
  @java.lang.Override
  public boolean hasNotExpression() {
    return exprCase_ == 3;
  }
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression is NOT of `notExpression`.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
   *
   * @return The notExpression.
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpression getNotExpression() {
    if (exprCase_ == 3) {
      return (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The SegmentFilterExpression is NOT of `notExpression`.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpressionOrBuilder
      getNotExpressionOrBuilder() {
    if (exprCase_ == 3) {
      return (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
  }

  public static final int SEGMENT_FILTER_FIELD_NUMBER = 4;
  /**
   *
   *
   * <pre>
   * A primitive segment filter.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
   *
   * @return Whether the segmentFilter field is set.
   */
  @java.lang.Override
  public boolean hasSegmentFilter() {
    return exprCase_ == 4;
  }
  /**
   *
   *
   * <pre>
   * A primitive segment filter.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
   *
   * @return The segmentFilter.
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilter getSegmentFilter() {
    if (exprCase_ == 4) {
      return (com.google.analytics.data.v1alpha.SegmentFilter) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * A primitive segment filter.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterOrBuilder getSegmentFilterOrBuilder() {
    if (exprCase_ == 4) {
      return (com.google.analytics.data.v1alpha.SegmentFilter) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance();
  }

  public static final int SEGMENT_EVENT_FILTER_FIELD_NUMBER = 5;
  /**
   *
   *
   * <pre>
   * Creates a filter that matches events of a single event name. If a
   * parameter filter expression is specified, only the subset of events that
   * match both the single event name and the parameter filter expressions
   * match this event filter.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
   *
   * @return Whether the segmentEventFilter field is set.
   */
  @java.lang.Override
  public boolean hasSegmentEventFilter() {
    return exprCase_ == 5;
  }
  /**
   *
   *
   * <pre>
   * Creates a filter that matches events of a single event name. If a
   * parameter filter expression is specified, only the subset of events that
   * match both the single event name and the parameter filter expressions
   * match this event filter.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
   *
   * @return The segmentEventFilter.
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentEventFilter getSegmentEventFilter() {
    if (exprCase_ == 5) {
      return (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentEventFilter.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Creates a filter that matches events of a single event name. If a
   * parameter filter expression is specified, only the subset of events that
   * match both the single event name and the parameter filter expressions
   * match this event filter.
   * </pre>
   *
   * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
   */
  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentEventFilterOrBuilder
      getSegmentEventFilterOrBuilder() {
    if (exprCase_ == 5) {
      return (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_;
    }
    return com.google.analytics.data.v1alpha.SegmentEventFilter.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 (exprCase_ == 1) {
      output.writeMessage(1, (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_);
    }
    if (exprCase_ == 2) {
      output.writeMessage(2, (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_);
    }
    if (exprCase_ == 3) {
      output.writeMessage(3, (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_);
    }
    if (exprCase_ == 4) {
      output.writeMessage(4, (com.google.analytics.data.v1alpha.SegmentFilter) expr_);
    }
    if (exprCase_ == 5) {
      output.writeMessage(5, (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (exprCase_ == 1) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              1, (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_);
    }
    if (exprCase_ == 2) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              2, (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_);
    }
    if (exprCase_ == 3) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_);
    }
    if (exprCase_ == 4) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              4, (com.google.analytics.data.v1alpha.SegmentFilter) expr_);
    }
    if (exprCase_ == 5) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              5, (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_);
    }
    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.analytics.data.v1alpha.SegmentFilterExpression)) {
      return super.equals(obj);
    }
    com.google.analytics.data.v1alpha.SegmentFilterExpression other =
        (com.google.analytics.data.v1alpha.SegmentFilterExpression) obj;

    if (!getExprCase().equals(other.getExprCase())) return false;
    switch (exprCase_) {
      case 1:
        if (!getAndGroup().equals(other.getAndGroup())) return false;
        break;
      case 2:
        if (!getOrGroup().equals(other.getOrGroup())) return false;
        break;
      case 3:
        if (!getNotExpression().equals(other.getNotExpression())) return false;
        break;
      case 4:
        if (!getSegmentFilter().equals(other.getSegmentFilter())) return false;
        break;
      case 5:
        if (!getSegmentEventFilter().equals(other.getSegmentEventFilter())) return false;
        break;
      case 0:
      default:
    }
    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();
    switch (exprCase_) {
      case 1:
        hash = (37 * hash) + AND_GROUP_FIELD_NUMBER;
        hash = (53 * hash) + getAndGroup().hashCode();
        break;
      case 2:
        hash = (37 * hash) + OR_GROUP_FIELD_NUMBER;
        hash = (53 * hash) + getOrGroup().hashCode();
        break;
      case 3:
        hash = (37 * hash) + NOT_EXPRESSION_FIELD_NUMBER;
        hash = (53 * hash) + getNotExpression().hashCode();
        break;
      case 4:
        hash = (37 * hash) + SEGMENT_FILTER_FIELD_NUMBER;
        hash = (53 * hash) + getSegmentFilter().hashCode();
        break;
      case 5:
        hash = (37 * hash) + SEGMENT_EVENT_FILTER_FIELD_NUMBER;
        hash = (53 * hash) + getSegmentEventFilter().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression 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.analytics.data.v1alpha.SegmentFilterExpression 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>
   * Expresses combinations of segment filters.
   * </pre>
   *
   * Protobuf type {@code google.analytics.data.v1alpha.SegmentFilterExpression}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.analytics.data.v1alpha.SegmentFilterExpression)
      com.google.analytics.data.v1alpha.SegmentFilterExpressionOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.analytics.data.v1alpha.ReportingApiProto
          .internal_static_google_analytics_data_v1alpha_SegmentFilterExpression_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.analytics.data.v1alpha.ReportingApiProto
          .internal_static_google_analytics_data_v1alpha_SegmentFilterExpression_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.analytics.data.v1alpha.SegmentFilterExpression.class,
              com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder.class);
    }

    // Construct using com.google.analytics.data.v1alpha.SegmentFilterExpression.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();
      exprCase_ = 0;
      expr_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.analytics.data.v1alpha.ReportingApiProto
          .internal_static_google_analytics_data_v1alpha_SegmentFilterExpression_descriptor;
    }

    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpression getDefaultInstanceForType() {
      return com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpression build() {
      com.google.analytics.data.v1alpha.SegmentFilterExpression result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpression buildPartial() {
      com.google.analytics.data.v1alpha.SegmentFilterExpression result =
          new com.google.analytics.data.v1alpha.SegmentFilterExpression(this);
      if (exprCase_ == 1) {
        if (andGroupBuilder_ == null) {
          result.expr_ = expr_;
        } else {
          result.expr_ = andGroupBuilder_.build();
        }
      }
      if (exprCase_ == 2) {
        if (orGroupBuilder_ == null) {
          result.expr_ = expr_;
        } else {
          result.expr_ = orGroupBuilder_.build();
        }
      }
      if (exprCase_ == 3) {
        if (notExpressionBuilder_ == null) {
          result.expr_ = expr_;
        } else {
          result.expr_ = notExpressionBuilder_.build();
        }
      }
      if (exprCase_ == 4) {
        if (segmentFilterBuilder_ == null) {
          result.expr_ = expr_;
        } else {
          result.expr_ = segmentFilterBuilder_.build();
        }
      }
      if (exprCase_ == 5) {
        if (segmentEventFilterBuilder_ == null) {
          result.expr_ = expr_;
        } else {
          result.expr_ = segmentEventFilterBuilder_.build();
        }
      }
      result.exprCase_ = exprCase_;
      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.analytics.data.v1alpha.SegmentFilterExpression) {
        return mergeFrom((com.google.analytics.data.v1alpha.SegmentFilterExpression) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.analytics.data.v1alpha.SegmentFilterExpression other) {
      if (other == com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance())
        return this;
      switch (other.getExprCase()) {
        case AND_GROUP:
          {
            mergeAndGroup(other.getAndGroup());
            break;
          }
        case OR_GROUP:
          {
            mergeOrGroup(other.getOrGroup());
            break;
          }
        case NOT_EXPRESSION:
          {
            mergeNotExpression(other.getNotExpression());
            break;
          }
        case SEGMENT_FILTER:
          {
            mergeSegmentFilter(other.getSegmentFilter());
            break;
          }
        case SEGMENT_EVENT_FILTER:
          {
            mergeSegmentEventFilter(other.getSegmentEventFilter());
            break;
          }
        case EXPR_NOT_SET:
          {
            break;
          }
      }
      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.analytics.data.v1alpha.SegmentFilterExpression parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.analytics.data.v1alpha.SegmentFilterExpression) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int exprCase_ = 0;
    private java.lang.Object expr_;

    public ExprCase getExprCase() {
      return ExprCase.forNumber(exprCase_);
    }

    public Builder clearExpr() {
      exprCase_ = 0;
      expr_ = null;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder>
        andGroupBuilder_;
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     *
     * @return Whether the andGroup field is set.
     */
    @java.lang.Override
    public boolean hasAndGroup() {
      return exprCase_ == 1;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     *
     * @return The andGroup.
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionList getAndGroup() {
      if (andGroupBuilder_ == null) {
        if (exprCase_ == 1) {
          return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
      } else {
        if (exprCase_ == 1) {
          return andGroupBuilder_.getMessage();
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    public Builder setAndGroup(
        com.google.analytics.data.v1alpha.SegmentFilterExpressionList value) {
      if (andGroupBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        expr_ = value;
        onChanged();
      } else {
        andGroupBuilder_.setMessage(value);
      }
      exprCase_ = 1;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    public Builder setAndGroup(
        com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder builderForValue) {
      if (andGroupBuilder_ == null) {
        expr_ = builderForValue.build();
        onChanged();
      } else {
        andGroupBuilder_.setMessage(builderForValue.build());
      }
      exprCase_ = 1;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    public Builder mergeAndGroup(
        com.google.analytics.data.v1alpha.SegmentFilterExpressionList value) {
      if (andGroupBuilder_ == null) {
        if (exprCase_ == 1
            && expr_
                != com.google.analytics.data.v1alpha.SegmentFilterExpressionList
                    .getDefaultInstance()) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentFilterExpressionList.newBuilder(
                      (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          expr_ = value;
        }
        onChanged();
      } else {
        if (exprCase_ == 1) {
          andGroupBuilder_.mergeFrom(value);
        } else {
          andGroupBuilder_.setMessage(value);
        }
      }
      exprCase_ = 1;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    public Builder clearAndGroup() {
      if (andGroupBuilder_ == null) {
        if (exprCase_ == 1) {
          exprCase_ = 0;
          expr_ = null;
          onChanged();
        }
      } else {
        if (exprCase_ == 1) {
          exprCase_ = 0;
          expr_ = null;
        }
        andGroupBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder
        getAndGroupBuilder() {
      return getAndGroupFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder
        getAndGroupOrBuilder() {
      if ((exprCase_ == 1) && (andGroupBuilder_ != null)) {
        return andGroupBuilder_.getMessageOrBuilder();
      } else {
        if (exprCase_ == 1) {
          return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `andGroup` have an AND relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList and_group = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder>
        getAndGroupFieldBuilder() {
      if (andGroupBuilder_ == null) {
        if (!(exprCase_ == 1)) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
        }
        andGroupBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.analytics.data.v1alpha.SegmentFilterExpressionList,
                com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder,
                com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder>(
                (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_,
                getParentForChildren(),
                isClean());
        expr_ = null;
      }
      exprCase_ = 1;
      onChanged();
      ;
      return andGroupBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder>
        orGroupBuilder_;
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     *
     * @return Whether the orGroup field is set.
     */
    @java.lang.Override
    public boolean hasOrGroup() {
      return exprCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     *
     * @return The orGroup.
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionList getOrGroup() {
      if (orGroupBuilder_ == null) {
        if (exprCase_ == 2) {
          return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
      } else {
        if (exprCase_ == 2) {
          return orGroupBuilder_.getMessage();
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    public Builder setOrGroup(com.google.analytics.data.v1alpha.SegmentFilterExpressionList value) {
      if (orGroupBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        expr_ = value;
        onChanged();
      } else {
        orGroupBuilder_.setMessage(value);
      }
      exprCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    public Builder setOrGroup(
        com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder builderForValue) {
      if (orGroupBuilder_ == null) {
        expr_ = builderForValue.build();
        onChanged();
      } else {
        orGroupBuilder_.setMessage(builderForValue.build());
      }
      exprCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    public Builder mergeOrGroup(
        com.google.analytics.data.v1alpha.SegmentFilterExpressionList value) {
      if (orGroupBuilder_ == null) {
        if (exprCase_ == 2
            && expr_
                != com.google.analytics.data.v1alpha.SegmentFilterExpressionList
                    .getDefaultInstance()) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentFilterExpressionList.newBuilder(
                      (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          expr_ = value;
        }
        onChanged();
      } else {
        if (exprCase_ == 2) {
          orGroupBuilder_.mergeFrom(value);
        } else {
          orGroupBuilder_.setMessage(value);
        }
      }
      exprCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    public Builder clearOrGroup() {
      if (orGroupBuilder_ == null) {
        if (exprCase_ == 2) {
          exprCase_ = 0;
          expr_ = null;
          onChanged();
        }
      } else {
        if (exprCase_ == 2) {
          exprCase_ = 0;
          expr_ = null;
        }
        orGroupBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder
        getOrGroupBuilder() {
      return getOrGroupFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder
        getOrGroupOrBuilder() {
      if ((exprCase_ == 2) && (orGroupBuilder_ != null)) {
        return orGroupBuilder_.getMessageOrBuilder();
      } else {
        if (exprCase_ == 2) {
          return (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression in `orGroup` have an OR relationship.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpressionList or_group = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder>
        getOrGroupFieldBuilder() {
      if (orGroupBuilder_ == null) {
        if (!(exprCase_ == 2)) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentFilterExpressionList.getDefaultInstance();
        }
        orGroupBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.analytics.data.v1alpha.SegmentFilterExpressionList,
                com.google.analytics.data.v1alpha.SegmentFilterExpressionList.Builder,
                com.google.analytics.data.v1alpha.SegmentFilterExpressionListOrBuilder>(
                (com.google.analytics.data.v1alpha.SegmentFilterExpressionList) expr_,
                getParentForChildren(),
                isClean());
        expr_ = null;
      }
      exprCase_ = 2;
      onChanged();
      ;
      return orGroupBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilterExpression,
            com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionOrBuilder>
        notExpressionBuilder_;
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     *
     * @return Whether the notExpression field is set.
     */
    @java.lang.Override
    public boolean hasNotExpression() {
      return exprCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     *
     * @return The notExpression.
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpression getNotExpression() {
      if (notExpressionBuilder_ == null) {
        if (exprCase_ == 3) {
          return (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
      } else {
        if (exprCase_ == 3) {
          return notExpressionBuilder_.getMessage();
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    public Builder setNotExpression(
        com.google.analytics.data.v1alpha.SegmentFilterExpression value) {
      if (notExpressionBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        expr_ = value;
        onChanged();
      } else {
        notExpressionBuilder_.setMessage(value);
      }
      exprCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    public Builder setNotExpression(
        com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder builderForValue) {
      if (notExpressionBuilder_ == null) {
        expr_ = builderForValue.build();
        onChanged();
      } else {
        notExpressionBuilder_.setMessage(builderForValue.build());
      }
      exprCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    public Builder mergeNotExpression(
        com.google.analytics.data.v1alpha.SegmentFilterExpression value) {
      if (notExpressionBuilder_ == null) {
        if (exprCase_ == 3
            && expr_
                != com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance()) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentFilterExpression.newBuilder(
                      (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          expr_ = value;
        }
        onChanged();
      } else {
        if (exprCase_ == 3) {
          notExpressionBuilder_.mergeFrom(value);
        } else {
          notExpressionBuilder_.setMessage(value);
        }
      }
      exprCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    public Builder clearNotExpression() {
      if (notExpressionBuilder_ == null) {
        if (exprCase_ == 3) {
          exprCase_ = 0;
          expr_ = null;
          onChanged();
        }
      } else {
        if (exprCase_ == 3) {
          exprCase_ = 0;
          expr_ = null;
        }
        notExpressionBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    public com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder
        getNotExpressionBuilder() {
      return getNotExpressionFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterExpressionOrBuilder
        getNotExpressionOrBuilder() {
      if ((exprCase_ == 3) && (notExpressionBuilder_ != null)) {
        return notExpressionBuilder_.getMessageOrBuilder();
      } else {
        if (exprCase_ == 3) {
          return (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The SegmentFilterExpression is NOT of `notExpression`.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilterExpression not_expression = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilterExpression,
            com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterExpressionOrBuilder>
        getNotExpressionFieldBuilder() {
      if (notExpressionBuilder_ == null) {
        if (!(exprCase_ == 3)) {
          expr_ = com.google.analytics.data.v1alpha.SegmentFilterExpression.getDefaultInstance();
        }
        notExpressionBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.analytics.data.v1alpha.SegmentFilterExpression,
                com.google.analytics.data.v1alpha.SegmentFilterExpression.Builder,
                com.google.analytics.data.v1alpha.SegmentFilterExpressionOrBuilder>(
                (com.google.analytics.data.v1alpha.SegmentFilterExpression) expr_,
                getParentForChildren(),
                isClean());
        expr_ = null;
      }
      exprCase_ = 3;
      onChanged();
      ;
      return notExpressionBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilter,
            com.google.analytics.data.v1alpha.SegmentFilter.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterOrBuilder>
        segmentFilterBuilder_;
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     *
     * @return Whether the segmentFilter field is set.
     */
    @java.lang.Override
    public boolean hasSegmentFilter() {
      return exprCase_ == 4;
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     *
     * @return The segmentFilter.
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilter getSegmentFilter() {
      if (segmentFilterBuilder_ == null) {
        if (exprCase_ == 4) {
          return (com.google.analytics.data.v1alpha.SegmentFilter) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance();
      } else {
        if (exprCase_ == 4) {
          return segmentFilterBuilder_.getMessage();
        }
        return com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    public Builder setSegmentFilter(com.google.analytics.data.v1alpha.SegmentFilter value) {
      if (segmentFilterBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        expr_ = value;
        onChanged();
      } else {
        segmentFilterBuilder_.setMessage(value);
      }
      exprCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    public Builder setSegmentFilter(
        com.google.analytics.data.v1alpha.SegmentFilter.Builder builderForValue) {
      if (segmentFilterBuilder_ == null) {
        expr_ = builderForValue.build();
        onChanged();
      } else {
        segmentFilterBuilder_.setMessage(builderForValue.build());
      }
      exprCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    public Builder mergeSegmentFilter(com.google.analytics.data.v1alpha.SegmentFilter value) {
      if (segmentFilterBuilder_ == null) {
        if (exprCase_ == 4
            && expr_ != com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance()) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentFilter.newBuilder(
                      (com.google.analytics.data.v1alpha.SegmentFilter) expr_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          expr_ = value;
        }
        onChanged();
      } else {
        if (exprCase_ == 4) {
          segmentFilterBuilder_.mergeFrom(value);
        } else {
          segmentFilterBuilder_.setMessage(value);
        }
      }
      exprCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    public Builder clearSegmentFilter() {
      if (segmentFilterBuilder_ == null) {
        if (exprCase_ == 4) {
          exprCase_ = 0;
          expr_ = null;
          onChanged();
        }
      } else {
        if (exprCase_ == 4) {
          exprCase_ = 0;
          expr_ = null;
        }
        segmentFilterBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    public com.google.analytics.data.v1alpha.SegmentFilter.Builder getSegmentFilterBuilder() {
      return getSegmentFilterFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentFilterOrBuilder getSegmentFilterOrBuilder() {
      if ((exprCase_ == 4) && (segmentFilterBuilder_ != null)) {
        return segmentFilterBuilder_.getMessageOrBuilder();
      } else {
        if (exprCase_ == 4) {
          return (com.google.analytics.data.v1alpha.SegmentFilter) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * A primitive segment filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentFilter segment_filter = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentFilter,
            com.google.analytics.data.v1alpha.SegmentFilter.Builder,
            com.google.analytics.data.v1alpha.SegmentFilterOrBuilder>
        getSegmentFilterFieldBuilder() {
      if (segmentFilterBuilder_ == null) {
        if (!(exprCase_ == 4)) {
          expr_ = com.google.analytics.data.v1alpha.SegmentFilter.getDefaultInstance();
        }
        segmentFilterBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.analytics.data.v1alpha.SegmentFilter,
                com.google.analytics.data.v1alpha.SegmentFilter.Builder,
                com.google.analytics.data.v1alpha.SegmentFilterOrBuilder>(
                (com.google.analytics.data.v1alpha.SegmentFilter) expr_,
                getParentForChildren(),
                isClean());
        expr_ = null;
      }
      exprCase_ = 4;
      onChanged();
      ;
      return segmentFilterBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentEventFilter,
            com.google.analytics.data.v1alpha.SegmentEventFilter.Builder,
            com.google.analytics.data.v1alpha.SegmentEventFilterOrBuilder>
        segmentEventFilterBuilder_;
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     *
     * @return Whether the segmentEventFilter field is set.
     */
    @java.lang.Override
    public boolean hasSegmentEventFilter() {
      return exprCase_ == 5;
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     *
     * @return The segmentEventFilter.
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentEventFilter getSegmentEventFilter() {
      if (segmentEventFilterBuilder_ == null) {
        if (exprCase_ == 5) {
          return (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentEventFilter.getDefaultInstance();
      } else {
        if (exprCase_ == 5) {
          return segmentEventFilterBuilder_.getMessage();
        }
        return com.google.analytics.data.v1alpha.SegmentEventFilter.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    public Builder setSegmentEventFilter(
        com.google.analytics.data.v1alpha.SegmentEventFilter value) {
      if (segmentEventFilterBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        expr_ = value;
        onChanged();
      } else {
        segmentEventFilterBuilder_.setMessage(value);
      }
      exprCase_ = 5;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    public Builder setSegmentEventFilter(
        com.google.analytics.data.v1alpha.SegmentEventFilter.Builder builderForValue) {
      if (segmentEventFilterBuilder_ == null) {
        expr_ = builderForValue.build();
        onChanged();
      } else {
        segmentEventFilterBuilder_.setMessage(builderForValue.build());
      }
      exprCase_ = 5;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    public Builder mergeSegmentEventFilter(
        com.google.analytics.data.v1alpha.SegmentEventFilter value) {
      if (segmentEventFilterBuilder_ == null) {
        if (exprCase_ == 5
            && expr_ != com.google.analytics.data.v1alpha.SegmentEventFilter.getDefaultInstance()) {
          expr_ =
              com.google.analytics.data.v1alpha.SegmentEventFilter.newBuilder(
                      (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          expr_ = value;
        }
        onChanged();
      } else {
        if (exprCase_ == 5) {
          segmentEventFilterBuilder_.mergeFrom(value);
        } else {
          segmentEventFilterBuilder_.setMessage(value);
        }
      }
      exprCase_ = 5;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    public Builder clearSegmentEventFilter() {
      if (segmentEventFilterBuilder_ == null) {
        if (exprCase_ == 5) {
          exprCase_ = 0;
          expr_ = null;
          onChanged();
        }
      } else {
        if (exprCase_ == 5) {
          exprCase_ = 0;
          expr_ = null;
        }
        segmentEventFilterBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    public com.google.analytics.data.v1alpha.SegmentEventFilter.Builder
        getSegmentEventFilterBuilder() {
      return getSegmentEventFilterFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentEventFilterOrBuilder
        getSegmentEventFilterOrBuilder() {
      if ((exprCase_ == 5) && (segmentEventFilterBuilder_ != null)) {
        return segmentEventFilterBuilder_.getMessageOrBuilder();
      } else {
        if (exprCase_ == 5) {
          return (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_;
        }
        return com.google.analytics.data.v1alpha.SegmentEventFilter.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Creates a filter that matches events of a single event name. If a
     * parameter filter expression is specified, only the subset of events that
     * match both the single event name and the parameter filter expressions
     * match this event filter.
     * </pre>
     *
     * <code>.google.analytics.data.v1alpha.SegmentEventFilter segment_event_filter = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.analytics.data.v1alpha.SegmentEventFilter,
            com.google.analytics.data.v1alpha.SegmentEventFilter.Builder,
            com.google.analytics.data.v1alpha.SegmentEventFilterOrBuilder>
        getSegmentEventFilterFieldBuilder() {
      if (segmentEventFilterBuilder_ == null) {
        if (!(exprCase_ == 5)) {
          expr_ = com.google.analytics.data.v1alpha.SegmentEventFilter.getDefaultInstance();
        }
        segmentEventFilterBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.analytics.data.v1alpha.SegmentEventFilter,
                com.google.analytics.data.v1alpha.SegmentEventFilter.Builder,
                com.google.analytics.data.v1alpha.SegmentEventFilterOrBuilder>(
                (com.google.analytics.data.v1alpha.SegmentEventFilter) expr_,
                getParentForChildren(),
                isClean());
        expr_ = null;
      }
      exprCase_ = 5;
      onChanged();
      ;
      return segmentEventFilterBuilder_;
    }

    @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.analytics.data.v1alpha.SegmentFilterExpression)
  }

  // @@protoc_insertion_point(class_scope:google.analytics.data.v1alpha.SegmentFilterExpression)
  private static final com.google.analytics.data.v1alpha.SegmentFilterExpression DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.analytics.data.v1alpha.SegmentFilterExpression();
  }

  public static com.google.analytics.data.v1alpha.SegmentFilterExpression getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentFilterExpression getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
