• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/privacy/dlp/v2/dlp.proto
18 
19 package com.google.privacy.dlp.v2;
20 
21 /**
22  *
23  *
24  * <pre>
25  * The rule that specifies conditions when findings of infoTypes specified in
26  * `InspectionRuleSet` are removed from results.
27  * </pre>
28  *
29  * Protobuf type {@code google.privacy.dlp.v2.ExclusionRule}
30  */
31 public final class ExclusionRule extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.ExclusionRule)
34     ExclusionRuleOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use ExclusionRule.newBuilder() to construct.
ExclusionRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private ExclusionRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
ExclusionRule()41   private ExclusionRule() {
42     matchingType_ = 0;
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new ExclusionRule();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
getDescriptor()56   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
57     return com.google.privacy.dlp.v2.DlpProto
58         .internal_static_google_privacy_dlp_v2_ExclusionRule_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.privacy.dlp.v2.DlpProto
65         .internal_static_google_privacy_dlp_v2_ExclusionRule_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.privacy.dlp.v2.ExclusionRule.class,
68             com.google.privacy.dlp.v2.ExclusionRule.Builder.class);
69   }
70 
71   private int typeCase_ = 0;
72   private java.lang.Object type_;
73 
74   public enum TypeCase
75       implements
76           com.google.protobuf.Internal.EnumLite,
77           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
78     DICTIONARY(1),
79     REGEX(2),
80     EXCLUDE_INFO_TYPES(3),
81     EXCLUDE_BY_HOTWORD(5),
82     TYPE_NOT_SET(0);
83     private final int value;
84 
TypeCase(int value)85     private TypeCase(int value) {
86       this.value = value;
87     }
88     /**
89      * @param value The number of the enum to look for.
90      * @return The enum associated with the given number.
91      * @deprecated Use {@link #forNumber(int)} instead.
92      */
93     @java.lang.Deprecated
valueOf(int value)94     public static TypeCase valueOf(int value) {
95       return forNumber(value);
96     }
97 
forNumber(int value)98     public static TypeCase forNumber(int value) {
99       switch (value) {
100         case 1:
101           return DICTIONARY;
102         case 2:
103           return REGEX;
104         case 3:
105           return EXCLUDE_INFO_TYPES;
106         case 5:
107           return EXCLUDE_BY_HOTWORD;
108         case 0:
109           return TYPE_NOT_SET;
110         default:
111           return null;
112       }
113     }
114 
getNumber()115     public int getNumber() {
116       return this.value;
117     }
118   };
119 
getTypeCase()120   public TypeCase getTypeCase() {
121     return TypeCase.forNumber(typeCase_);
122   }
123 
124   public static final int DICTIONARY_FIELD_NUMBER = 1;
125   /**
126    *
127    *
128    * <pre>
129    * Dictionary which defines the rule.
130    * </pre>
131    *
132    * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
133    *
134    * @return Whether the dictionary field is set.
135    */
136   @java.lang.Override
hasDictionary()137   public boolean hasDictionary() {
138     return typeCase_ == 1;
139   }
140   /**
141    *
142    *
143    * <pre>
144    * Dictionary which defines the rule.
145    * </pre>
146    *
147    * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
148    *
149    * @return The dictionary.
150    */
151   @java.lang.Override
getDictionary()152   public com.google.privacy.dlp.v2.CustomInfoType.Dictionary getDictionary() {
153     if (typeCase_ == 1) {
154       return (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_;
155     }
156     return com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance();
157   }
158   /**
159    *
160    *
161    * <pre>
162    * Dictionary which defines the rule.
163    * </pre>
164    *
165    * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
166    */
167   @java.lang.Override
getDictionaryOrBuilder()168   public com.google.privacy.dlp.v2.CustomInfoType.DictionaryOrBuilder getDictionaryOrBuilder() {
169     if (typeCase_ == 1) {
170       return (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_;
171     }
172     return com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance();
173   }
174 
175   public static final int REGEX_FIELD_NUMBER = 2;
176   /**
177    *
178    *
179    * <pre>
180    * Regular expression which defines the rule.
181    * </pre>
182    *
183    * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
184    *
185    * @return Whether the regex field is set.
186    */
187   @java.lang.Override
hasRegex()188   public boolean hasRegex() {
189     return typeCase_ == 2;
190   }
191   /**
192    *
193    *
194    * <pre>
195    * Regular expression which defines the rule.
196    * </pre>
197    *
198    * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
199    *
200    * @return The regex.
201    */
202   @java.lang.Override
getRegex()203   public com.google.privacy.dlp.v2.CustomInfoType.Regex getRegex() {
204     if (typeCase_ == 2) {
205       return (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_;
206     }
207     return com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance();
208   }
209   /**
210    *
211    *
212    * <pre>
213    * Regular expression which defines the rule.
214    * </pre>
215    *
216    * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
217    */
218   @java.lang.Override
getRegexOrBuilder()219   public com.google.privacy.dlp.v2.CustomInfoType.RegexOrBuilder getRegexOrBuilder() {
220     if (typeCase_ == 2) {
221       return (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_;
222     }
223     return com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance();
224   }
225 
226   public static final int EXCLUDE_INFO_TYPES_FIELD_NUMBER = 3;
227   /**
228    *
229    *
230    * <pre>
231    * Set of infoTypes for which findings would affect this rule.
232    * </pre>
233    *
234    * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
235    *
236    * @return Whether the excludeInfoTypes field is set.
237    */
238   @java.lang.Override
hasExcludeInfoTypes()239   public boolean hasExcludeInfoTypes() {
240     return typeCase_ == 3;
241   }
242   /**
243    *
244    *
245    * <pre>
246    * Set of infoTypes for which findings would affect this rule.
247    * </pre>
248    *
249    * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
250    *
251    * @return The excludeInfoTypes.
252    */
253   @java.lang.Override
getExcludeInfoTypes()254   public com.google.privacy.dlp.v2.ExcludeInfoTypes getExcludeInfoTypes() {
255     if (typeCase_ == 3) {
256       return (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_;
257     }
258     return com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance();
259   }
260   /**
261    *
262    *
263    * <pre>
264    * Set of infoTypes for which findings would affect this rule.
265    * </pre>
266    *
267    * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
268    */
269   @java.lang.Override
getExcludeInfoTypesOrBuilder()270   public com.google.privacy.dlp.v2.ExcludeInfoTypesOrBuilder getExcludeInfoTypesOrBuilder() {
271     if (typeCase_ == 3) {
272       return (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_;
273     }
274     return com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance();
275   }
276 
277   public static final int EXCLUDE_BY_HOTWORD_FIELD_NUMBER = 5;
278   /**
279    *
280    *
281    * <pre>
282    * Drop if the hotword rule is contained in the proximate context. For
283    * tabular data, the context includes the column name.
284    * </pre>
285    *
286    * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
287    *
288    * @return Whether the excludeByHotword field is set.
289    */
290   @java.lang.Override
hasExcludeByHotword()291   public boolean hasExcludeByHotword() {
292     return typeCase_ == 5;
293   }
294   /**
295    *
296    *
297    * <pre>
298    * Drop if the hotword rule is contained in the proximate context. For
299    * tabular data, the context includes the column name.
300    * </pre>
301    *
302    * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
303    *
304    * @return The excludeByHotword.
305    */
306   @java.lang.Override
getExcludeByHotword()307   public com.google.privacy.dlp.v2.ExcludeByHotword getExcludeByHotword() {
308     if (typeCase_ == 5) {
309       return (com.google.privacy.dlp.v2.ExcludeByHotword) type_;
310     }
311     return com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance();
312   }
313   /**
314    *
315    *
316    * <pre>
317    * Drop if the hotword rule is contained in the proximate context. For
318    * tabular data, the context includes the column name.
319    * </pre>
320    *
321    * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
322    */
323   @java.lang.Override
getExcludeByHotwordOrBuilder()324   public com.google.privacy.dlp.v2.ExcludeByHotwordOrBuilder getExcludeByHotwordOrBuilder() {
325     if (typeCase_ == 5) {
326       return (com.google.privacy.dlp.v2.ExcludeByHotword) type_;
327     }
328     return com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance();
329   }
330 
331   public static final int MATCHING_TYPE_FIELD_NUMBER = 4;
332   private int matchingType_ = 0;
333   /**
334    *
335    *
336    * <pre>
337    * How the rule is applied, see MatchingType documentation for details.
338    * </pre>
339    *
340    * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
341    *
342    * @return The enum numeric value on the wire for matchingType.
343    */
344   @java.lang.Override
getMatchingTypeValue()345   public int getMatchingTypeValue() {
346     return matchingType_;
347   }
348   /**
349    *
350    *
351    * <pre>
352    * How the rule is applied, see MatchingType documentation for details.
353    * </pre>
354    *
355    * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
356    *
357    * @return The matchingType.
358    */
359   @java.lang.Override
getMatchingType()360   public com.google.privacy.dlp.v2.MatchingType getMatchingType() {
361     com.google.privacy.dlp.v2.MatchingType result =
362         com.google.privacy.dlp.v2.MatchingType.forNumber(matchingType_);
363     return result == null ? com.google.privacy.dlp.v2.MatchingType.UNRECOGNIZED : result;
364   }
365 
366   private byte memoizedIsInitialized = -1;
367 
368   @java.lang.Override
isInitialized()369   public final boolean isInitialized() {
370     byte isInitialized = memoizedIsInitialized;
371     if (isInitialized == 1) return true;
372     if (isInitialized == 0) return false;
373 
374     memoizedIsInitialized = 1;
375     return true;
376   }
377 
378   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)379   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
380     if (typeCase_ == 1) {
381       output.writeMessage(1, (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_);
382     }
383     if (typeCase_ == 2) {
384       output.writeMessage(2, (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_);
385     }
386     if (typeCase_ == 3) {
387       output.writeMessage(3, (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_);
388     }
389     if (matchingType_
390         != com.google.privacy.dlp.v2.MatchingType.MATCHING_TYPE_UNSPECIFIED.getNumber()) {
391       output.writeEnum(4, matchingType_);
392     }
393     if (typeCase_ == 5) {
394       output.writeMessage(5, (com.google.privacy.dlp.v2.ExcludeByHotword) type_);
395     }
396     getUnknownFields().writeTo(output);
397   }
398 
399   @java.lang.Override
getSerializedSize()400   public int getSerializedSize() {
401     int size = memoizedSize;
402     if (size != -1) return size;
403 
404     size = 0;
405     if (typeCase_ == 1) {
406       size +=
407           com.google.protobuf.CodedOutputStream.computeMessageSize(
408               1, (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_);
409     }
410     if (typeCase_ == 2) {
411       size +=
412           com.google.protobuf.CodedOutputStream.computeMessageSize(
413               2, (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_);
414     }
415     if (typeCase_ == 3) {
416       size +=
417           com.google.protobuf.CodedOutputStream.computeMessageSize(
418               3, (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_);
419     }
420     if (matchingType_
421         != com.google.privacy.dlp.v2.MatchingType.MATCHING_TYPE_UNSPECIFIED.getNumber()) {
422       size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, matchingType_);
423     }
424     if (typeCase_ == 5) {
425       size +=
426           com.google.protobuf.CodedOutputStream.computeMessageSize(
427               5, (com.google.privacy.dlp.v2.ExcludeByHotword) type_);
428     }
429     size += getUnknownFields().getSerializedSize();
430     memoizedSize = size;
431     return size;
432   }
433 
434   @java.lang.Override
equals(final java.lang.Object obj)435   public boolean equals(final java.lang.Object obj) {
436     if (obj == this) {
437       return true;
438     }
439     if (!(obj instanceof com.google.privacy.dlp.v2.ExclusionRule)) {
440       return super.equals(obj);
441     }
442     com.google.privacy.dlp.v2.ExclusionRule other = (com.google.privacy.dlp.v2.ExclusionRule) obj;
443 
444     if (matchingType_ != other.matchingType_) return false;
445     if (!getTypeCase().equals(other.getTypeCase())) return false;
446     switch (typeCase_) {
447       case 1:
448         if (!getDictionary().equals(other.getDictionary())) return false;
449         break;
450       case 2:
451         if (!getRegex().equals(other.getRegex())) return false;
452         break;
453       case 3:
454         if (!getExcludeInfoTypes().equals(other.getExcludeInfoTypes())) return false;
455         break;
456       case 5:
457         if (!getExcludeByHotword().equals(other.getExcludeByHotword())) return false;
458         break;
459       case 0:
460       default:
461     }
462     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
463     return true;
464   }
465 
466   @java.lang.Override
hashCode()467   public int hashCode() {
468     if (memoizedHashCode != 0) {
469       return memoizedHashCode;
470     }
471     int hash = 41;
472     hash = (19 * hash) + getDescriptor().hashCode();
473     hash = (37 * hash) + MATCHING_TYPE_FIELD_NUMBER;
474     hash = (53 * hash) + matchingType_;
475     switch (typeCase_) {
476       case 1:
477         hash = (37 * hash) + DICTIONARY_FIELD_NUMBER;
478         hash = (53 * hash) + getDictionary().hashCode();
479         break;
480       case 2:
481         hash = (37 * hash) + REGEX_FIELD_NUMBER;
482         hash = (53 * hash) + getRegex().hashCode();
483         break;
484       case 3:
485         hash = (37 * hash) + EXCLUDE_INFO_TYPES_FIELD_NUMBER;
486         hash = (53 * hash) + getExcludeInfoTypes().hashCode();
487         break;
488       case 5:
489         hash = (37 * hash) + EXCLUDE_BY_HOTWORD_FIELD_NUMBER;
490         hash = (53 * hash) + getExcludeByHotword().hashCode();
491         break;
492       case 0:
493       default:
494     }
495     hash = (29 * hash) + getUnknownFields().hashCode();
496     memoizedHashCode = hash;
497     return hash;
498   }
499 
parseFrom(java.nio.ByteBuffer data)500   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(java.nio.ByteBuffer data)
501       throws com.google.protobuf.InvalidProtocolBufferException {
502     return PARSER.parseFrom(data);
503   }
504 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)505   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
506       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
507       throws com.google.protobuf.InvalidProtocolBufferException {
508     return PARSER.parseFrom(data, extensionRegistry);
509   }
510 
parseFrom( com.google.protobuf.ByteString data)511   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
512       com.google.protobuf.ByteString data)
513       throws com.google.protobuf.InvalidProtocolBufferException {
514     return PARSER.parseFrom(data);
515   }
516 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)517   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
518       com.google.protobuf.ByteString data,
519       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
520       throws com.google.protobuf.InvalidProtocolBufferException {
521     return PARSER.parseFrom(data, extensionRegistry);
522   }
523 
parseFrom(byte[] data)524   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(byte[] data)
525       throws com.google.protobuf.InvalidProtocolBufferException {
526     return PARSER.parseFrom(data);
527   }
528 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)529   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
530       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
531       throws com.google.protobuf.InvalidProtocolBufferException {
532     return PARSER.parseFrom(data, extensionRegistry);
533   }
534 
parseFrom(java.io.InputStream input)535   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(java.io.InputStream input)
536       throws java.io.IOException {
537     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
538   }
539 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)540   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
541       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
542       throws java.io.IOException {
543     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
544         PARSER, input, extensionRegistry);
545   }
546 
parseDelimitedFrom( java.io.InputStream input)547   public static com.google.privacy.dlp.v2.ExclusionRule parseDelimitedFrom(
548       java.io.InputStream input) throws java.io.IOException {
549     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
550   }
551 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)552   public static com.google.privacy.dlp.v2.ExclusionRule parseDelimitedFrom(
553       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
554       throws java.io.IOException {
555     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
556         PARSER, input, extensionRegistry);
557   }
558 
parseFrom( com.google.protobuf.CodedInputStream input)559   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
560       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
561     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
562   }
563 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)564   public static com.google.privacy.dlp.v2.ExclusionRule parseFrom(
565       com.google.protobuf.CodedInputStream input,
566       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
567       throws java.io.IOException {
568     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
569         PARSER, input, extensionRegistry);
570   }
571 
572   @java.lang.Override
newBuilderForType()573   public Builder newBuilderForType() {
574     return newBuilder();
575   }
576 
newBuilder()577   public static Builder newBuilder() {
578     return DEFAULT_INSTANCE.toBuilder();
579   }
580 
newBuilder(com.google.privacy.dlp.v2.ExclusionRule prototype)581   public static Builder newBuilder(com.google.privacy.dlp.v2.ExclusionRule prototype) {
582     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
583   }
584 
585   @java.lang.Override
toBuilder()586   public Builder toBuilder() {
587     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
588   }
589 
590   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)591   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
592     Builder builder = new Builder(parent);
593     return builder;
594   }
595   /**
596    *
597    *
598    * <pre>
599    * The rule that specifies conditions when findings of infoTypes specified in
600    * `InspectionRuleSet` are removed from results.
601    * </pre>
602    *
603    * Protobuf type {@code google.privacy.dlp.v2.ExclusionRule}
604    */
605   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
606       implements
607       // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.ExclusionRule)
608       com.google.privacy.dlp.v2.ExclusionRuleOrBuilder {
getDescriptor()609     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
610       return com.google.privacy.dlp.v2.DlpProto
611           .internal_static_google_privacy_dlp_v2_ExclusionRule_descriptor;
612     }
613 
614     @java.lang.Override
615     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()616         internalGetFieldAccessorTable() {
617       return com.google.privacy.dlp.v2.DlpProto
618           .internal_static_google_privacy_dlp_v2_ExclusionRule_fieldAccessorTable
619           .ensureFieldAccessorsInitialized(
620               com.google.privacy.dlp.v2.ExclusionRule.class,
621               com.google.privacy.dlp.v2.ExclusionRule.Builder.class);
622     }
623 
624     // Construct using com.google.privacy.dlp.v2.ExclusionRule.newBuilder()
Builder()625     private Builder() {}
626 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)627     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
628       super(parent);
629     }
630 
631     @java.lang.Override
clear()632     public Builder clear() {
633       super.clear();
634       bitField0_ = 0;
635       if (dictionaryBuilder_ != null) {
636         dictionaryBuilder_.clear();
637       }
638       if (regexBuilder_ != null) {
639         regexBuilder_.clear();
640       }
641       if (excludeInfoTypesBuilder_ != null) {
642         excludeInfoTypesBuilder_.clear();
643       }
644       if (excludeByHotwordBuilder_ != null) {
645         excludeByHotwordBuilder_.clear();
646       }
647       matchingType_ = 0;
648       typeCase_ = 0;
649       type_ = null;
650       return this;
651     }
652 
653     @java.lang.Override
getDescriptorForType()654     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
655       return com.google.privacy.dlp.v2.DlpProto
656           .internal_static_google_privacy_dlp_v2_ExclusionRule_descriptor;
657     }
658 
659     @java.lang.Override
getDefaultInstanceForType()660     public com.google.privacy.dlp.v2.ExclusionRule getDefaultInstanceForType() {
661       return com.google.privacy.dlp.v2.ExclusionRule.getDefaultInstance();
662     }
663 
664     @java.lang.Override
build()665     public com.google.privacy.dlp.v2.ExclusionRule build() {
666       com.google.privacy.dlp.v2.ExclusionRule result = buildPartial();
667       if (!result.isInitialized()) {
668         throw newUninitializedMessageException(result);
669       }
670       return result;
671     }
672 
673     @java.lang.Override
buildPartial()674     public com.google.privacy.dlp.v2.ExclusionRule buildPartial() {
675       com.google.privacy.dlp.v2.ExclusionRule result =
676           new com.google.privacy.dlp.v2.ExclusionRule(this);
677       if (bitField0_ != 0) {
678         buildPartial0(result);
679       }
680       buildPartialOneofs(result);
681       onBuilt();
682       return result;
683     }
684 
buildPartial0(com.google.privacy.dlp.v2.ExclusionRule result)685     private void buildPartial0(com.google.privacy.dlp.v2.ExclusionRule result) {
686       int from_bitField0_ = bitField0_;
687       if (((from_bitField0_ & 0x00000010) != 0)) {
688         result.matchingType_ = matchingType_;
689       }
690     }
691 
buildPartialOneofs(com.google.privacy.dlp.v2.ExclusionRule result)692     private void buildPartialOneofs(com.google.privacy.dlp.v2.ExclusionRule result) {
693       result.typeCase_ = typeCase_;
694       result.type_ = this.type_;
695       if (typeCase_ == 1 && dictionaryBuilder_ != null) {
696         result.type_ = dictionaryBuilder_.build();
697       }
698       if (typeCase_ == 2 && regexBuilder_ != null) {
699         result.type_ = regexBuilder_.build();
700       }
701       if (typeCase_ == 3 && excludeInfoTypesBuilder_ != null) {
702         result.type_ = excludeInfoTypesBuilder_.build();
703       }
704       if (typeCase_ == 5 && excludeByHotwordBuilder_ != null) {
705         result.type_ = excludeByHotwordBuilder_.build();
706       }
707     }
708 
709     @java.lang.Override
clone()710     public Builder clone() {
711       return super.clone();
712     }
713 
714     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)715     public Builder setField(
716         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
717       return super.setField(field, value);
718     }
719 
720     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)721     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
722       return super.clearField(field);
723     }
724 
725     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)726     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
727       return super.clearOneof(oneof);
728     }
729 
730     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)731     public Builder setRepeatedField(
732         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
733       return super.setRepeatedField(field, index, value);
734     }
735 
736     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)737     public Builder addRepeatedField(
738         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
739       return super.addRepeatedField(field, value);
740     }
741 
742     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)743     public Builder mergeFrom(com.google.protobuf.Message other) {
744       if (other instanceof com.google.privacy.dlp.v2.ExclusionRule) {
745         return mergeFrom((com.google.privacy.dlp.v2.ExclusionRule) other);
746       } else {
747         super.mergeFrom(other);
748         return this;
749       }
750     }
751 
mergeFrom(com.google.privacy.dlp.v2.ExclusionRule other)752     public Builder mergeFrom(com.google.privacy.dlp.v2.ExclusionRule other) {
753       if (other == com.google.privacy.dlp.v2.ExclusionRule.getDefaultInstance()) return this;
754       if (other.matchingType_ != 0) {
755         setMatchingTypeValue(other.getMatchingTypeValue());
756       }
757       switch (other.getTypeCase()) {
758         case DICTIONARY:
759           {
760             mergeDictionary(other.getDictionary());
761             break;
762           }
763         case REGEX:
764           {
765             mergeRegex(other.getRegex());
766             break;
767           }
768         case EXCLUDE_INFO_TYPES:
769           {
770             mergeExcludeInfoTypes(other.getExcludeInfoTypes());
771             break;
772           }
773         case EXCLUDE_BY_HOTWORD:
774           {
775             mergeExcludeByHotword(other.getExcludeByHotword());
776             break;
777           }
778         case TYPE_NOT_SET:
779           {
780             break;
781           }
782       }
783       this.mergeUnknownFields(other.getUnknownFields());
784       onChanged();
785       return this;
786     }
787 
788     @java.lang.Override
isInitialized()789     public final boolean isInitialized() {
790       return true;
791     }
792 
793     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)794     public Builder mergeFrom(
795         com.google.protobuf.CodedInputStream input,
796         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
797         throws java.io.IOException {
798       if (extensionRegistry == null) {
799         throw new java.lang.NullPointerException();
800       }
801       try {
802         boolean done = false;
803         while (!done) {
804           int tag = input.readTag();
805           switch (tag) {
806             case 0:
807               done = true;
808               break;
809             case 10:
810               {
811                 input.readMessage(getDictionaryFieldBuilder().getBuilder(), extensionRegistry);
812                 typeCase_ = 1;
813                 break;
814               } // case 10
815             case 18:
816               {
817                 input.readMessage(getRegexFieldBuilder().getBuilder(), extensionRegistry);
818                 typeCase_ = 2;
819                 break;
820               } // case 18
821             case 26:
822               {
823                 input.readMessage(
824                     getExcludeInfoTypesFieldBuilder().getBuilder(), extensionRegistry);
825                 typeCase_ = 3;
826                 break;
827               } // case 26
828             case 32:
829               {
830                 matchingType_ = input.readEnum();
831                 bitField0_ |= 0x00000010;
832                 break;
833               } // case 32
834             case 42:
835               {
836                 input.readMessage(
837                     getExcludeByHotwordFieldBuilder().getBuilder(), extensionRegistry);
838                 typeCase_ = 5;
839                 break;
840               } // case 42
841             default:
842               {
843                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
844                   done = true; // was an endgroup tag
845                 }
846                 break;
847               } // default:
848           } // switch (tag)
849         } // while (!done)
850       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
851         throw e.unwrapIOException();
852       } finally {
853         onChanged();
854       } // finally
855       return this;
856     }
857 
858     private int typeCase_ = 0;
859     private java.lang.Object type_;
860 
getTypeCase()861     public TypeCase getTypeCase() {
862       return TypeCase.forNumber(typeCase_);
863     }
864 
clearType()865     public Builder clearType() {
866       typeCase_ = 0;
867       type_ = null;
868       onChanged();
869       return this;
870     }
871 
872     private int bitField0_;
873 
874     private com.google.protobuf.SingleFieldBuilderV3<
875             com.google.privacy.dlp.v2.CustomInfoType.Dictionary,
876             com.google.privacy.dlp.v2.CustomInfoType.Dictionary.Builder,
877             com.google.privacy.dlp.v2.CustomInfoType.DictionaryOrBuilder>
878         dictionaryBuilder_;
879     /**
880      *
881      *
882      * <pre>
883      * Dictionary which defines the rule.
884      * </pre>
885      *
886      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
887      *
888      * @return Whether the dictionary field is set.
889      */
890     @java.lang.Override
hasDictionary()891     public boolean hasDictionary() {
892       return typeCase_ == 1;
893     }
894     /**
895      *
896      *
897      * <pre>
898      * Dictionary which defines the rule.
899      * </pre>
900      *
901      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
902      *
903      * @return The dictionary.
904      */
905     @java.lang.Override
getDictionary()906     public com.google.privacy.dlp.v2.CustomInfoType.Dictionary getDictionary() {
907       if (dictionaryBuilder_ == null) {
908         if (typeCase_ == 1) {
909           return (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_;
910         }
911         return com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance();
912       } else {
913         if (typeCase_ == 1) {
914           return dictionaryBuilder_.getMessage();
915         }
916         return com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance();
917       }
918     }
919     /**
920      *
921      *
922      * <pre>
923      * Dictionary which defines the rule.
924      * </pre>
925      *
926      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
927      */
setDictionary(com.google.privacy.dlp.v2.CustomInfoType.Dictionary value)928     public Builder setDictionary(com.google.privacy.dlp.v2.CustomInfoType.Dictionary value) {
929       if (dictionaryBuilder_ == null) {
930         if (value == null) {
931           throw new NullPointerException();
932         }
933         type_ = value;
934         onChanged();
935       } else {
936         dictionaryBuilder_.setMessage(value);
937       }
938       typeCase_ = 1;
939       return this;
940     }
941     /**
942      *
943      *
944      * <pre>
945      * Dictionary which defines the rule.
946      * </pre>
947      *
948      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
949      */
setDictionary( com.google.privacy.dlp.v2.CustomInfoType.Dictionary.Builder builderForValue)950     public Builder setDictionary(
951         com.google.privacy.dlp.v2.CustomInfoType.Dictionary.Builder builderForValue) {
952       if (dictionaryBuilder_ == null) {
953         type_ = builderForValue.build();
954         onChanged();
955       } else {
956         dictionaryBuilder_.setMessage(builderForValue.build());
957       }
958       typeCase_ = 1;
959       return this;
960     }
961     /**
962      *
963      *
964      * <pre>
965      * Dictionary which defines the rule.
966      * </pre>
967      *
968      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
969      */
mergeDictionary(com.google.privacy.dlp.v2.CustomInfoType.Dictionary value)970     public Builder mergeDictionary(com.google.privacy.dlp.v2.CustomInfoType.Dictionary value) {
971       if (dictionaryBuilder_ == null) {
972         if (typeCase_ == 1
973             && type_ != com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance()) {
974           type_ =
975               com.google.privacy.dlp.v2.CustomInfoType.Dictionary.newBuilder(
976                       (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_)
977                   .mergeFrom(value)
978                   .buildPartial();
979         } else {
980           type_ = value;
981         }
982         onChanged();
983       } else {
984         if (typeCase_ == 1) {
985           dictionaryBuilder_.mergeFrom(value);
986         } else {
987           dictionaryBuilder_.setMessage(value);
988         }
989       }
990       typeCase_ = 1;
991       return this;
992     }
993     /**
994      *
995      *
996      * <pre>
997      * Dictionary which defines the rule.
998      * </pre>
999      *
1000      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
1001      */
clearDictionary()1002     public Builder clearDictionary() {
1003       if (dictionaryBuilder_ == null) {
1004         if (typeCase_ == 1) {
1005           typeCase_ = 0;
1006           type_ = null;
1007           onChanged();
1008         }
1009       } else {
1010         if (typeCase_ == 1) {
1011           typeCase_ = 0;
1012           type_ = null;
1013         }
1014         dictionaryBuilder_.clear();
1015       }
1016       return this;
1017     }
1018     /**
1019      *
1020      *
1021      * <pre>
1022      * Dictionary which defines the rule.
1023      * </pre>
1024      *
1025      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
1026      */
getDictionaryBuilder()1027     public com.google.privacy.dlp.v2.CustomInfoType.Dictionary.Builder getDictionaryBuilder() {
1028       return getDictionaryFieldBuilder().getBuilder();
1029     }
1030     /**
1031      *
1032      *
1033      * <pre>
1034      * Dictionary which defines the rule.
1035      * </pre>
1036      *
1037      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
1038      */
1039     @java.lang.Override
getDictionaryOrBuilder()1040     public com.google.privacy.dlp.v2.CustomInfoType.DictionaryOrBuilder getDictionaryOrBuilder() {
1041       if ((typeCase_ == 1) && (dictionaryBuilder_ != null)) {
1042         return dictionaryBuilder_.getMessageOrBuilder();
1043       } else {
1044         if (typeCase_ == 1) {
1045           return (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_;
1046         }
1047         return com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance();
1048       }
1049     }
1050     /**
1051      *
1052      *
1053      * <pre>
1054      * Dictionary which defines the rule.
1055      * </pre>
1056      *
1057      * <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 1;</code>
1058      */
1059     private com.google.protobuf.SingleFieldBuilderV3<
1060             com.google.privacy.dlp.v2.CustomInfoType.Dictionary,
1061             com.google.privacy.dlp.v2.CustomInfoType.Dictionary.Builder,
1062             com.google.privacy.dlp.v2.CustomInfoType.DictionaryOrBuilder>
getDictionaryFieldBuilder()1063         getDictionaryFieldBuilder() {
1064       if (dictionaryBuilder_ == null) {
1065         if (!(typeCase_ == 1)) {
1066           type_ = com.google.privacy.dlp.v2.CustomInfoType.Dictionary.getDefaultInstance();
1067         }
1068         dictionaryBuilder_ =
1069             new com.google.protobuf.SingleFieldBuilderV3<
1070                 com.google.privacy.dlp.v2.CustomInfoType.Dictionary,
1071                 com.google.privacy.dlp.v2.CustomInfoType.Dictionary.Builder,
1072                 com.google.privacy.dlp.v2.CustomInfoType.DictionaryOrBuilder>(
1073                 (com.google.privacy.dlp.v2.CustomInfoType.Dictionary) type_,
1074                 getParentForChildren(),
1075                 isClean());
1076         type_ = null;
1077       }
1078       typeCase_ = 1;
1079       onChanged();
1080       return dictionaryBuilder_;
1081     }
1082 
1083     private com.google.protobuf.SingleFieldBuilderV3<
1084             com.google.privacy.dlp.v2.CustomInfoType.Regex,
1085             com.google.privacy.dlp.v2.CustomInfoType.Regex.Builder,
1086             com.google.privacy.dlp.v2.CustomInfoType.RegexOrBuilder>
1087         regexBuilder_;
1088     /**
1089      *
1090      *
1091      * <pre>
1092      * Regular expression which defines the rule.
1093      * </pre>
1094      *
1095      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1096      *
1097      * @return Whether the regex field is set.
1098      */
1099     @java.lang.Override
hasRegex()1100     public boolean hasRegex() {
1101       return typeCase_ == 2;
1102     }
1103     /**
1104      *
1105      *
1106      * <pre>
1107      * Regular expression which defines the rule.
1108      * </pre>
1109      *
1110      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1111      *
1112      * @return The regex.
1113      */
1114     @java.lang.Override
getRegex()1115     public com.google.privacy.dlp.v2.CustomInfoType.Regex getRegex() {
1116       if (regexBuilder_ == null) {
1117         if (typeCase_ == 2) {
1118           return (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_;
1119         }
1120         return com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance();
1121       } else {
1122         if (typeCase_ == 2) {
1123           return regexBuilder_.getMessage();
1124         }
1125         return com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance();
1126       }
1127     }
1128     /**
1129      *
1130      *
1131      * <pre>
1132      * Regular expression which defines the rule.
1133      * </pre>
1134      *
1135      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1136      */
setRegex(com.google.privacy.dlp.v2.CustomInfoType.Regex value)1137     public Builder setRegex(com.google.privacy.dlp.v2.CustomInfoType.Regex value) {
1138       if (regexBuilder_ == null) {
1139         if (value == null) {
1140           throw new NullPointerException();
1141         }
1142         type_ = value;
1143         onChanged();
1144       } else {
1145         regexBuilder_.setMessage(value);
1146       }
1147       typeCase_ = 2;
1148       return this;
1149     }
1150     /**
1151      *
1152      *
1153      * <pre>
1154      * Regular expression which defines the rule.
1155      * </pre>
1156      *
1157      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1158      */
setRegex( com.google.privacy.dlp.v2.CustomInfoType.Regex.Builder builderForValue)1159     public Builder setRegex(
1160         com.google.privacy.dlp.v2.CustomInfoType.Regex.Builder builderForValue) {
1161       if (regexBuilder_ == null) {
1162         type_ = builderForValue.build();
1163         onChanged();
1164       } else {
1165         regexBuilder_.setMessage(builderForValue.build());
1166       }
1167       typeCase_ = 2;
1168       return this;
1169     }
1170     /**
1171      *
1172      *
1173      * <pre>
1174      * Regular expression which defines the rule.
1175      * </pre>
1176      *
1177      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1178      */
mergeRegex(com.google.privacy.dlp.v2.CustomInfoType.Regex value)1179     public Builder mergeRegex(com.google.privacy.dlp.v2.CustomInfoType.Regex value) {
1180       if (regexBuilder_ == null) {
1181         if (typeCase_ == 2
1182             && type_ != com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance()) {
1183           type_ =
1184               com.google.privacy.dlp.v2.CustomInfoType.Regex.newBuilder(
1185                       (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_)
1186                   .mergeFrom(value)
1187                   .buildPartial();
1188         } else {
1189           type_ = value;
1190         }
1191         onChanged();
1192       } else {
1193         if (typeCase_ == 2) {
1194           regexBuilder_.mergeFrom(value);
1195         } else {
1196           regexBuilder_.setMessage(value);
1197         }
1198       }
1199       typeCase_ = 2;
1200       return this;
1201     }
1202     /**
1203      *
1204      *
1205      * <pre>
1206      * Regular expression which defines the rule.
1207      * </pre>
1208      *
1209      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1210      */
clearRegex()1211     public Builder clearRegex() {
1212       if (regexBuilder_ == null) {
1213         if (typeCase_ == 2) {
1214           typeCase_ = 0;
1215           type_ = null;
1216           onChanged();
1217         }
1218       } else {
1219         if (typeCase_ == 2) {
1220           typeCase_ = 0;
1221           type_ = null;
1222         }
1223         regexBuilder_.clear();
1224       }
1225       return this;
1226     }
1227     /**
1228      *
1229      *
1230      * <pre>
1231      * Regular expression which defines the rule.
1232      * </pre>
1233      *
1234      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1235      */
getRegexBuilder()1236     public com.google.privacy.dlp.v2.CustomInfoType.Regex.Builder getRegexBuilder() {
1237       return getRegexFieldBuilder().getBuilder();
1238     }
1239     /**
1240      *
1241      *
1242      * <pre>
1243      * Regular expression which defines the rule.
1244      * </pre>
1245      *
1246      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1247      */
1248     @java.lang.Override
getRegexOrBuilder()1249     public com.google.privacy.dlp.v2.CustomInfoType.RegexOrBuilder getRegexOrBuilder() {
1250       if ((typeCase_ == 2) && (regexBuilder_ != null)) {
1251         return regexBuilder_.getMessageOrBuilder();
1252       } else {
1253         if (typeCase_ == 2) {
1254           return (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_;
1255         }
1256         return com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance();
1257       }
1258     }
1259     /**
1260      *
1261      *
1262      * <pre>
1263      * Regular expression which defines the rule.
1264      * </pre>
1265      *
1266      * <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
1267      */
1268     private com.google.protobuf.SingleFieldBuilderV3<
1269             com.google.privacy.dlp.v2.CustomInfoType.Regex,
1270             com.google.privacy.dlp.v2.CustomInfoType.Regex.Builder,
1271             com.google.privacy.dlp.v2.CustomInfoType.RegexOrBuilder>
getRegexFieldBuilder()1272         getRegexFieldBuilder() {
1273       if (regexBuilder_ == null) {
1274         if (!(typeCase_ == 2)) {
1275           type_ = com.google.privacy.dlp.v2.CustomInfoType.Regex.getDefaultInstance();
1276         }
1277         regexBuilder_ =
1278             new com.google.protobuf.SingleFieldBuilderV3<
1279                 com.google.privacy.dlp.v2.CustomInfoType.Regex,
1280                 com.google.privacy.dlp.v2.CustomInfoType.Regex.Builder,
1281                 com.google.privacy.dlp.v2.CustomInfoType.RegexOrBuilder>(
1282                 (com.google.privacy.dlp.v2.CustomInfoType.Regex) type_,
1283                 getParentForChildren(),
1284                 isClean());
1285         type_ = null;
1286       }
1287       typeCase_ = 2;
1288       onChanged();
1289       return regexBuilder_;
1290     }
1291 
1292     private com.google.protobuf.SingleFieldBuilderV3<
1293             com.google.privacy.dlp.v2.ExcludeInfoTypes,
1294             com.google.privacy.dlp.v2.ExcludeInfoTypes.Builder,
1295             com.google.privacy.dlp.v2.ExcludeInfoTypesOrBuilder>
1296         excludeInfoTypesBuilder_;
1297     /**
1298      *
1299      *
1300      * <pre>
1301      * Set of infoTypes for which findings would affect this rule.
1302      * </pre>
1303      *
1304      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1305      *
1306      * @return Whether the excludeInfoTypes field is set.
1307      */
1308     @java.lang.Override
hasExcludeInfoTypes()1309     public boolean hasExcludeInfoTypes() {
1310       return typeCase_ == 3;
1311     }
1312     /**
1313      *
1314      *
1315      * <pre>
1316      * Set of infoTypes for which findings would affect this rule.
1317      * </pre>
1318      *
1319      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1320      *
1321      * @return The excludeInfoTypes.
1322      */
1323     @java.lang.Override
getExcludeInfoTypes()1324     public com.google.privacy.dlp.v2.ExcludeInfoTypes getExcludeInfoTypes() {
1325       if (excludeInfoTypesBuilder_ == null) {
1326         if (typeCase_ == 3) {
1327           return (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_;
1328         }
1329         return com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance();
1330       } else {
1331         if (typeCase_ == 3) {
1332           return excludeInfoTypesBuilder_.getMessage();
1333         }
1334         return com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance();
1335       }
1336     }
1337     /**
1338      *
1339      *
1340      * <pre>
1341      * Set of infoTypes for which findings would affect this rule.
1342      * </pre>
1343      *
1344      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1345      */
setExcludeInfoTypes(com.google.privacy.dlp.v2.ExcludeInfoTypes value)1346     public Builder setExcludeInfoTypes(com.google.privacy.dlp.v2.ExcludeInfoTypes value) {
1347       if (excludeInfoTypesBuilder_ == null) {
1348         if (value == null) {
1349           throw new NullPointerException();
1350         }
1351         type_ = value;
1352         onChanged();
1353       } else {
1354         excludeInfoTypesBuilder_.setMessage(value);
1355       }
1356       typeCase_ = 3;
1357       return this;
1358     }
1359     /**
1360      *
1361      *
1362      * <pre>
1363      * Set of infoTypes for which findings would affect this rule.
1364      * </pre>
1365      *
1366      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1367      */
setExcludeInfoTypes( com.google.privacy.dlp.v2.ExcludeInfoTypes.Builder builderForValue)1368     public Builder setExcludeInfoTypes(
1369         com.google.privacy.dlp.v2.ExcludeInfoTypes.Builder builderForValue) {
1370       if (excludeInfoTypesBuilder_ == null) {
1371         type_ = builderForValue.build();
1372         onChanged();
1373       } else {
1374         excludeInfoTypesBuilder_.setMessage(builderForValue.build());
1375       }
1376       typeCase_ = 3;
1377       return this;
1378     }
1379     /**
1380      *
1381      *
1382      * <pre>
1383      * Set of infoTypes for which findings would affect this rule.
1384      * </pre>
1385      *
1386      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1387      */
mergeExcludeInfoTypes(com.google.privacy.dlp.v2.ExcludeInfoTypes value)1388     public Builder mergeExcludeInfoTypes(com.google.privacy.dlp.v2.ExcludeInfoTypes value) {
1389       if (excludeInfoTypesBuilder_ == null) {
1390         if (typeCase_ == 3
1391             && type_ != com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance()) {
1392           type_ =
1393               com.google.privacy.dlp.v2.ExcludeInfoTypes.newBuilder(
1394                       (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_)
1395                   .mergeFrom(value)
1396                   .buildPartial();
1397         } else {
1398           type_ = value;
1399         }
1400         onChanged();
1401       } else {
1402         if (typeCase_ == 3) {
1403           excludeInfoTypesBuilder_.mergeFrom(value);
1404         } else {
1405           excludeInfoTypesBuilder_.setMessage(value);
1406         }
1407       }
1408       typeCase_ = 3;
1409       return this;
1410     }
1411     /**
1412      *
1413      *
1414      * <pre>
1415      * Set of infoTypes for which findings would affect this rule.
1416      * </pre>
1417      *
1418      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1419      */
clearExcludeInfoTypes()1420     public Builder clearExcludeInfoTypes() {
1421       if (excludeInfoTypesBuilder_ == null) {
1422         if (typeCase_ == 3) {
1423           typeCase_ = 0;
1424           type_ = null;
1425           onChanged();
1426         }
1427       } else {
1428         if (typeCase_ == 3) {
1429           typeCase_ = 0;
1430           type_ = null;
1431         }
1432         excludeInfoTypesBuilder_.clear();
1433       }
1434       return this;
1435     }
1436     /**
1437      *
1438      *
1439      * <pre>
1440      * Set of infoTypes for which findings would affect this rule.
1441      * </pre>
1442      *
1443      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1444      */
getExcludeInfoTypesBuilder()1445     public com.google.privacy.dlp.v2.ExcludeInfoTypes.Builder getExcludeInfoTypesBuilder() {
1446       return getExcludeInfoTypesFieldBuilder().getBuilder();
1447     }
1448     /**
1449      *
1450      *
1451      * <pre>
1452      * Set of infoTypes for which findings would affect this rule.
1453      * </pre>
1454      *
1455      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1456      */
1457     @java.lang.Override
getExcludeInfoTypesOrBuilder()1458     public com.google.privacy.dlp.v2.ExcludeInfoTypesOrBuilder getExcludeInfoTypesOrBuilder() {
1459       if ((typeCase_ == 3) && (excludeInfoTypesBuilder_ != null)) {
1460         return excludeInfoTypesBuilder_.getMessageOrBuilder();
1461       } else {
1462         if (typeCase_ == 3) {
1463           return (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_;
1464         }
1465         return com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance();
1466       }
1467     }
1468     /**
1469      *
1470      *
1471      * <pre>
1472      * Set of infoTypes for which findings would affect this rule.
1473      * </pre>
1474      *
1475      * <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
1476      */
1477     private com.google.protobuf.SingleFieldBuilderV3<
1478             com.google.privacy.dlp.v2.ExcludeInfoTypes,
1479             com.google.privacy.dlp.v2.ExcludeInfoTypes.Builder,
1480             com.google.privacy.dlp.v2.ExcludeInfoTypesOrBuilder>
getExcludeInfoTypesFieldBuilder()1481         getExcludeInfoTypesFieldBuilder() {
1482       if (excludeInfoTypesBuilder_ == null) {
1483         if (!(typeCase_ == 3)) {
1484           type_ = com.google.privacy.dlp.v2.ExcludeInfoTypes.getDefaultInstance();
1485         }
1486         excludeInfoTypesBuilder_ =
1487             new com.google.protobuf.SingleFieldBuilderV3<
1488                 com.google.privacy.dlp.v2.ExcludeInfoTypes,
1489                 com.google.privacy.dlp.v2.ExcludeInfoTypes.Builder,
1490                 com.google.privacy.dlp.v2.ExcludeInfoTypesOrBuilder>(
1491                 (com.google.privacy.dlp.v2.ExcludeInfoTypes) type_,
1492                 getParentForChildren(),
1493                 isClean());
1494         type_ = null;
1495       }
1496       typeCase_ = 3;
1497       onChanged();
1498       return excludeInfoTypesBuilder_;
1499     }
1500 
1501     private com.google.protobuf.SingleFieldBuilderV3<
1502             com.google.privacy.dlp.v2.ExcludeByHotword,
1503             com.google.privacy.dlp.v2.ExcludeByHotword.Builder,
1504             com.google.privacy.dlp.v2.ExcludeByHotwordOrBuilder>
1505         excludeByHotwordBuilder_;
1506     /**
1507      *
1508      *
1509      * <pre>
1510      * Drop if the hotword rule is contained in the proximate context. For
1511      * tabular data, the context includes the column name.
1512      * </pre>
1513      *
1514      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1515      *
1516      * @return Whether the excludeByHotword field is set.
1517      */
1518     @java.lang.Override
hasExcludeByHotword()1519     public boolean hasExcludeByHotword() {
1520       return typeCase_ == 5;
1521     }
1522     /**
1523      *
1524      *
1525      * <pre>
1526      * Drop if the hotword rule is contained in the proximate context. For
1527      * tabular data, the context includes the column name.
1528      * </pre>
1529      *
1530      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1531      *
1532      * @return The excludeByHotword.
1533      */
1534     @java.lang.Override
getExcludeByHotword()1535     public com.google.privacy.dlp.v2.ExcludeByHotword getExcludeByHotword() {
1536       if (excludeByHotwordBuilder_ == null) {
1537         if (typeCase_ == 5) {
1538           return (com.google.privacy.dlp.v2.ExcludeByHotword) type_;
1539         }
1540         return com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance();
1541       } else {
1542         if (typeCase_ == 5) {
1543           return excludeByHotwordBuilder_.getMessage();
1544         }
1545         return com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance();
1546       }
1547     }
1548     /**
1549      *
1550      *
1551      * <pre>
1552      * Drop if the hotword rule is contained in the proximate context. For
1553      * tabular data, the context includes the column name.
1554      * </pre>
1555      *
1556      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1557      */
setExcludeByHotword(com.google.privacy.dlp.v2.ExcludeByHotword value)1558     public Builder setExcludeByHotword(com.google.privacy.dlp.v2.ExcludeByHotword value) {
1559       if (excludeByHotwordBuilder_ == null) {
1560         if (value == null) {
1561           throw new NullPointerException();
1562         }
1563         type_ = value;
1564         onChanged();
1565       } else {
1566         excludeByHotwordBuilder_.setMessage(value);
1567       }
1568       typeCase_ = 5;
1569       return this;
1570     }
1571     /**
1572      *
1573      *
1574      * <pre>
1575      * Drop if the hotword rule is contained in the proximate context. For
1576      * tabular data, the context includes the column name.
1577      * </pre>
1578      *
1579      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1580      */
setExcludeByHotword( com.google.privacy.dlp.v2.ExcludeByHotword.Builder builderForValue)1581     public Builder setExcludeByHotword(
1582         com.google.privacy.dlp.v2.ExcludeByHotword.Builder builderForValue) {
1583       if (excludeByHotwordBuilder_ == null) {
1584         type_ = builderForValue.build();
1585         onChanged();
1586       } else {
1587         excludeByHotwordBuilder_.setMessage(builderForValue.build());
1588       }
1589       typeCase_ = 5;
1590       return this;
1591     }
1592     /**
1593      *
1594      *
1595      * <pre>
1596      * Drop if the hotword rule is contained in the proximate context. For
1597      * tabular data, the context includes the column name.
1598      * </pre>
1599      *
1600      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1601      */
mergeExcludeByHotword(com.google.privacy.dlp.v2.ExcludeByHotword value)1602     public Builder mergeExcludeByHotword(com.google.privacy.dlp.v2.ExcludeByHotword value) {
1603       if (excludeByHotwordBuilder_ == null) {
1604         if (typeCase_ == 5
1605             && type_ != com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance()) {
1606           type_ =
1607               com.google.privacy.dlp.v2.ExcludeByHotword.newBuilder(
1608                       (com.google.privacy.dlp.v2.ExcludeByHotword) type_)
1609                   .mergeFrom(value)
1610                   .buildPartial();
1611         } else {
1612           type_ = value;
1613         }
1614         onChanged();
1615       } else {
1616         if (typeCase_ == 5) {
1617           excludeByHotwordBuilder_.mergeFrom(value);
1618         } else {
1619           excludeByHotwordBuilder_.setMessage(value);
1620         }
1621       }
1622       typeCase_ = 5;
1623       return this;
1624     }
1625     /**
1626      *
1627      *
1628      * <pre>
1629      * Drop if the hotword rule is contained in the proximate context. For
1630      * tabular data, the context includes the column name.
1631      * </pre>
1632      *
1633      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1634      */
clearExcludeByHotword()1635     public Builder clearExcludeByHotword() {
1636       if (excludeByHotwordBuilder_ == null) {
1637         if (typeCase_ == 5) {
1638           typeCase_ = 0;
1639           type_ = null;
1640           onChanged();
1641         }
1642       } else {
1643         if (typeCase_ == 5) {
1644           typeCase_ = 0;
1645           type_ = null;
1646         }
1647         excludeByHotwordBuilder_.clear();
1648       }
1649       return this;
1650     }
1651     /**
1652      *
1653      *
1654      * <pre>
1655      * Drop if the hotword rule is contained in the proximate context. For
1656      * tabular data, the context includes the column name.
1657      * </pre>
1658      *
1659      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1660      */
getExcludeByHotwordBuilder()1661     public com.google.privacy.dlp.v2.ExcludeByHotword.Builder getExcludeByHotwordBuilder() {
1662       return getExcludeByHotwordFieldBuilder().getBuilder();
1663     }
1664     /**
1665      *
1666      *
1667      * <pre>
1668      * Drop if the hotword rule is contained in the proximate context. For
1669      * tabular data, the context includes the column name.
1670      * </pre>
1671      *
1672      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1673      */
1674     @java.lang.Override
getExcludeByHotwordOrBuilder()1675     public com.google.privacy.dlp.v2.ExcludeByHotwordOrBuilder getExcludeByHotwordOrBuilder() {
1676       if ((typeCase_ == 5) && (excludeByHotwordBuilder_ != null)) {
1677         return excludeByHotwordBuilder_.getMessageOrBuilder();
1678       } else {
1679         if (typeCase_ == 5) {
1680           return (com.google.privacy.dlp.v2.ExcludeByHotword) type_;
1681         }
1682         return com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance();
1683       }
1684     }
1685     /**
1686      *
1687      *
1688      * <pre>
1689      * Drop if the hotword rule is contained in the proximate context. For
1690      * tabular data, the context includes the column name.
1691      * </pre>
1692      *
1693      * <code>.google.privacy.dlp.v2.ExcludeByHotword exclude_by_hotword = 5;</code>
1694      */
1695     private com.google.protobuf.SingleFieldBuilderV3<
1696             com.google.privacy.dlp.v2.ExcludeByHotword,
1697             com.google.privacy.dlp.v2.ExcludeByHotword.Builder,
1698             com.google.privacy.dlp.v2.ExcludeByHotwordOrBuilder>
getExcludeByHotwordFieldBuilder()1699         getExcludeByHotwordFieldBuilder() {
1700       if (excludeByHotwordBuilder_ == null) {
1701         if (!(typeCase_ == 5)) {
1702           type_ = com.google.privacy.dlp.v2.ExcludeByHotword.getDefaultInstance();
1703         }
1704         excludeByHotwordBuilder_ =
1705             new com.google.protobuf.SingleFieldBuilderV3<
1706                 com.google.privacy.dlp.v2.ExcludeByHotword,
1707                 com.google.privacy.dlp.v2.ExcludeByHotword.Builder,
1708                 com.google.privacy.dlp.v2.ExcludeByHotwordOrBuilder>(
1709                 (com.google.privacy.dlp.v2.ExcludeByHotword) type_,
1710                 getParentForChildren(),
1711                 isClean());
1712         type_ = null;
1713       }
1714       typeCase_ = 5;
1715       onChanged();
1716       return excludeByHotwordBuilder_;
1717     }
1718 
1719     private int matchingType_ = 0;
1720     /**
1721      *
1722      *
1723      * <pre>
1724      * How the rule is applied, see MatchingType documentation for details.
1725      * </pre>
1726      *
1727      * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
1728      *
1729      * @return The enum numeric value on the wire for matchingType.
1730      */
1731     @java.lang.Override
getMatchingTypeValue()1732     public int getMatchingTypeValue() {
1733       return matchingType_;
1734     }
1735     /**
1736      *
1737      *
1738      * <pre>
1739      * How the rule is applied, see MatchingType documentation for details.
1740      * </pre>
1741      *
1742      * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
1743      *
1744      * @param value The enum numeric value on the wire for matchingType to set.
1745      * @return This builder for chaining.
1746      */
setMatchingTypeValue(int value)1747     public Builder setMatchingTypeValue(int value) {
1748       matchingType_ = value;
1749       bitField0_ |= 0x00000010;
1750       onChanged();
1751       return this;
1752     }
1753     /**
1754      *
1755      *
1756      * <pre>
1757      * How the rule is applied, see MatchingType documentation for details.
1758      * </pre>
1759      *
1760      * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
1761      *
1762      * @return The matchingType.
1763      */
1764     @java.lang.Override
getMatchingType()1765     public com.google.privacy.dlp.v2.MatchingType getMatchingType() {
1766       com.google.privacy.dlp.v2.MatchingType result =
1767           com.google.privacy.dlp.v2.MatchingType.forNumber(matchingType_);
1768       return result == null ? com.google.privacy.dlp.v2.MatchingType.UNRECOGNIZED : result;
1769     }
1770     /**
1771      *
1772      *
1773      * <pre>
1774      * How the rule is applied, see MatchingType documentation for details.
1775      * </pre>
1776      *
1777      * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
1778      *
1779      * @param value The matchingType to set.
1780      * @return This builder for chaining.
1781      */
setMatchingType(com.google.privacy.dlp.v2.MatchingType value)1782     public Builder setMatchingType(com.google.privacy.dlp.v2.MatchingType value) {
1783       if (value == null) {
1784         throw new NullPointerException();
1785       }
1786       bitField0_ |= 0x00000010;
1787       matchingType_ = value.getNumber();
1788       onChanged();
1789       return this;
1790     }
1791     /**
1792      *
1793      *
1794      * <pre>
1795      * How the rule is applied, see MatchingType documentation for details.
1796      * </pre>
1797      *
1798      * <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
1799      *
1800      * @return This builder for chaining.
1801      */
clearMatchingType()1802     public Builder clearMatchingType() {
1803       bitField0_ = (bitField0_ & ~0x00000010);
1804       matchingType_ = 0;
1805       onChanged();
1806       return this;
1807     }
1808 
1809     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1810     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1811       return super.setUnknownFields(unknownFields);
1812     }
1813 
1814     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1815     public final Builder mergeUnknownFields(
1816         final com.google.protobuf.UnknownFieldSet unknownFields) {
1817       return super.mergeUnknownFields(unknownFields);
1818     }
1819 
1820     // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.ExclusionRule)
1821   }
1822 
1823   // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ExclusionRule)
1824   private static final com.google.privacy.dlp.v2.ExclusionRule DEFAULT_INSTANCE;
1825 
1826   static {
1827     DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.ExclusionRule();
1828   }
1829 
getDefaultInstance()1830   public static com.google.privacy.dlp.v2.ExclusionRule getDefaultInstance() {
1831     return DEFAULT_INSTANCE;
1832   }
1833 
1834   private static final com.google.protobuf.Parser<ExclusionRule> PARSER =
1835       new com.google.protobuf.AbstractParser<ExclusionRule>() {
1836         @java.lang.Override
1837         public ExclusionRule parsePartialFrom(
1838             com.google.protobuf.CodedInputStream input,
1839             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1840             throws com.google.protobuf.InvalidProtocolBufferException {
1841           Builder builder = newBuilder();
1842           try {
1843             builder.mergeFrom(input, extensionRegistry);
1844           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1845             throw e.setUnfinishedMessage(builder.buildPartial());
1846           } catch (com.google.protobuf.UninitializedMessageException e) {
1847             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1848           } catch (java.io.IOException e) {
1849             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1850                 .setUnfinishedMessage(builder.buildPartial());
1851           }
1852           return builder.buildPartial();
1853         }
1854       };
1855 
parser()1856   public static com.google.protobuf.Parser<ExclusionRule> parser() {
1857     return PARSER;
1858   }
1859 
1860   @java.lang.Override
getParserForType()1861   public com.google.protobuf.Parser<ExclusionRule> getParserForType() {
1862     return PARSER;
1863   }
1864 
1865   @java.lang.Override
getDefaultInstanceForType()1866   public com.google.privacy.dlp.v2.ExclusionRule getDefaultInstanceForType() {
1867     return DEFAULT_INSTANCE;
1868   }
1869 }
1870