• 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  * Parameters for crop hints annotation request.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.vision.v1.CropHintsParams}
29  */
30 public final class CropHintsParams extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.CropHintsParams)
33     CropHintsParamsOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use CropHintsParams.newBuilder() to construct.
CropHintsParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private CropHintsParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
CropHintsParams()40   private CropHintsParams() {
41     aspectRatios_ = emptyFloatList();
42   }
43 
44   @java.lang.Override
45   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)46   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47     return new CropHintsParams();
48   }
49 
50   @java.lang.Override
getUnknownFields()51   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
52     return this.unknownFields;
53   }
54 
getDescriptor()55   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
56     return com.google.cloud.vision.v1.ImageAnnotatorProto
57         .internal_static_google_cloud_vision_v1_CropHintsParams_descriptor;
58   }
59 
60   @java.lang.Override
61   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()62       internalGetFieldAccessorTable() {
63     return com.google.cloud.vision.v1.ImageAnnotatorProto
64         .internal_static_google_cloud_vision_v1_CropHintsParams_fieldAccessorTable
65         .ensureFieldAccessorsInitialized(
66             com.google.cloud.vision.v1.CropHintsParams.class,
67             com.google.cloud.vision.v1.CropHintsParams.Builder.class);
68   }
69 
70   public static final int ASPECT_RATIOS_FIELD_NUMBER = 1;
71 
72   @SuppressWarnings("serial")
73   private com.google.protobuf.Internal.FloatList aspectRatios_;
74   /**
75    *
76    *
77    * <pre>
78    * Aspect ratios in floats, representing the ratio of the width to the height
79    * of the image. For example, if the desired aspect ratio is 4/3, the
80    * corresponding float value should be 1.33333.  If not specified, the
81    * best possible crop is returned. The number of provided aspect ratios is
82    * limited to a maximum of 16; any aspect ratios provided after the 16th are
83    * ignored.
84    * </pre>
85    *
86    * <code>repeated float aspect_ratios = 1;</code>
87    *
88    * @return A list containing the aspectRatios.
89    */
90   @java.lang.Override
getAspectRatiosList()91   public java.util.List<java.lang.Float> getAspectRatiosList() {
92     return aspectRatios_;
93   }
94   /**
95    *
96    *
97    * <pre>
98    * Aspect ratios in floats, representing the ratio of the width to the height
99    * of the image. For example, if the desired aspect ratio is 4/3, the
100    * corresponding float value should be 1.33333.  If not specified, the
101    * best possible crop is returned. The number of provided aspect ratios is
102    * limited to a maximum of 16; any aspect ratios provided after the 16th are
103    * ignored.
104    * </pre>
105    *
106    * <code>repeated float aspect_ratios = 1;</code>
107    *
108    * @return The count of aspectRatios.
109    */
getAspectRatiosCount()110   public int getAspectRatiosCount() {
111     return aspectRatios_.size();
112   }
113   /**
114    *
115    *
116    * <pre>
117    * Aspect ratios in floats, representing the ratio of the width to the height
118    * of the image. For example, if the desired aspect ratio is 4/3, the
119    * corresponding float value should be 1.33333.  If not specified, the
120    * best possible crop is returned. The number of provided aspect ratios is
121    * limited to a maximum of 16; any aspect ratios provided after the 16th are
122    * ignored.
123    * </pre>
124    *
125    * <code>repeated float aspect_ratios = 1;</code>
126    *
127    * @param index The index of the element to return.
128    * @return The aspectRatios at the given index.
129    */
getAspectRatios(int index)130   public float getAspectRatios(int index) {
131     return aspectRatios_.getFloat(index);
132   }
133 
134   private int aspectRatiosMemoizedSerializedSize = -1;
135 
136   private byte memoizedIsInitialized = -1;
137 
138   @java.lang.Override
isInitialized()139   public final boolean isInitialized() {
140     byte isInitialized = memoizedIsInitialized;
141     if (isInitialized == 1) return true;
142     if (isInitialized == 0) return false;
143 
144     memoizedIsInitialized = 1;
145     return true;
146   }
147 
148   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)149   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
150     getSerializedSize();
151     if (getAspectRatiosList().size() > 0) {
152       output.writeUInt32NoTag(10);
153       output.writeUInt32NoTag(aspectRatiosMemoizedSerializedSize);
154     }
155     for (int i = 0; i < aspectRatios_.size(); i++) {
156       output.writeFloatNoTag(aspectRatios_.getFloat(i));
157     }
158     getUnknownFields().writeTo(output);
159   }
160 
161   @java.lang.Override
getSerializedSize()162   public int getSerializedSize() {
163     int size = memoizedSize;
164     if (size != -1) return size;
165 
166     size = 0;
167     {
168       int dataSize = 0;
169       dataSize = 4 * getAspectRatiosList().size();
170       size += dataSize;
171       if (!getAspectRatiosList().isEmpty()) {
172         size += 1;
173         size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
174       }
175       aspectRatiosMemoizedSerializedSize = dataSize;
176     }
177     size += getUnknownFields().getSerializedSize();
178     memoizedSize = size;
179     return size;
180   }
181 
182   @java.lang.Override
equals(final java.lang.Object obj)183   public boolean equals(final java.lang.Object obj) {
184     if (obj == this) {
185       return true;
186     }
187     if (!(obj instanceof com.google.cloud.vision.v1.CropHintsParams)) {
188       return super.equals(obj);
189     }
190     com.google.cloud.vision.v1.CropHintsParams other =
191         (com.google.cloud.vision.v1.CropHintsParams) obj;
192 
193     if (!getAspectRatiosList().equals(other.getAspectRatiosList())) return false;
194     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
195     return true;
196   }
197 
198   @java.lang.Override
hashCode()199   public int hashCode() {
200     if (memoizedHashCode != 0) {
201       return memoizedHashCode;
202     }
203     int hash = 41;
204     hash = (19 * hash) + getDescriptor().hashCode();
205     if (getAspectRatiosCount() > 0) {
206       hash = (37 * hash) + ASPECT_RATIOS_FIELD_NUMBER;
207       hash = (53 * hash) + getAspectRatiosList().hashCode();
208     }
209     hash = (29 * hash) + getUnknownFields().hashCode();
210     memoizedHashCode = hash;
211     return hash;
212   }
213 
parseFrom(java.nio.ByteBuffer data)214   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(java.nio.ByteBuffer data)
215       throws com.google.protobuf.InvalidProtocolBufferException {
216     return PARSER.parseFrom(data);
217   }
218 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)219   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
220       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
221       throws com.google.protobuf.InvalidProtocolBufferException {
222     return PARSER.parseFrom(data, extensionRegistry);
223   }
224 
parseFrom( com.google.protobuf.ByteString data)225   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
226       com.google.protobuf.ByteString data)
227       throws com.google.protobuf.InvalidProtocolBufferException {
228     return PARSER.parseFrom(data);
229   }
230 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)231   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
232       com.google.protobuf.ByteString data,
233       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
234       throws com.google.protobuf.InvalidProtocolBufferException {
235     return PARSER.parseFrom(data, extensionRegistry);
236   }
237 
parseFrom(byte[] data)238   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(byte[] data)
239       throws com.google.protobuf.InvalidProtocolBufferException {
240     return PARSER.parseFrom(data);
241   }
242 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)243   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
244       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
245       throws com.google.protobuf.InvalidProtocolBufferException {
246     return PARSER.parseFrom(data, extensionRegistry);
247   }
248 
parseFrom(java.io.InputStream input)249   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(java.io.InputStream input)
250       throws java.io.IOException {
251     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
252   }
253 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)254   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
255       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
256       throws java.io.IOException {
257     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
258         PARSER, input, extensionRegistry);
259   }
260 
parseDelimitedFrom( java.io.InputStream input)261   public static com.google.cloud.vision.v1.CropHintsParams parseDelimitedFrom(
262       java.io.InputStream input) throws java.io.IOException {
263     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
264   }
265 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)266   public static com.google.cloud.vision.v1.CropHintsParams parseDelimitedFrom(
267       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
268       throws java.io.IOException {
269     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
270         PARSER, input, extensionRegistry);
271   }
272 
parseFrom( com.google.protobuf.CodedInputStream input)273   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
274       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
275     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
276   }
277 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)278   public static com.google.cloud.vision.v1.CropHintsParams parseFrom(
279       com.google.protobuf.CodedInputStream input,
280       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
281       throws java.io.IOException {
282     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
283         PARSER, input, extensionRegistry);
284   }
285 
286   @java.lang.Override
newBuilderForType()287   public Builder newBuilderForType() {
288     return newBuilder();
289   }
290 
newBuilder()291   public static Builder newBuilder() {
292     return DEFAULT_INSTANCE.toBuilder();
293   }
294 
newBuilder(com.google.cloud.vision.v1.CropHintsParams prototype)295   public static Builder newBuilder(com.google.cloud.vision.v1.CropHintsParams prototype) {
296     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
297   }
298 
299   @java.lang.Override
toBuilder()300   public Builder toBuilder() {
301     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
302   }
303 
304   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)305   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
306     Builder builder = new Builder(parent);
307     return builder;
308   }
309   /**
310    *
311    *
312    * <pre>
313    * Parameters for crop hints annotation request.
314    * </pre>
315    *
316    * Protobuf type {@code google.cloud.vision.v1.CropHintsParams}
317    */
318   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
319       implements
320       // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.CropHintsParams)
321       com.google.cloud.vision.v1.CropHintsParamsOrBuilder {
getDescriptor()322     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
323       return com.google.cloud.vision.v1.ImageAnnotatorProto
324           .internal_static_google_cloud_vision_v1_CropHintsParams_descriptor;
325     }
326 
327     @java.lang.Override
328     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()329         internalGetFieldAccessorTable() {
330       return com.google.cloud.vision.v1.ImageAnnotatorProto
331           .internal_static_google_cloud_vision_v1_CropHintsParams_fieldAccessorTable
332           .ensureFieldAccessorsInitialized(
333               com.google.cloud.vision.v1.CropHintsParams.class,
334               com.google.cloud.vision.v1.CropHintsParams.Builder.class);
335     }
336 
337     // Construct using com.google.cloud.vision.v1.CropHintsParams.newBuilder()
Builder()338     private Builder() {}
339 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)340     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
341       super(parent);
342     }
343 
344     @java.lang.Override
clear()345     public Builder clear() {
346       super.clear();
347       bitField0_ = 0;
348       aspectRatios_ = emptyFloatList();
349       return this;
350     }
351 
352     @java.lang.Override
getDescriptorForType()353     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
354       return com.google.cloud.vision.v1.ImageAnnotatorProto
355           .internal_static_google_cloud_vision_v1_CropHintsParams_descriptor;
356     }
357 
358     @java.lang.Override
getDefaultInstanceForType()359     public com.google.cloud.vision.v1.CropHintsParams getDefaultInstanceForType() {
360       return com.google.cloud.vision.v1.CropHintsParams.getDefaultInstance();
361     }
362 
363     @java.lang.Override
build()364     public com.google.cloud.vision.v1.CropHintsParams build() {
365       com.google.cloud.vision.v1.CropHintsParams result = buildPartial();
366       if (!result.isInitialized()) {
367         throw newUninitializedMessageException(result);
368       }
369       return result;
370     }
371 
372     @java.lang.Override
buildPartial()373     public com.google.cloud.vision.v1.CropHintsParams buildPartial() {
374       com.google.cloud.vision.v1.CropHintsParams result =
375           new com.google.cloud.vision.v1.CropHintsParams(this);
376       buildPartialRepeatedFields(result);
377       if (bitField0_ != 0) {
378         buildPartial0(result);
379       }
380       onBuilt();
381       return result;
382     }
383 
buildPartialRepeatedFields(com.google.cloud.vision.v1.CropHintsParams result)384     private void buildPartialRepeatedFields(com.google.cloud.vision.v1.CropHintsParams result) {
385       if (((bitField0_ & 0x00000001) != 0)) {
386         aspectRatios_.makeImmutable();
387         bitField0_ = (bitField0_ & ~0x00000001);
388       }
389       result.aspectRatios_ = aspectRatios_;
390     }
391 
buildPartial0(com.google.cloud.vision.v1.CropHintsParams result)392     private void buildPartial0(com.google.cloud.vision.v1.CropHintsParams result) {
393       int from_bitField0_ = bitField0_;
394     }
395 
396     @java.lang.Override
clone()397     public Builder clone() {
398       return super.clone();
399     }
400 
401     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)402     public Builder setField(
403         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
404       return super.setField(field, value);
405     }
406 
407     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)408     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
409       return super.clearField(field);
410     }
411 
412     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)413     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
414       return super.clearOneof(oneof);
415     }
416 
417     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)418     public Builder setRepeatedField(
419         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
420       return super.setRepeatedField(field, index, value);
421     }
422 
423     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)424     public Builder addRepeatedField(
425         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
426       return super.addRepeatedField(field, value);
427     }
428 
429     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)430     public Builder mergeFrom(com.google.protobuf.Message other) {
431       if (other instanceof com.google.cloud.vision.v1.CropHintsParams) {
432         return mergeFrom((com.google.cloud.vision.v1.CropHintsParams) other);
433       } else {
434         super.mergeFrom(other);
435         return this;
436       }
437     }
438 
mergeFrom(com.google.cloud.vision.v1.CropHintsParams other)439     public Builder mergeFrom(com.google.cloud.vision.v1.CropHintsParams other) {
440       if (other == com.google.cloud.vision.v1.CropHintsParams.getDefaultInstance()) return this;
441       if (!other.aspectRatios_.isEmpty()) {
442         if (aspectRatios_.isEmpty()) {
443           aspectRatios_ = other.aspectRatios_;
444           bitField0_ = (bitField0_ & ~0x00000001);
445         } else {
446           ensureAspectRatiosIsMutable();
447           aspectRatios_.addAll(other.aspectRatios_);
448         }
449         onChanged();
450       }
451       this.mergeUnknownFields(other.getUnknownFields());
452       onChanged();
453       return this;
454     }
455 
456     @java.lang.Override
isInitialized()457     public final boolean isInitialized() {
458       return true;
459     }
460 
461     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)462     public Builder mergeFrom(
463         com.google.protobuf.CodedInputStream input,
464         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
465         throws java.io.IOException {
466       if (extensionRegistry == null) {
467         throw new java.lang.NullPointerException();
468       }
469       try {
470         boolean done = false;
471         while (!done) {
472           int tag = input.readTag();
473           switch (tag) {
474             case 0:
475               done = true;
476               break;
477             case 13:
478               {
479                 float v = input.readFloat();
480                 ensureAspectRatiosIsMutable();
481                 aspectRatios_.addFloat(v);
482                 break;
483               } // case 13
484             case 10:
485               {
486                 int length = input.readRawVarint32();
487                 int limit = input.pushLimit(length);
488                 ensureAspectRatiosIsMutable();
489                 while (input.getBytesUntilLimit() > 0) {
490                   aspectRatios_.addFloat(input.readFloat());
491                 }
492                 input.popLimit(limit);
493                 break;
494               } // case 10
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.protobuf.Internal.FloatList aspectRatios_ = emptyFloatList();
515 
ensureAspectRatiosIsMutable()516     private void ensureAspectRatiosIsMutable() {
517       if (!((bitField0_ & 0x00000001) != 0)) {
518         aspectRatios_ = mutableCopy(aspectRatios_);
519         bitField0_ |= 0x00000001;
520       }
521     }
522     /**
523      *
524      *
525      * <pre>
526      * Aspect ratios in floats, representing the ratio of the width to the height
527      * of the image. For example, if the desired aspect ratio is 4/3, the
528      * corresponding float value should be 1.33333.  If not specified, the
529      * best possible crop is returned. The number of provided aspect ratios is
530      * limited to a maximum of 16; any aspect ratios provided after the 16th are
531      * ignored.
532      * </pre>
533      *
534      * <code>repeated float aspect_ratios = 1;</code>
535      *
536      * @return A list containing the aspectRatios.
537      */
getAspectRatiosList()538     public java.util.List<java.lang.Float> getAspectRatiosList() {
539       return ((bitField0_ & 0x00000001) != 0)
540           ? java.util.Collections.unmodifiableList(aspectRatios_)
541           : aspectRatios_;
542     }
543     /**
544      *
545      *
546      * <pre>
547      * Aspect ratios in floats, representing the ratio of the width to the height
548      * of the image. For example, if the desired aspect ratio is 4/3, the
549      * corresponding float value should be 1.33333.  If not specified, the
550      * best possible crop is returned. The number of provided aspect ratios is
551      * limited to a maximum of 16; any aspect ratios provided after the 16th are
552      * ignored.
553      * </pre>
554      *
555      * <code>repeated float aspect_ratios = 1;</code>
556      *
557      * @return The count of aspectRatios.
558      */
getAspectRatiosCount()559     public int getAspectRatiosCount() {
560       return aspectRatios_.size();
561     }
562     /**
563      *
564      *
565      * <pre>
566      * Aspect ratios in floats, representing the ratio of the width to the height
567      * of the image. For example, if the desired aspect ratio is 4/3, the
568      * corresponding float value should be 1.33333.  If not specified, the
569      * best possible crop is returned. The number of provided aspect ratios is
570      * limited to a maximum of 16; any aspect ratios provided after the 16th are
571      * ignored.
572      * </pre>
573      *
574      * <code>repeated float aspect_ratios = 1;</code>
575      *
576      * @param index The index of the element to return.
577      * @return The aspectRatios at the given index.
578      */
getAspectRatios(int index)579     public float getAspectRatios(int index) {
580       return aspectRatios_.getFloat(index);
581     }
582     /**
583      *
584      *
585      * <pre>
586      * Aspect ratios in floats, representing the ratio of the width to the height
587      * of the image. For example, if the desired aspect ratio is 4/3, the
588      * corresponding float value should be 1.33333.  If not specified, the
589      * best possible crop is returned. The number of provided aspect ratios is
590      * limited to a maximum of 16; any aspect ratios provided after the 16th are
591      * ignored.
592      * </pre>
593      *
594      * <code>repeated float aspect_ratios = 1;</code>
595      *
596      * @param index The index to set the value at.
597      * @param value The aspectRatios to set.
598      * @return This builder for chaining.
599      */
setAspectRatios(int index, float value)600     public Builder setAspectRatios(int index, float value) {
601 
602       ensureAspectRatiosIsMutable();
603       aspectRatios_.setFloat(index, value);
604       onChanged();
605       return this;
606     }
607     /**
608      *
609      *
610      * <pre>
611      * Aspect ratios in floats, representing the ratio of the width to the height
612      * of the image. For example, if the desired aspect ratio is 4/3, the
613      * corresponding float value should be 1.33333.  If not specified, the
614      * best possible crop is returned. The number of provided aspect ratios is
615      * limited to a maximum of 16; any aspect ratios provided after the 16th are
616      * ignored.
617      * </pre>
618      *
619      * <code>repeated float aspect_ratios = 1;</code>
620      *
621      * @param value The aspectRatios to add.
622      * @return This builder for chaining.
623      */
addAspectRatios(float value)624     public Builder addAspectRatios(float value) {
625 
626       ensureAspectRatiosIsMutable();
627       aspectRatios_.addFloat(value);
628       onChanged();
629       return this;
630     }
631     /**
632      *
633      *
634      * <pre>
635      * Aspect ratios in floats, representing the ratio of the width to the height
636      * of the image. For example, if the desired aspect ratio is 4/3, the
637      * corresponding float value should be 1.33333.  If not specified, the
638      * best possible crop is returned. The number of provided aspect ratios is
639      * limited to a maximum of 16; any aspect ratios provided after the 16th are
640      * ignored.
641      * </pre>
642      *
643      * <code>repeated float aspect_ratios = 1;</code>
644      *
645      * @param values The aspectRatios to add.
646      * @return This builder for chaining.
647      */
addAllAspectRatios(java.lang.Iterable<? extends java.lang.Float> values)648     public Builder addAllAspectRatios(java.lang.Iterable<? extends java.lang.Float> values) {
649       ensureAspectRatiosIsMutable();
650       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aspectRatios_);
651       onChanged();
652       return this;
653     }
654     /**
655      *
656      *
657      * <pre>
658      * Aspect ratios in floats, representing the ratio of the width to the height
659      * of the image. For example, if the desired aspect ratio is 4/3, the
660      * corresponding float value should be 1.33333.  If not specified, the
661      * best possible crop is returned. The number of provided aspect ratios is
662      * limited to a maximum of 16; any aspect ratios provided after the 16th are
663      * ignored.
664      * </pre>
665      *
666      * <code>repeated float aspect_ratios = 1;</code>
667      *
668      * @return This builder for chaining.
669      */
clearAspectRatios()670     public Builder clearAspectRatios() {
671       aspectRatios_ = emptyFloatList();
672       bitField0_ = (bitField0_ & ~0x00000001);
673       onChanged();
674       return this;
675     }
676 
677     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)678     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
679       return super.setUnknownFields(unknownFields);
680     }
681 
682     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)683     public final Builder mergeUnknownFields(
684         final com.google.protobuf.UnknownFieldSet unknownFields) {
685       return super.mergeUnknownFields(unknownFields);
686     }
687 
688     // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.CropHintsParams)
689   }
690 
691   // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CropHintsParams)
692   private static final com.google.cloud.vision.v1.CropHintsParams DEFAULT_INSTANCE;
693 
694   static {
695     DEFAULT_INSTANCE = new com.google.cloud.vision.v1.CropHintsParams();
696   }
697 
getDefaultInstance()698   public static com.google.cloud.vision.v1.CropHintsParams getDefaultInstance() {
699     return DEFAULT_INSTANCE;
700   }
701 
702   private static final com.google.protobuf.Parser<CropHintsParams> PARSER =
703       new com.google.protobuf.AbstractParser<CropHintsParams>() {
704         @java.lang.Override
705         public CropHintsParams parsePartialFrom(
706             com.google.protobuf.CodedInputStream input,
707             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
708             throws com.google.protobuf.InvalidProtocolBufferException {
709           Builder builder = newBuilder();
710           try {
711             builder.mergeFrom(input, extensionRegistry);
712           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
713             throw e.setUnfinishedMessage(builder.buildPartial());
714           } catch (com.google.protobuf.UninitializedMessageException e) {
715             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
716           } catch (java.io.IOException e) {
717             throw new com.google.protobuf.InvalidProtocolBufferException(e)
718                 .setUnfinishedMessage(builder.buildPartial());
719           }
720           return builder.buildPartial();
721         }
722       };
723 
parser()724   public static com.google.protobuf.Parser<CropHintsParams> parser() {
725     return PARSER;
726   }
727 
728   @java.lang.Override
getParserForType()729   public com.google.protobuf.Parser<CropHintsParams> getParserForType() {
730     return PARSER;
731   }
732 
733   @java.lang.Override
getDefaultInstanceForType()734   public com.google.cloud.vision.v1.CropHintsParams getDefaultInstanceForType() {
735     return DEFAULT_INSTANCE;
736   }
737 }
738