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