• 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/vision/v1/image_annotator.proto
18 
19 package com.google.cloud.vision.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * The desired output location and metadata.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.vision.v1.OutputConfig}
29  */
30 public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.OutputConfig)
33     OutputConfigOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use OutputConfig.newBuilder() to construct.
OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
OutputConfig()40   private OutputConfig() {}
41 
42   @java.lang.Override
43   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)44   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
45     return new OutputConfig();
46   }
47 
48   @java.lang.Override
getUnknownFields()49   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
50     return this.unknownFields;
51   }
52 
getDescriptor()53   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
54     return com.google.cloud.vision.v1.ImageAnnotatorProto
55         .internal_static_google_cloud_vision_v1_OutputConfig_descriptor;
56   }
57 
58   @java.lang.Override
59   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()60       internalGetFieldAccessorTable() {
61     return com.google.cloud.vision.v1.ImageAnnotatorProto
62         .internal_static_google_cloud_vision_v1_OutputConfig_fieldAccessorTable
63         .ensureFieldAccessorsInitialized(
64             com.google.cloud.vision.v1.OutputConfig.class,
65             com.google.cloud.vision.v1.OutputConfig.Builder.class);
66   }
67 
68   public static final int GCS_DESTINATION_FIELD_NUMBER = 1;
69   private com.google.cloud.vision.v1.GcsDestination gcsDestination_;
70   /**
71    *
72    *
73    * <pre>
74    * The Google Cloud Storage location to write the output(s) to.
75    * </pre>
76    *
77    * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
78    *
79    * @return Whether the gcsDestination field is set.
80    */
81   @java.lang.Override
hasGcsDestination()82   public boolean hasGcsDestination() {
83     return gcsDestination_ != null;
84   }
85   /**
86    *
87    *
88    * <pre>
89    * The Google Cloud Storage location to write the output(s) to.
90    * </pre>
91    *
92    * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
93    *
94    * @return The gcsDestination.
95    */
96   @java.lang.Override
getGcsDestination()97   public com.google.cloud.vision.v1.GcsDestination getGcsDestination() {
98     return gcsDestination_ == null
99         ? com.google.cloud.vision.v1.GcsDestination.getDefaultInstance()
100         : gcsDestination_;
101   }
102   /**
103    *
104    *
105    * <pre>
106    * The Google Cloud Storage location to write the output(s) to.
107    * </pre>
108    *
109    * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
110    */
111   @java.lang.Override
getGcsDestinationOrBuilder()112   public com.google.cloud.vision.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() {
113     return gcsDestination_ == null
114         ? com.google.cloud.vision.v1.GcsDestination.getDefaultInstance()
115         : gcsDestination_;
116   }
117 
118   public static final int BATCH_SIZE_FIELD_NUMBER = 2;
119   private int batchSize_ = 0;
120   /**
121    *
122    *
123    * <pre>
124    * The max number of response protos to put into each output JSON file on
125    * Google Cloud Storage.
126    * The valid range is [1, 100]. If not specified, the default value is 20.
127    * For example, for one pdf file with 100 pages, 100 response protos will
128    * be generated. If `batch_size` = 20, then 5 json files each
129    * containing 20 response protos will be written under the prefix
130    * `gcs_destination`.`uri`.
131    * Currently, batch_size only applies to GcsDestination, with potential future
132    * support for other output configurations.
133    * </pre>
134    *
135    * <code>int32 batch_size = 2;</code>
136    *
137    * @return The batchSize.
138    */
139   @java.lang.Override
getBatchSize()140   public int getBatchSize() {
141     return batchSize_;
142   }
143 
144   private byte memoizedIsInitialized = -1;
145 
146   @java.lang.Override
isInitialized()147   public final boolean isInitialized() {
148     byte isInitialized = memoizedIsInitialized;
149     if (isInitialized == 1) return true;
150     if (isInitialized == 0) return false;
151 
152     memoizedIsInitialized = 1;
153     return true;
154   }
155 
156   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)157   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
158     if (gcsDestination_ != null) {
159       output.writeMessage(1, getGcsDestination());
160     }
161     if (batchSize_ != 0) {
162       output.writeInt32(2, batchSize_);
163     }
164     getUnknownFields().writeTo(output);
165   }
166 
167   @java.lang.Override
getSerializedSize()168   public int getSerializedSize() {
169     int size = memoizedSize;
170     if (size != -1) return size;
171 
172     size = 0;
173     if (gcsDestination_ != null) {
174       size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsDestination());
175     }
176     if (batchSize_ != 0) {
177       size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, batchSize_);
178     }
179     size += getUnknownFields().getSerializedSize();
180     memoizedSize = size;
181     return size;
182   }
183 
184   @java.lang.Override
equals(final java.lang.Object obj)185   public boolean equals(final java.lang.Object obj) {
186     if (obj == this) {
187       return true;
188     }
189     if (!(obj instanceof com.google.cloud.vision.v1.OutputConfig)) {
190       return super.equals(obj);
191     }
192     com.google.cloud.vision.v1.OutputConfig other = (com.google.cloud.vision.v1.OutputConfig) obj;
193 
194     if (hasGcsDestination() != other.hasGcsDestination()) return false;
195     if (hasGcsDestination()) {
196       if (!getGcsDestination().equals(other.getGcsDestination())) return false;
197     }
198     if (getBatchSize() != other.getBatchSize()) return false;
199     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
200     return true;
201   }
202 
203   @java.lang.Override
hashCode()204   public int hashCode() {
205     if (memoizedHashCode != 0) {
206       return memoizedHashCode;
207     }
208     int hash = 41;
209     hash = (19 * hash) + getDescriptor().hashCode();
210     if (hasGcsDestination()) {
211       hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER;
212       hash = (53 * hash) + getGcsDestination().hashCode();
213     }
214     hash = (37 * hash) + BATCH_SIZE_FIELD_NUMBER;
215     hash = (53 * hash) + getBatchSize();
216     hash = (29 * hash) + getUnknownFields().hashCode();
217     memoizedHashCode = hash;
218     return hash;
219   }
220 
parseFrom(java.nio.ByteBuffer data)221   public static com.google.cloud.vision.v1.OutputConfig parseFrom(java.nio.ByteBuffer data)
222       throws com.google.protobuf.InvalidProtocolBufferException {
223     return PARSER.parseFrom(data);
224   }
225 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)226   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
227       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
228       throws com.google.protobuf.InvalidProtocolBufferException {
229     return PARSER.parseFrom(data, extensionRegistry);
230   }
231 
parseFrom( com.google.protobuf.ByteString data)232   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
233       com.google.protobuf.ByteString data)
234       throws com.google.protobuf.InvalidProtocolBufferException {
235     return PARSER.parseFrom(data);
236   }
237 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)238   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
239       com.google.protobuf.ByteString data,
240       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
241       throws com.google.protobuf.InvalidProtocolBufferException {
242     return PARSER.parseFrom(data, extensionRegistry);
243   }
244 
parseFrom(byte[] data)245   public static com.google.cloud.vision.v1.OutputConfig parseFrom(byte[] data)
246       throws com.google.protobuf.InvalidProtocolBufferException {
247     return PARSER.parseFrom(data);
248   }
249 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)250   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
251       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
252       throws com.google.protobuf.InvalidProtocolBufferException {
253     return PARSER.parseFrom(data, extensionRegistry);
254   }
255 
parseFrom(java.io.InputStream input)256   public static com.google.cloud.vision.v1.OutputConfig parseFrom(java.io.InputStream input)
257       throws java.io.IOException {
258     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
259   }
260 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)261   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
262       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
263       throws java.io.IOException {
264     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
265         PARSER, input, extensionRegistry);
266   }
267 
parseDelimitedFrom( java.io.InputStream input)268   public static com.google.cloud.vision.v1.OutputConfig parseDelimitedFrom(
269       java.io.InputStream input) throws java.io.IOException {
270     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
271   }
272 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)273   public static com.google.cloud.vision.v1.OutputConfig parseDelimitedFrom(
274       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
275       throws java.io.IOException {
276     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
277         PARSER, input, extensionRegistry);
278   }
279 
parseFrom( com.google.protobuf.CodedInputStream input)280   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
281       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
282     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
283   }
284 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)285   public static com.google.cloud.vision.v1.OutputConfig parseFrom(
286       com.google.protobuf.CodedInputStream input,
287       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
288       throws java.io.IOException {
289     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
290         PARSER, input, extensionRegistry);
291   }
292 
293   @java.lang.Override
newBuilderForType()294   public Builder newBuilderForType() {
295     return newBuilder();
296   }
297 
newBuilder()298   public static Builder newBuilder() {
299     return DEFAULT_INSTANCE.toBuilder();
300   }
301 
newBuilder(com.google.cloud.vision.v1.OutputConfig prototype)302   public static Builder newBuilder(com.google.cloud.vision.v1.OutputConfig prototype) {
303     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
304   }
305 
306   @java.lang.Override
toBuilder()307   public Builder toBuilder() {
308     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
309   }
310 
311   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)312   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
313     Builder builder = new Builder(parent);
314     return builder;
315   }
316   /**
317    *
318    *
319    * <pre>
320    * The desired output location and metadata.
321    * </pre>
322    *
323    * Protobuf type {@code google.cloud.vision.v1.OutputConfig}
324    */
325   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
326       implements
327       // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.OutputConfig)
328       com.google.cloud.vision.v1.OutputConfigOrBuilder {
getDescriptor()329     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
330       return com.google.cloud.vision.v1.ImageAnnotatorProto
331           .internal_static_google_cloud_vision_v1_OutputConfig_descriptor;
332     }
333 
334     @java.lang.Override
335     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()336         internalGetFieldAccessorTable() {
337       return com.google.cloud.vision.v1.ImageAnnotatorProto
338           .internal_static_google_cloud_vision_v1_OutputConfig_fieldAccessorTable
339           .ensureFieldAccessorsInitialized(
340               com.google.cloud.vision.v1.OutputConfig.class,
341               com.google.cloud.vision.v1.OutputConfig.Builder.class);
342     }
343 
344     // Construct using com.google.cloud.vision.v1.OutputConfig.newBuilder()
Builder()345     private Builder() {}
346 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)347     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
348       super(parent);
349     }
350 
351     @java.lang.Override
clear()352     public Builder clear() {
353       super.clear();
354       bitField0_ = 0;
355       gcsDestination_ = null;
356       if (gcsDestinationBuilder_ != null) {
357         gcsDestinationBuilder_.dispose();
358         gcsDestinationBuilder_ = null;
359       }
360       batchSize_ = 0;
361       return this;
362     }
363 
364     @java.lang.Override
getDescriptorForType()365     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
366       return com.google.cloud.vision.v1.ImageAnnotatorProto
367           .internal_static_google_cloud_vision_v1_OutputConfig_descriptor;
368     }
369 
370     @java.lang.Override
getDefaultInstanceForType()371     public com.google.cloud.vision.v1.OutputConfig getDefaultInstanceForType() {
372       return com.google.cloud.vision.v1.OutputConfig.getDefaultInstance();
373     }
374 
375     @java.lang.Override
build()376     public com.google.cloud.vision.v1.OutputConfig build() {
377       com.google.cloud.vision.v1.OutputConfig result = buildPartial();
378       if (!result.isInitialized()) {
379         throw newUninitializedMessageException(result);
380       }
381       return result;
382     }
383 
384     @java.lang.Override
buildPartial()385     public com.google.cloud.vision.v1.OutputConfig buildPartial() {
386       com.google.cloud.vision.v1.OutputConfig result =
387           new com.google.cloud.vision.v1.OutputConfig(this);
388       if (bitField0_ != 0) {
389         buildPartial0(result);
390       }
391       onBuilt();
392       return result;
393     }
394 
buildPartial0(com.google.cloud.vision.v1.OutputConfig result)395     private void buildPartial0(com.google.cloud.vision.v1.OutputConfig result) {
396       int from_bitField0_ = bitField0_;
397       if (((from_bitField0_ & 0x00000001) != 0)) {
398         result.gcsDestination_ =
399             gcsDestinationBuilder_ == null ? gcsDestination_ : gcsDestinationBuilder_.build();
400       }
401       if (((from_bitField0_ & 0x00000002) != 0)) {
402         result.batchSize_ = batchSize_;
403       }
404     }
405 
406     @java.lang.Override
clone()407     public Builder clone() {
408       return super.clone();
409     }
410 
411     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)412     public Builder setField(
413         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
414       return super.setField(field, value);
415     }
416 
417     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)418     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
419       return super.clearField(field);
420     }
421 
422     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)423     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
424       return super.clearOneof(oneof);
425     }
426 
427     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)428     public Builder setRepeatedField(
429         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
430       return super.setRepeatedField(field, index, value);
431     }
432 
433     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)434     public Builder addRepeatedField(
435         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
436       return super.addRepeatedField(field, value);
437     }
438 
439     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)440     public Builder mergeFrom(com.google.protobuf.Message other) {
441       if (other instanceof com.google.cloud.vision.v1.OutputConfig) {
442         return mergeFrom((com.google.cloud.vision.v1.OutputConfig) other);
443       } else {
444         super.mergeFrom(other);
445         return this;
446       }
447     }
448 
mergeFrom(com.google.cloud.vision.v1.OutputConfig other)449     public Builder mergeFrom(com.google.cloud.vision.v1.OutputConfig other) {
450       if (other == com.google.cloud.vision.v1.OutputConfig.getDefaultInstance()) return this;
451       if (other.hasGcsDestination()) {
452         mergeGcsDestination(other.getGcsDestination());
453       }
454       if (other.getBatchSize() != 0) {
455         setBatchSize(other.getBatchSize());
456       }
457       this.mergeUnknownFields(other.getUnknownFields());
458       onChanged();
459       return this;
460     }
461 
462     @java.lang.Override
isInitialized()463     public final boolean isInitialized() {
464       return true;
465     }
466 
467     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)468     public Builder mergeFrom(
469         com.google.protobuf.CodedInputStream input,
470         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
471         throws java.io.IOException {
472       if (extensionRegistry == null) {
473         throw new java.lang.NullPointerException();
474       }
475       try {
476         boolean done = false;
477         while (!done) {
478           int tag = input.readTag();
479           switch (tag) {
480             case 0:
481               done = true;
482               break;
483             case 10:
484               {
485                 input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry);
486                 bitField0_ |= 0x00000001;
487                 break;
488               } // case 10
489             case 16:
490               {
491                 batchSize_ = input.readInt32();
492                 bitField0_ |= 0x00000002;
493                 break;
494               } // case 16
495             default:
496               {
497                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
498                   done = true; // was an endgroup tag
499                 }
500                 break;
501               } // default:
502           } // switch (tag)
503         } // while (!done)
504       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
505         throw e.unwrapIOException();
506       } finally {
507         onChanged();
508       } // finally
509       return this;
510     }
511 
512     private int bitField0_;
513 
514     private com.google.cloud.vision.v1.GcsDestination gcsDestination_;
515     private com.google.protobuf.SingleFieldBuilderV3<
516             com.google.cloud.vision.v1.GcsDestination,
517             com.google.cloud.vision.v1.GcsDestination.Builder,
518             com.google.cloud.vision.v1.GcsDestinationOrBuilder>
519         gcsDestinationBuilder_;
520     /**
521      *
522      *
523      * <pre>
524      * The Google Cloud Storage location to write the output(s) to.
525      * </pre>
526      *
527      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
528      *
529      * @return Whether the gcsDestination field is set.
530      */
hasGcsDestination()531     public boolean hasGcsDestination() {
532       return ((bitField0_ & 0x00000001) != 0);
533     }
534     /**
535      *
536      *
537      * <pre>
538      * The Google Cloud Storage location to write the output(s) to.
539      * </pre>
540      *
541      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
542      *
543      * @return The gcsDestination.
544      */
getGcsDestination()545     public com.google.cloud.vision.v1.GcsDestination getGcsDestination() {
546       if (gcsDestinationBuilder_ == null) {
547         return gcsDestination_ == null
548             ? com.google.cloud.vision.v1.GcsDestination.getDefaultInstance()
549             : gcsDestination_;
550       } else {
551         return gcsDestinationBuilder_.getMessage();
552       }
553     }
554     /**
555      *
556      *
557      * <pre>
558      * The Google Cloud Storage location to write the output(s) to.
559      * </pre>
560      *
561      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
562      */
setGcsDestination(com.google.cloud.vision.v1.GcsDestination value)563     public Builder setGcsDestination(com.google.cloud.vision.v1.GcsDestination value) {
564       if (gcsDestinationBuilder_ == null) {
565         if (value == null) {
566           throw new NullPointerException();
567         }
568         gcsDestination_ = value;
569       } else {
570         gcsDestinationBuilder_.setMessage(value);
571       }
572       bitField0_ |= 0x00000001;
573       onChanged();
574       return this;
575     }
576     /**
577      *
578      *
579      * <pre>
580      * The Google Cloud Storage location to write the output(s) to.
581      * </pre>
582      *
583      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
584      */
setGcsDestination( com.google.cloud.vision.v1.GcsDestination.Builder builderForValue)585     public Builder setGcsDestination(
586         com.google.cloud.vision.v1.GcsDestination.Builder builderForValue) {
587       if (gcsDestinationBuilder_ == null) {
588         gcsDestination_ = builderForValue.build();
589       } else {
590         gcsDestinationBuilder_.setMessage(builderForValue.build());
591       }
592       bitField0_ |= 0x00000001;
593       onChanged();
594       return this;
595     }
596     /**
597      *
598      *
599      * <pre>
600      * The Google Cloud Storage location to write the output(s) to.
601      * </pre>
602      *
603      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
604      */
mergeGcsDestination(com.google.cloud.vision.v1.GcsDestination value)605     public Builder mergeGcsDestination(com.google.cloud.vision.v1.GcsDestination value) {
606       if (gcsDestinationBuilder_ == null) {
607         if (((bitField0_ & 0x00000001) != 0)
608             && gcsDestination_ != null
609             && gcsDestination_ != com.google.cloud.vision.v1.GcsDestination.getDefaultInstance()) {
610           getGcsDestinationBuilder().mergeFrom(value);
611         } else {
612           gcsDestination_ = value;
613         }
614       } else {
615         gcsDestinationBuilder_.mergeFrom(value);
616       }
617       bitField0_ |= 0x00000001;
618       onChanged();
619       return this;
620     }
621     /**
622      *
623      *
624      * <pre>
625      * The Google Cloud Storage location to write the output(s) to.
626      * </pre>
627      *
628      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
629      */
clearGcsDestination()630     public Builder clearGcsDestination() {
631       bitField0_ = (bitField0_ & ~0x00000001);
632       gcsDestination_ = null;
633       if (gcsDestinationBuilder_ != null) {
634         gcsDestinationBuilder_.dispose();
635         gcsDestinationBuilder_ = null;
636       }
637       onChanged();
638       return this;
639     }
640     /**
641      *
642      *
643      * <pre>
644      * The Google Cloud Storage location to write the output(s) to.
645      * </pre>
646      *
647      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
648      */
getGcsDestinationBuilder()649     public com.google.cloud.vision.v1.GcsDestination.Builder getGcsDestinationBuilder() {
650       bitField0_ |= 0x00000001;
651       onChanged();
652       return getGcsDestinationFieldBuilder().getBuilder();
653     }
654     /**
655      *
656      *
657      * <pre>
658      * The Google Cloud Storage location to write the output(s) to.
659      * </pre>
660      *
661      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
662      */
getGcsDestinationOrBuilder()663     public com.google.cloud.vision.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() {
664       if (gcsDestinationBuilder_ != null) {
665         return gcsDestinationBuilder_.getMessageOrBuilder();
666       } else {
667         return gcsDestination_ == null
668             ? com.google.cloud.vision.v1.GcsDestination.getDefaultInstance()
669             : gcsDestination_;
670       }
671     }
672     /**
673      *
674      *
675      * <pre>
676      * The Google Cloud Storage location to write the output(s) to.
677      * </pre>
678      *
679      * <code>.google.cloud.vision.v1.GcsDestination gcs_destination = 1;</code>
680      */
681     private com.google.protobuf.SingleFieldBuilderV3<
682             com.google.cloud.vision.v1.GcsDestination,
683             com.google.cloud.vision.v1.GcsDestination.Builder,
684             com.google.cloud.vision.v1.GcsDestinationOrBuilder>
getGcsDestinationFieldBuilder()685         getGcsDestinationFieldBuilder() {
686       if (gcsDestinationBuilder_ == null) {
687         gcsDestinationBuilder_ =
688             new com.google.protobuf.SingleFieldBuilderV3<
689                 com.google.cloud.vision.v1.GcsDestination,
690                 com.google.cloud.vision.v1.GcsDestination.Builder,
691                 com.google.cloud.vision.v1.GcsDestinationOrBuilder>(
692                 getGcsDestination(), getParentForChildren(), isClean());
693         gcsDestination_ = null;
694       }
695       return gcsDestinationBuilder_;
696     }
697 
698     private int batchSize_;
699     /**
700      *
701      *
702      * <pre>
703      * The max number of response protos to put into each output JSON file on
704      * Google Cloud Storage.
705      * The valid range is [1, 100]. If not specified, the default value is 20.
706      * For example, for one pdf file with 100 pages, 100 response protos will
707      * be generated. If `batch_size` = 20, then 5 json files each
708      * containing 20 response protos will be written under the prefix
709      * `gcs_destination`.`uri`.
710      * Currently, batch_size only applies to GcsDestination, with potential future
711      * support for other output configurations.
712      * </pre>
713      *
714      * <code>int32 batch_size = 2;</code>
715      *
716      * @return The batchSize.
717      */
718     @java.lang.Override
getBatchSize()719     public int getBatchSize() {
720       return batchSize_;
721     }
722     /**
723      *
724      *
725      * <pre>
726      * The max number of response protos to put into each output JSON file on
727      * Google Cloud Storage.
728      * The valid range is [1, 100]. If not specified, the default value is 20.
729      * For example, for one pdf file with 100 pages, 100 response protos will
730      * be generated. If `batch_size` = 20, then 5 json files each
731      * containing 20 response protos will be written under the prefix
732      * `gcs_destination`.`uri`.
733      * Currently, batch_size only applies to GcsDestination, with potential future
734      * support for other output configurations.
735      * </pre>
736      *
737      * <code>int32 batch_size = 2;</code>
738      *
739      * @param value The batchSize to set.
740      * @return This builder for chaining.
741      */
setBatchSize(int value)742     public Builder setBatchSize(int value) {
743 
744       batchSize_ = value;
745       bitField0_ |= 0x00000002;
746       onChanged();
747       return this;
748     }
749     /**
750      *
751      *
752      * <pre>
753      * The max number of response protos to put into each output JSON file on
754      * Google Cloud Storage.
755      * The valid range is [1, 100]. If not specified, the default value is 20.
756      * For example, for one pdf file with 100 pages, 100 response protos will
757      * be generated. If `batch_size` = 20, then 5 json files each
758      * containing 20 response protos will be written under the prefix
759      * `gcs_destination`.`uri`.
760      * Currently, batch_size only applies to GcsDestination, with potential future
761      * support for other output configurations.
762      * </pre>
763      *
764      * <code>int32 batch_size = 2;</code>
765      *
766      * @return This builder for chaining.
767      */
clearBatchSize()768     public Builder clearBatchSize() {
769       bitField0_ = (bitField0_ & ~0x00000002);
770       batchSize_ = 0;
771       onChanged();
772       return this;
773     }
774 
775     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)776     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
777       return super.setUnknownFields(unknownFields);
778     }
779 
780     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)781     public final Builder mergeUnknownFields(
782         final com.google.protobuf.UnknownFieldSet unknownFields) {
783       return super.mergeUnknownFields(unknownFields);
784     }
785 
786     // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.OutputConfig)
787   }
788 
789   // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.OutputConfig)
790   private static final com.google.cloud.vision.v1.OutputConfig DEFAULT_INSTANCE;
791 
792   static {
793     DEFAULT_INSTANCE = new com.google.cloud.vision.v1.OutputConfig();
794   }
795 
getDefaultInstance()796   public static com.google.cloud.vision.v1.OutputConfig getDefaultInstance() {
797     return DEFAULT_INSTANCE;
798   }
799 
800   private static final com.google.protobuf.Parser<OutputConfig> PARSER =
801       new com.google.protobuf.AbstractParser<OutputConfig>() {
802         @java.lang.Override
803         public OutputConfig parsePartialFrom(
804             com.google.protobuf.CodedInputStream input,
805             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
806             throws com.google.protobuf.InvalidProtocolBufferException {
807           Builder builder = newBuilder();
808           try {
809             builder.mergeFrom(input, extensionRegistry);
810           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
811             throw e.setUnfinishedMessage(builder.buildPartial());
812           } catch (com.google.protobuf.UninitializedMessageException e) {
813             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
814           } catch (java.io.IOException e) {
815             throw new com.google.protobuf.InvalidProtocolBufferException(e)
816                 .setUnfinishedMessage(builder.buildPartial());
817           }
818           return builder.buildPartial();
819         }
820       };
821 
parser()822   public static com.google.protobuf.Parser<OutputConfig> parser() {
823     return PARSER;
824   }
825 
826   @java.lang.Override
getParserForType()827   public com.google.protobuf.Parser<OutputConfig> getParserForType() {
828     return PARSER;
829   }
830 
831   @java.lang.Override
getDefaultInstanceForType()832   public com.google.cloud.vision.v1.OutputConfig getDefaultInstanceForType() {
833     return DEFAULT_INSTANCE;
834   }
835 }
836