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

package com.google.privacy.dlp.v2beta1;

/**
 * <pre>
 * Set of primitive values supported by the system.
 * </pre>
 *
 * Protobuf type {@code google.privacy.dlp.v2beta1.Value}
 */
public  final class Value extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2beta1.Value)
    ValueOrBuilder {
private static final long serialVersionUID = 0L;
  // Use Value.newBuilder() to construct.
  private Value(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private Value() {
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private Value(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 8: {
            typeCase_ = 1;
            type_ = input.readInt64();
            break;
          }
          case 17: {
            typeCase_ = 2;
            type_ = input.readDouble();
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();
            typeCase_ = 3;
            type_ = s;
            break;
          }
          case 32: {
            typeCase_ = 4;
            type_ = input.readBool();
            break;
          }
          case 42: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (typeCase_ == 5) {
              subBuilder = ((com.google.protobuf.Timestamp) type_).toBuilder();
            }
            type_ =
                input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.protobuf.Timestamp) type_);
              type_ = subBuilder.buildPartial();
            }
            typeCase_ = 5;
            break;
          }
          case 50: {
            com.google.type.TimeOfDay.Builder subBuilder = null;
            if (typeCase_ == 6) {
              subBuilder = ((com.google.type.TimeOfDay) type_).toBuilder();
            }
            type_ =
                input.readMessage(com.google.type.TimeOfDay.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.type.TimeOfDay) type_);
              type_ = subBuilder.buildPartial();
            }
            typeCase_ = 6;
            break;
          }
          case 58: {
            com.google.type.Date.Builder subBuilder = null;
            if (typeCase_ == 7) {
              subBuilder = ((com.google.type.Date) type_).toBuilder();
            }
            type_ =
                input.readMessage(com.google.type.Date.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.type.Date) type_);
              type_ = subBuilder.buildPartial();
            }
            typeCase_ = 7;
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_Value_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_Value_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.privacy.dlp.v2beta1.Value.class, com.google.privacy.dlp.v2beta1.Value.Builder.class);
  }

  private int typeCase_ = 0;
  private java.lang.Object type_;
  public enum TypeCase
      implements com.google.protobuf.Internal.EnumLite {
    INTEGER_VALUE(1),
    FLOAT_VALUE(2),
    STRING_VALUE(3),
    BOOLEAN_VALUE(4),
    TIMESTAMP_VALUE(5),
    TIME_VALUE(6),
    DATE_VALUE(7),
    TYPE_NOT_SET(0);
    private final int value;
    private TypeCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TypeCase valueOf(int value) {
      return forNumber(value);
    }

    public static TypeCase forNumber(int value) {
      switch (value) {
        case 1: return INTEGER_VALUE;
        case 2: return FLOAT_VALUE;
        case 3: return STRING_VALUE;
        case 4: return BOOLEAN_VALUE;
        case 5: return TIMESTAMP_VALUE;
        case 6: return TIME_VALUE;
        case 7: return DATE_VALUE;
        case 0: return TYPE_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public TypeCase
  getTypeCase() {
    return TypeCase.forNumber(
        typeCase_);
  }

  public static final int INTEGER_VALUE_FIELD_NUMBER = 1;
  /**
   * <code>int64 integer_value = 1;</code>
   */
  public long getIntegerValue() {
    if (typeCase_ == 1) {
      return (java.lang.Long) type_;
    }
    return 0L;
  }

  public static final int FLOAT_VALUE_FIELD_NUMBER = 2;
  /**
   * <code>double float_value = 2;</code>
   */
  public double getFloatValue() {
    if (typeCase_ == 2) {
      return (java.lang.Double) type_;
    }
    return 0D;
  }

  public static final int STRING_VALUE_FIELD_NUMBER = 3;
  /**
   * <code>string string_value = 3;</code>
   */
  public java.lang.String getStringValue() {
    java.lang.Object ref = "";
    if (typeCase_ == 3) {
      ref = type_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (typeCase_ == 3) {
        type_ = s;
      }
      return s;
    }
  }
  /**
   * <code>string string_value = 3;</code>
   */
  public com.google.protobuf.ByteString
      getStringValueBytes() {
    java.lang.Object ref = "";
    if (typeCase_ == 3) {
      ref = type_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      if (typeCase_ == 3) {
        type_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int BOOLEAN_VALUE_FIELD_NUMBER = 4;
  /**
   * <code>bool boolean_value = 4;</code>
   */
  public boolean getBooleanValue() {
    if (typeCase_ == 4) {
      return (java.lang.Boolean) type_;
    }
    return false;
  }

  public static final int TIMESTAMP_VALUE_FIELD_NUMBER = 5;
  /**
   * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
   */
  public boolean hasTimestampValue() {
    return typeCase_ == 5;
  }
  /**
   * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
   */
  public com.google.protobuf.Timestamp getTimestampValue() {
    if (typeCase_ == 5) {
       return (com.google.protobuf.Timestamp) type_;
    }
    return com.google.protobuf.Timestamp.getDefaultInstance();
  }
  /**
   * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() {
    if (typeCase_ == 5) {
       return (com.google.protobuf.Timestamp) type_;
    }
    return com.google.protobuf.Timestamp.getDefaultInstance();
  }

  public static final int TIME_VALUE_FIELD_NUMBER = 6;
  /**
   * <code>.google.type.TimeOfDay time_value = 6;</code>
   */
  public boolean hasTimeValue() {
    return typeCase_ == 6;
  }
  /**
   * <code>.google.type.TimeOfDay time_value = 6;</code>
   */
  public com.google.type.TimeOfDay getTimeValue() {
    if (typeCase_ == 6) {
       return (com.google.type.TimeOfDay) type_;
    }
    return com.google.type.TimeOfDay.getDefaultInstance();
  }
  /**
   * <code>.google.type.TimeOfDay time_value = 6;</code>
   */
  public com.google.type.TimeOfDayOrBuilder getTimeValueOrBuilder() {
    if (typeCase_ == 6) {
       return (com.google.type.TimeOfDay) type_;
    }
    return com.google.type.TimeOfDay.getDefaultInstance();
  }

  public static final int DATE_VALUE_FIELD_NUMBER = 7;
  /**
   * <code>.google.type.Date date_value = 7;</code>
   */
  public boolean hasDateValue() {
    return typeCase_ == 7;
  }
  /**
   * <code>.google.type.Date date_value = 7;</code>
   */
  public com.google.type.Date getDateValue() {
    if (typeCase_ == 7) {
       return (com.google.type.Date) type_;
    }
    return com.google.type.Date.getDefaultInstance();
  }
  /**
   * <code>.google.type.Date date_value = 7;</code>
   */
  public com.google.type.DateOrBuilder getDateValueOrBuilder() {
    if (typeCase_ == 7) {
       return (com.google.type.Date) type_;
    }
    return com.google.type.Date.getDefaultInstance();
  }

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

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (typeCase_ == 1) {
      output.writeInt64(
          1, (long)((java.lang.Long) type_));
    }
    if (typeCase_ == 2) {
      output.writeDouble(
          2, (double)((java.lang.Double) type_));
    }
    if (typeCase_ == 3) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_);
    }
    if (typeCase_ == 4) {
      output.writeBool(
          4, (boolean)((java.lang.Boolean) type_));
    }
    if (typeCase_ == 5) {
      output.writeMessage(5, (com.google.protobuf.Timestamp) type_);
    }
    if (typeCase_ == 6) {
      output.writeMessage(6, (com.google.type.TimeOfDay) type_);
    }
    if (typeCase_ == 7) {
      output.writeMessage(7, (com.google.type.Date) type_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (typeCase_ == 1) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(
            1, (long)((java.lang.Long) type_));
    }
    if (typeCase_ == 2) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(
            2, (double)((java.lang.Double) type_));
    }
    if (typeCase_ == 3) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_);
    }
    if (typeCase_ == 4) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(
            4, (boolean)((java.lang.Boolean) type_));
    }
    if (typeCase_ == 5) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, (com.google.protobuf.Timestamp) type_);
    }
    if (typeCase_ == 6) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, (com.google.type.TimeOfDay) type_);
    }
    if (typeCase_ == 7) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, (com.google.type.Date) type_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.privacy.dlp.v2beta1.Value)) {
      return super.equals(obj);
    }
    com.google.privacy.dlp.v2beta1.Value other = (com.google.privacy.dlp.v2beta1.Value) obj;

    boolean result = true;
    result = result && getTypeCase().equals(
        other.getTypeCase());
    if (!result) return false;
    switch (typeCase_) {
      case 1:
        result = result && (getIntegerValue()
            == other.getIntegerValue());
        break;
      case 2:
        result = result && (
            java.lang.Double.doubleToLongBits(getFloatValue())
            == java.lang.Double.doubleToLongBits(
                other.getFloatValue()));
        break;
      case 3:
        result = result && getStringValue()
            .equals(other.getStringValue());
        break;
      case 4:
        result = result && (getBooleanValue()
            == other.getBooleanValue());
        break;
      case 5:
        result = result && getTimestampValue()
            .equals(other.getTimestampValue());
        break;
      case 6:
        result = result && getTimeValue()
            .equals(other.getTimeValue());
        break;
      case 7:
        result = result && getDateValue()
            .equals(other.getDateValue());
        break;
      case 0:
      default:
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    switch (typeCase_) {
      case 1:
        hash = (37 * hash) + INTEGER_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getIntegerValue());
        break;
      case 2:
        hash = (37 * hash) + FLOAT_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            java.lang.Double.doubleToLongBits(getFloatValue()));
        break;
      case 3:
        hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getStringValue().hashCode();
        break;
      case 4:
        hash = (37 * hash) + BOOLEAN_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
            getBooleanValue());
        break;
      case 5:
        hash = (37 * hash) + TIMESTAMP_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getTimestampValue().hashCode();
        break;
      case 6:
        hash = (37 * hash) + TIME_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getTimeValue().hashCode();
        break;
      case 7:
        hash = (37 * hash) + DATE_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getDateValue().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2beta1.Value parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

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

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Set of primitive values supported by the system.
   * </pre>
   *
   * Protobuf type {@code google.privacy.dlp.v2beta1.Value}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2beta1.Value)
      com.google.privacy.dlp.v2beta1.ValueOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_Value_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_Value_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.privacy.dlp.v2beta1.Value.class, com.google.privacy.dlp.v2beta1.Value.Builder.class);
    }

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      typeCase_ = 0;
      type_ = null;
      return this;
    }

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

    public com.google.privacy.dlp.v2beta1.Value getDefaultInstanceForType() {
      return com.google.privacy.dlp.v2beta1.Value.getDefaultInstance();
    }

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

    public com.google.privacy.dlp.v2beta1.Value buildPartial() {
      com.google.privacy.dlp.v2beta1.Value result = new com.google.privacy.dlp.v2beta1.Value(this);
      if (typeCase_ == 1) {
        result.type_ = type_;
      }
      if (typeCase_ == 2) {
        result.type_ = type_;
      }
      if (typeCase_ == 3) {
        result.type_ = type_;
      }
      if (typeCase_ == 4) {
        result.type_ = type_;
      }
      if (typeCase_ == 5) {
        if (timestampValueBuilder_ == null) {
          result.type_ = type_;
        } else {
          result.type_ = timestampValueBuilder_.build();
        }
      }
      if (typeCase_ == 6) {
        if (timeValueBuilder_ == null) {
          result.type_ = type_;
        } else {
          result.type_ = timeValueBuilder_.build();
        }
      }
      if (typeCase_ == 7) {
        if (dateValueBuilder_ == null) {
          result.type_ = type_;
        } else {
          result.type_ = dateValueBuilder_.build();
        }
      }
      result.typeCase_ = typeCase_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.privacy.dlp.v2beta1.Value other) {
      if (other == com.google.privacy.dlp.v2beta1.Value.getDefaultInstance()) return this;
      switch (other.getTypeCase()) {
        case INTEGER_VALUE: {
          setIntegerValue(other.getIntegerValue());
          break;
        }
        case FLOAT_VALUE: {
          setFloatValue(other.getFloatValue());
          break;
        }
        case STRING_VALUE: {
          typeCase_ = 3;
          type_ = other.type_;
          onChanged();
          break;
        }
        case BOOLEAN_VALUE: {
          setBooleanValue(other.getBooleanValue());
          break;
        }
        case TIMESTAMP_VALUE: {
          mergeTimestampValue(other.getTimestampValue());
          break;
        }
        case TIME_VALUE: {
          mergeTimeValue(other.getTimeValue());
          break;
        }
        case DATE_VALUE: {
          mergeDateValue(other.getDateValue());
          break;
        }
        case TYPE_NOT_SET: {
          break;
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.privacy.dlp.v2beta1.Value parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.privacy.dlp.v2beta1.Value) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int typeCase_ = 0;
    private java.lang.Object type_;
    public TypeCase
        getTypeCase() {
      return TypeCase.forNumber(
          typeCase_);
    }

    public Builder clearType() {
      typeCase_ = 0;
      type_ = null;
      onChanged();
      return this;
    }


    /**
     * <code>int64 integer_value = 1;</code>
     */
    public long getIntegerValue() {
      if (typeCase_ == 1) {
        return (java.lang.Long) type_;
      }
      return 0L;
    }
    /**
     * <code>int64 integer_value = 1;</code>
     */
    public Builder setIntegerValue(long value) {
      typeCase_ = 1;
      type_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int64 integer_value = 1;</code>
     */
    public Builder clearIntegerValue() {
      if (typeCase_ == 1) {
        typeCase_ = 0;
        type_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <code>double float_value = 2;</code>
     */
    public double getFloatValue() {
      if (typeCase_ == 2) {
        return (java.lang.Double) type_;
      }
      return 0D;
    }
    /**
     * <code>double float_value = 2;</code>
     */
    public Builder setFloatValue(double value) {
      typeCase_ = 2;
      type_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double float_value = 2;</code>
     */
    public Builder clearFloatValue() {
      if (typeCase_ == 2) {
        typeCase_ = 0;
        type_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <code>string string_value = 3;</code>
     */
    public java.lang.String getStringValue() {
      java.lang.Object ref = "";
      if (typeCase_ == 3) {
        ref = type_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (typeCase_ == 3) {
          type_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string string_value = 3;</code>
     */
    public com.google.protobuf.ByteString
        getStringValueBytes() {
      java.lang.Object ref = "";
      if (typeCase_ == 3) {
        ref = type_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        if (typeCase_ == 3) {
          type_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string string_value = 3;</code>
     */
    public Builder setStringValue(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  typeCase_ = 3;
      type_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string string_value = 3;</code>
     */
    public Builder clearStringValue() {
      if (typeCase_ == 3) {
        typeCase_ = 0;
        type_ = null;
        onChanged();
      }
      return this;
    }
    /**
     * <code>string string_value = 3;</code>
     */
    public Builder setStringValueBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      typeCase_ = 3;
      type_ = value;
      onChanged();
      return this;
    }

    /**
     * <code>bool boolean_value = 4;</code>
     */
    public boolean getBooleanValue() {
      if (typeCase_ == 4) {
        return (java.lang.Boolean) type_;
      }
      return false;
    }
    /**
     * <code>bool boolean_value = 4;</code>
     */
    public Builder setBooleanValue(boolean value) {
      typeCase_ = 4;
      type_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>bool boolean_value = 4;</code>
     */
    public Builder clearBooleanValue() {
      if (typeCase_ == 4) {
        typeCase_ = 0;
        type_ = null;
        onChanged();
      }
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampValueBuilder_;
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public boolean hasTimestampValue() {
      return typeCase_ == 5;
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public com.google.protobuf.Timestamp getTimestampValue() {
      if (timestampValueBuilder_ == null) {
        if (typeCase_ == 5) {
          return (com.google.protobuf.Timestamp) type_;
        }
        return com.google.protobuf.Timestamp.getDefaultInstance();
      } else {
        if (typeCase_ == 5) {
          return timestampValueBuilder_.getMessage();
        }
        return com.google.protobuf.Timestamp.getDefaultInstance();
      }
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public Builder setTimestampValue(com.google.protobuf.Timestamp value) {
      if (timestampValueBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        type_ = value;
        onChanged();
      } else {
        timestampValueBuilder_.setMessage(value);
      }
      typeCase_ = 5;
      return this;
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public Builder setTimestampValue(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (timestampValueBuilder_ == null) {
        type_ = builderForValue.build();
        onChanged();
      } else {
        timestampValueBuilder_.setMessage(builderForValue.build());
      }
      typeCase_ = 5;
      return this;
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public Builder mergeTimestampValue(com.google.protobuf.Timestamp value) {
      if (timestampValueBuilder_ == null) {
        if (typeCase_ == 5 &&
            type_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          type_ = com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) type_)
              .mergeFrom(value).buildPartial();
        } else {
          type_ = value;
        }
        onChanged();
      } else {
        if (typeCase_ == 5) {
          timestampValueBuilder_.mergeFrom(value);
        }
        timestampValueBuilder_.setMessage(value);
      }
      typeCase_ = 5;
      return this;
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public Builder clearTimestampValue() {
      if (timestampValueBuilder_ == null) {
        if (typeCase_ == 5) {
          typeCase_ = 0;
          type_ = null;
          onChanged();
        }
      } else {
        if (typeCase_ == 5) {
          typeCase_ = 0;
          type_ = null;
        }
        timestampValueBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public com.google.protobuf.Timestamp.Builder getTimestampValueBuilder() {
      return getTimestampValueFieldBuilder().getBuilder();
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() {
      if ((typeCase_ == 5) && (timestampValueBuilder_ != null)) {
        return timestampValueBuilder_.getMessageOrBuilder();
      } else {
        if (typeCase_ == 5) {
          return (com.google.protobuf.Timestamp) type_;
        }
        return com.google.protobuf.Timestamp.getDefaultInstance();
      }
    }
    /**
     * <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getTimestampValueFieldBuilder() {
      if (timestampValueBuilder_ == null) {
        if (!(typeCase_ == 5)) {
          type_ = com.google.protobuf.Timestamp.getDefaultInstance();
        }
        timestampValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                (com.google.protobuf.Timestamp) type_,
                getParentForChildren(),
                isClean());
        type_ = null;
      }
      typeCase_ = 5;
      onChanged();;
      return timestampValueBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.type.TimeOfDay, com.google.type.TimeOfDay.Builder, com.google.type.TimeOfDayOrBuilder> timeValueBuilder_;
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public boolean hasTimeValue() {
      return typeCase_ == 6;
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public com.google.type.TimeOfDay getTimeValue() {
      if (timeValueBuilder_ == null) {
        if (typeCase_ == 6) {
          return (com.google.type.TimeOfDay) type_;
        }
        return com.google.type.TimeOfDay.getDefaultInstance();
      } else {
        if (typeCase_ == 6) {
          return timeValueBuilder_.getMessage();
        }
        return com.google.type.TimeOfDay.getDefaultInstance();
      }
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public Builder setTimeValue(com.google.type.TimeOfDay value) {
      if (timeValueBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        type_ = value;
        onChanged();
      } else {
        timeValueBuilder_.setMessage(value);
      }
      typeCase_ = 6;
      return this;
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public Builder setTimeValue(
        com.google.type.TimeOfDay.Builder builderForValue) {
      if (timeValueBuilder_ == null) {
        type_ = builderForValue.build();
        onChanged();
      } else {
        timeValueBuilder_.setMessage(builderForValue.build());
      }
      typeCase_ = 6;
      return this;
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public Builder mergeTimeValue(com.google.type.TimeOfDay value) {
      if (timeValueBuilder_ == null) {
        if (typeCase_ == 6 &&
            type_ != com.google.type.TimeOfDay.getDefaultInstance()) {
          type_ = com.google.type.TimeOfDay.newBuilder((com.google.type.TimeOfDay) type_)
              .mergeFrom(value).buildPartial();
        } else {
          type_ = value;
        }
        onChanged();
      } else {
        if (typeCase_ == 6) {
          timeValueBuilder_.mergeFrom(value);
        }
        timeValueBuilder_.setMessage(value);
      }
      typeCase_ = 6;
      return this;
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public Builder clearTimeValue() {
      if (timeValueBuilder_ == null) {
        if (typeCase_ == 6) {
          typeCase_ = 0;
          type_ = null;
          onChanged();
        }
      } else {
        if (typeCase_ == 6) {
          typeCase_ = 0;
          type_ = null;
        }
        timeValueBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public com.google.type.TimeOfDay.Builder getTimeValueBuilder() {
      return getTimeValueFieldBuilder().getBuilder();
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    public com.google.type.TimeOfDayOrBuilder getTimeValueOrBuilder() {
      if ((typeCase_ == 6) && (timeValueBuilder_ != null)) {
        return timeValueBuilder_.getMessageOrBuilder();
      } else {
        if (typeCase_ == 6) {
          return (com.google.type.TimeOfDay) type_;
        }
        return com.google.type.TimeOfDay.getDefaultInstance();
      }
    }
    /**
     * <code>.google.type.TimeOfDay time_value = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.type.TimeOfDay, com.google.type.TimeOfDay.Builder, com.google.type.TimeOfDayOrBuilder> 
        getTimeValueFieldBuilder() {
      if (timeValueBuilder_ == null) {
        if (!(typeCase_ == 6)) {
          type_ = com.google.type.TimeOfDay.getDefaultInstance();
        }
        timeValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.TimeOfDay, com.google.type.TimeOfDay.Builder, com.google.type.TimeOfDayOrBuilder>(
                (com.google.type.TimeOfDay) type_,
                getParentForChildren(),
                isClean());
        type_ = null;
      }
      typeCase_ = 6;
      onChanged();;
      return timeValueBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> dateValueBuilder_;
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public boolean hasDateValue() {
      return typeCase_ == 7;
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public com.google.type.Date getDateValue() {
      if (dateValueBuilder_ == null) {
        if (typeCase_ == 7) {
          return (com.google.type.Date) type_;
        }
        return com.google.type.Date.getDefaultInstance();
      } else {
        if (typeCase_ == 7) {
          return dateValueBuilder_.getMessage();
        }
        return com.google.type.Date.getDefaultInstance();
      }
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public Builder setDateValue(com.google.type.Date value) {
      if (dateValueBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        type_ = value;
        onChanged();
      } else {
        dateValueBuilder_.setMessage(value);
      }
      typeCase_ = 7;
      return this;
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public Builder setDateValue(
        com.google.type.Date.Builder builderForValue) {
      if (dateValueBuilder_ == null) {
        type_ = builderForValue.build();
        onChanged();
      } else {
        dateValueBuilder_.setMessage(builderForValue.build());
      }
      typeCase_ = 7;
      return this;
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public Builder mergeDateValue(com.google.type.Date value) {
      if (dateValueBuilder_ == null) {
        if (typeCase_ == 7 &&
            type_ != com.google.type.Date.getDefaultInstance()) {
          type_ = com.google.type.Date.newBuilder((com.google.type.Date) type_)
              .mergeFrom(value).buildPartial();
        } else {
          type_ = value;
        }
        onChanged();
      } else {
        if (typeCase_ == 7) {
          dateValueBuilder_.mergeFrom(value);
        }
        dateValueBuilder_.setMessage(value);
      }
      typeCase_ = 7;
      return this;
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public Builder clearDateValue() {
      if (dateValueBuilder_ == null) {
        if (typeCase_ == 7) {
          typeCase_ = 0;
          type_ = null;
          onChanged();
        }
      } else {
        if (typeCase_ == 7) {
          typeCase_ = 0;
          type_ = null;
        }
        dateValueBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public com.google.type.Date.Builder getDateValueBuilder() {
      return getDateValueFieldBuilder().getBuilder();
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    public com.google.type.DateOrBuilder getDateValueOrBuilder() {
      if ((typeCase_ == 7) && (dateValueBuilder_ != null)) {
        return dateValueBuilder_.getMessageOrBuilder();
      } else {
        if (typeCase_ == 7) {
          return (com.google.type.Date) type_;
        }
        return com.google.type.Date.getDefaultInstance();
      }
    }
    /**
     * <code>.google.type.Date date_value = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> 
        getDateValueFieldBuilder() {
      if (dateValueBuilder_ == null) {
        if (!(typeCase_ == 7)) {
          type_ = com.google.type.Date.getDefaultInstance();
        }
        dateValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>(
                (com.google.type.Date) type_,
                getParentForChildren(),
                isClean());
        type_ = null;
      }
      typeCase_ = 7;
      onChanged();;
      return dateValueBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2beta1.Value)
  }

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

  public static com.google.privacy.dlp.v2beta1.Value getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.privacy.dlp.v2beta1.Value getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

