All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.vision.v1.ImageContext Maven / Gradle / Ivy

There is a newer version: 3.47.0
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/vision/v1/image_annotator.proto

package com.google.cloud.vision.v1;

/**
 * 
 * Image context and/or feature-specific parameters.
 * 
* * Protobuf type {@code google.cloud.vision.v1.ImageContext} */ public final class ImageContext extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.ImageContext) ImageContextOrBuilder { private static final long serialVersionUID = 0L; // Use ImageContext.newBuilder() to construct. private ImageContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private ImageContext() { languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ImageContext( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { com.google.cloud.vision.v1.LatLongRect.Builder subBuilder = null; if (latLongRect_ != null) { subBuilder = latLongRect_.toBuilder(); } latLongRect_ = input.readMessage(com.google.cloud.vision.v1.LatLongRect.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(latLongRect_); latLongRect_ = subBuilder.buildPartial(); } break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { languageHints_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000002; } languageHints_.add(s); break; } case 34: { com.google.cloud.vision.v1.CropHintsParams.Builder subBuilder = null; if (cropHintsParams_ != null) { subBuilder = cropHintsParams_.toBuilder(); } cropHintsParams_ = input.readMessage(com.google.cloud.vision.v1.CropHintsParams.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(cropHintsParams_); cropHintsParams_ = subBuilder.buildPartial(); } break; } case 50: { com.google.cloud.vision.v1.WebDetectionParams.Builder subBuilder = null; if (webDetectionParams_ != null) { subBuilder = webDetectionParams_.toBuilder(); } webDetectionParams_ = input.readMessage(com.google.cloud.vision.v1.WebDetectionParams.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(webDetectionParams_); webDetectionParams_ = subBuilder.buildPartial(); } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { languageHints_ = languageHints_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vision.v1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1_ImageContext_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.vision.v1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1_ImageContext_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.vision.v1.ImageContext.class, com.google.cloud.vision.v1.ImageContext.Builder.class); } private int bitField0_; public static final int LAT_LONG_RECT_FIELD_NUMBER = 1; private com.google.cloud.vision.v1.LatLongRect latLongRect_; /** *
   * lat/long rectangle that specifies the location of the image.
   * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public boolean hasLatLongRect() { return latLongRect_ != null; } /** *
   * lat/long rectangle that specifies the location of the image.
   * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public com.google.cloud.vision.v1.LatLongRect getLatLongRect() { return latLongRect_ == null ? com.google.cloud.vision.v1.LatLongRect.getDefaultInstance() : latLongRect_; } /** *
   * lat/long rectangle that specifies the location of the image.
   * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public com.google.cloud.vision.v1.LatLongRectOrBuilder getLatLongRectOrBuilder() { return getLatLongRect(); } public static final int LANGUAGE_HINTS_FIELD_NUMBER = 2; private com.google.protobuf.LazyStringList languageHints_; /** *
   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
   * yields the best results since it enables automatic language detection. For
   * languages based on the Latin alphabet, setting `language_hints` is not
   * needed. In rare cases, when the language of the text in the image is known,
   * setting a hint will help get better results (although it will be a
   * significant hindrance if the hint is wrong). Text detection returns an
   * error if one or more of the specified languages is not one of the
   * [supported languages](/vision/docs/languages).
   * 
* * repeated string language_hints = 2; */ public com.google.protobuf.ProtocolStringList getLanguageHintsList() { return languageHints_; } /** *
   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
   * yields the best results since it enables automatic language detection. For
   * languages based on the Latin alphabet, setting `language_hints` is not
   * needed. In rare cases, when the language of the text in the image is known,
   * setting a hint will help get better results (although it will be a
   * significant hindrance if the hint is wrong). Text detection returns an
   * error if one or more of the specified languages is not one of the
   * [supported languages](/vision/docs/languages).
   * 
* * repeated string language_hints = 2; */ public int getLanguageHintsCount() { return languageHints_.size(); } /** *
   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
   * yields the best results since it enables automatic language detection. For
   * languages based on the Latin alphabet, setting `language_hints` is not
   * needed. In rare cases, when the language of the text in the image is known,
   * setting a hint will help get better results (although it will be a
   * significant hindrance if the hint is wrong). Text detection returns an
   * error if one or more of the specified languages is not one of the
   * [supported languages](/vision/docs/languages).
   * 
* * repeated string language_hints = 2; */ public java.lang.String getLanguageHints(int index) { return languageHints_.get(index); } /** *
   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
   * yields the best results since it enables automatic language detection. For
   * languages based on the Latin alphabet, setting `language_hints` is not
   * needed. In rare cases, when the language of the text in the image is known,
   * setting a hint will help get better results (although it will be a
   * significant hindrance if the hint is wrong). Text detection returns an
   * error if one or more of the specified languages is not one of the
   * [supported languages](/vision/docs/languages).
   * 
* * repeated string language_hints = 2; */ public com.google.protobuf.ByteString getLanguageHintsBytes(int index) { return languageHints_.getByteString(index); } public static final int CROP_HINTS_PARAMS_FIELD_NUMBER = 4; private com.google.cloud.vision.v1.CropHintsParams cropHintsParams_; /** *
   * Parameters for crop hints annotation request.
   * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public boolean hasCropHintsParams() { return cropHintsParams_ != null; } /** *
   * Parameters for crop hints annotation request.
   * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public com.google.cloud.vision.v1.CropHintsParams getCropHintsParams() { return cropHintsParams_ == null ? com.google.cloud.vision.v1.CropHintsParams.getDefaultInstance() : cropHintsParams_; } /** *
   * Parameters for crop hints annotation request.
   * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public com.google.cloud.vision.v1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder() { return getCropHintsParams(); } public static final int WEB_DETECTION_PARAMS_FIELD_NUMBER = 6; private com.google.cloud.vision.v1.WebDetectionParams webDetectionParams_; /** *
   * Parameters for web detection.
   * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public boolean hasWebDetectionParams() { return webDetectionParams_ != null; } /** *
   * Parameters for web detection.
   * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public com.google.cloud.vision.v1.WebDetectionParams getWebDetectionParams() { return webDetectionParams_ == null ? com.google.cloud.vision.v1.WebDetectionParams.getDefaultInstance() : webDetectionParams_; } /** *
   * Parameters for web detection.
   * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public com.google.cloud.vision.v1.WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder() { return getWebDetectionParams(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (latLongRect_ != null) { output.writeMessage(1, getLatLongRect()); } for (int i = 0; i < languageHints_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageHints_.getRaw(i)); } if (cropHintsParams_ != null) { output.writeMessage(4, getCropHintsParams()); } if (webDetectionParams_ != null) { output.writeMessage(6, getWebDetectionParams()); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (latLongRect_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getLatLongRect()); } { int dataSize = 0; for (int i = 0; i < languageHints_.size(); i++) { dataSize += computeStringSizeNoTag(languageHints_.getRaw(i)); } size += dataSize; size += 1 * getLanguageHintsList().size(); } if (cropHintsParams_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getCropHintsParams()); } if (webDetectionParams_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, getWebDetectionParams()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.ImageContext)) { return super.equals(obj); } com.google.cloud.vision.v1.ImageContext other = (com.google.cloud.vision.v1.ImageContext) obj; boolean result = true; result = result && (hasLatLongRect() == other.hasLatLongRect()); if (hasLatLongRect()) { result = result && getLatLongRect() .equals(other.getLatLongRect()); } result = result && getLanguageHintsList() .equals(other.getLanguageHintsList()); result = result && (hasCropHintsParams() == other.hasCropHintsParams()); if (hasCropHintsParams()) { result = result && getCropHintsParams() .equals(other.getCropHintsParams()); } result = result && (hasWebDetectionParams() == other.hasWebDetectionParams()); if (hasWebDetectionParams()) { result = result && getWebDetectionParams() .equals(other.getWebDetectionParams()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasLatLongRect()) { hash = (37 * hash) + LAT_LONG_RECT_FIELD_NUMBER; hash = (53 * hash) + getLatLongRect().hashCode(); } if (getLanguageHintsCount() > 0) { hash = (37 * hash) + LANGUAGE_HINTS_FIELD_NUMBER; hash = (53 * hash) + getLanguageHintsList().hashCode(); } if (hasCropHintsParams()) { hash = (37 * hash) + CROP_HINTS_PARAMS_FIELD_NUMBER; hash = (53 * hash) + getCropHintsParams().hashCode(); } if (hasWebDetectionParams()) { hash = (37 * hash) + WEB_DETECTION_PARAMS_FIELD_NUMBER; hash = (53 * hash) + getWebDetectionParams().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.vision.v1.ImageContext parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.ImageContext parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.ImageContext parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.ImageContext parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.ImageContext parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.ImageContext parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.ImageContext parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.vision.v1.ImageContext parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.vision.v1.ImageContext parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.vision.v1.ImageContext parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.vision.v1.ImageContext parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.vision.v1.ImageContext parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.cloud.vision.v1.ImageContext prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * Image context and/or feature-specific parameters.
   * 
* * Protobuf type {@code google.cloud.vision.v1.ImageContext} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ImageContext) com.google.cloud.vision.v1.ImageContextOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vision.v1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1_ImageContext_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.vision.v1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1_ImageContext_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.vision.v1.ImageContext.class, com.google.cloud.vision.v1.ImageContext.Builder.class); } // Construct using com.google.cloud.vision.v1.ImageContext.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } public Builder clear() { super.clear(); if (latLongRectBuilder_ == null) { latLongRect_ = null; } else { latLongRect_ = null; latLongRectBuilder_ = null; } languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); if (cropHintsParamsBuilder_ == null) { cropHintsParams_ = null; } else { cropHintsParams_ = null; cropHintsParamsBuilder_ = null; } if (webDetectionParamsBuilder_ == null) { webDetectionParams_ = null; } else { webDetectionParams_ = null; webDetectionParamsBuilder_ = null; } return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.vision.v1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1_ImageContext_descriptor; } public com.google.cloud.vision.v1.ImageContext getDefaultInstanceForType() { return com.google.cloud.vision.v1.ImageContext.getDefaultInstance(); } public com.google.cloud.vision.v1.ImageContext build() { com.google.cloud.vision.v1.ImageContext result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.google.cloud.vision.v1.ImageContext buildPartial() { com.google.cloud.vision.v1.ImageContext result = new com.google.cloud.vision.v1.ImageContext(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (latLongRectBuilder_ == null) { result.latLongRect_ = latLongRect_; } else { result.latLongRect_ = latLongRectBuilder_.build(); } if (((bitField0_ & 0x00000002) == 0x00000002)) { languageHints_ = languageHints_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000002); } result.languageHints_ = languageHints_; if (cropHintsParamsBuilder_ == null) { result.cropHintsParams_ = cropHintsParams_; } else { result.cropHintsParams_ = cropHintsParamsBuilder_.build(); } if (webDetectionParamsBuilder_ == null) { result.webDetectionParams_ = webDetectionParams_; } else { result.webDetectionParams_ = webDetectionParamsBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.vision.v1.ImageContext) { return mergeFrom((com.google.cloud.vision.v1.ImageContext)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.vision.v1.ImageContext other) { if (other == com.google.cloud.vision.v1.ImageContext.getDefaultInstance()) return this; if (other.hasLatLongRect()) { mergeLatLongRect(other.getLatLongRect()); } if (!other.languageHints_.isEmpty()) { if (languageHints_.isEmpty()) { languageHints_ = other.languageHints_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureLanguageHintsIsMutable(); languageHints_.addAll(other.languageHints_); } onChanged(); } if (other.hasCropHintsParams()) { mergeCropHintsParams(other.getCropHintsParams()); } if (other.hasWebDetectionParams()) { mergeWebDetectionParams(other.getWebDetectionParams()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.vision.v1.ImageContext parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.vision.v1.ImageContext) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.google.cloud.vision.v1.LatLongRect latLongRect_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.LatLongRect, com.google.cloud.vision.v1.LatLongRect.Builder, com.google.cloud.vision.v1.LatLongRectOrBuilder> latLongRectBuilder_; /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public boolean hasLatLongRect() { return latLongRectBuilder_ != null || latLongRect_ != null; } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public com.google.cloud.vision.v1.LatLongRect getLatLongRect() { if (latLongRectBuilder_ == null) { return latLongRect_ == null ? com.google.cloud.vision.v1.LatLongRect.getDefaultInstance() : latLongRect_; } else { return latLongRectBuilder_.getMessage(); } } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public Builder setLatLongRect(com.google.cloud.vision.v1.LatLongRect value) { if (latLongRectBuilder_ == null) { if (value == null) { throw new NullPointerException(); } latLongRect_ = value; onChanged(); } else { latLongRectBuilder_.setMessage(value); } return this; } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public Builder setLatLongRect( com.google.cloud.vision.v1.LatLongRect.Builder builderForValue) { if (latLongRectBuilder_ == null) { latLongRect_ = builderForValue.build(); onChanged(); } else { latLongRectBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public Builder mergeLatLongRect(com.google.cloud.vision.v1.LatLongRect value) { if (latLongRectBuilder_ == null) { if (latLongRect_ != null) { latLongRect_ = com.google.cloud.vision.v1.LatLongRect.newBuilder(latLongRect_).mergeFrom(value).buildPartial(); } else { latLongRect_ = value; } onChanged(); } else { latLongRectBuilder_.mergeFrom(value); } return this; } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public Builder clearLatLongRect() { if (latLongRectBuilder_ == null) { latLongRect_ = null; onChanged(); } else { latLongRect_ = null; latLongRectBuilder_ = null; } return this; } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public com.google.cloud.vision.v1.LatLongRect.Builder getLatLongRectBuilder() { onChanged(); return getLatLongRectFieldBuilder().getBuilder(); } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ public com.google.cloud.vision.v1.LatLongRectOrBuilder getLatLongRectOrBuilder() { if (latLongRectBuilder_ != null) { return latLongRectBuilder_.getMessageOrBuilder(); } else { return latLongRect_ == null ? com.google.cloud.vision.v1.LatLongRect.getDefaultInstance() : latLongRect_; } } /** *
     * lat/long rectangle that specifies the location of the image.
     * 
* * .google.cloud.vision.v1.LatLongRect lat_long_rect = 1; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.LatLongRect, com.google.cloud.vision.v1.LatLongRect.Builder, com.google.cloud.vision.v1.LatLongRectOrBuilder> getLatLongRectFieldBuilder() { if (latLongRectBuilder_ == null) { latLongRectBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.LatLongRect, com.google.cloud.vision.v1.LatLongRect.Builder, com.google.cloud.vision.v1.LatLongRectOrBuilder>( getLatLongRect(), getParentForChildren(), isClean()); latLongRect_ = null; } return latLongRectBuilder_; } private com.google.protobuf.LazyStringList languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureLanguageHintsIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { languageHints_ = new com.google.protobuf.LazyStringArrayList(languageHints_); bitField0_ |= 0x00000002; } } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public com.google.protobuf.ProtocolStringList getLanguageHintsList() { return languageHints_.getUnmodifiableView(); } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public int getLanguageHintsCount() { return languageHints_.size(); } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public java.lang.String getLanguageHints(int index) { return languageHints_.get(index); } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public com.google.protobuf.ByteString getLanguageHintsBytes(int index) { return languageHints_.getByteString(index); } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public Builder setLanguageHints( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureLanguageHintsIsMutable(); languageHints_.set(index, value); onChanged(); return this; } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public Builder addLanguageHints( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureLanguageHintsIsMutable(); languageHints_.add(value); onChanged(); return this; } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public Builder addAllLanguageHints( java.lang.Iterable values) { ensureLanguageHintsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, languageHints_); onChanged(); return this; } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public Builder clearLanguageHints() { languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** *
     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
     * yields the best results since it enables automatic language detection. For
     * languages based on the Latin alphabet, setting `language_hints` is not
     * needed. In rare cases, when the language of the text in the image is known,
     * setting a hint will help get better results (although it will be a
     * significant hindrance if the hint is wrong). Text detection returns an
     * error if one or more of the specified languages is not one of the
     * [supported languages](/vision/docs/languages).
     * 
* * repeated string language_hints = 2; */ public Builder addLanguageHintsBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureLanguageHintsIsMutable(); languageHints_.add(value); onChanged(); return this; } private com.google.cloud.vision.v1.CropHintsParams cropHintsParams_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.CropHintsParams, com.google.cloud.vision.v1.CropHintsParams.Builder, com.google.cloud.vision.v1.CropHintsParamsOrBuilder> cropHintsParamsBuilder_; /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public boolean hasCropHintsParams() { return cropHintsParamsBuilder_ != null || cropHintsParams_ != null; } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public com.google.cloud.vision.v1.CropHintsParams getCropHintsParams() { if (cropHintsParamsBuilder_ == null) { return cropHintsParams_ == null ? com.google.cloud.vision.v1.CropHintsParams.getDefaultInstance() : cropHintsParams_; } else { return cropHintsParamsBuilder_.getMessage(); } } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public Builder setCropHintsParams(com.google.cloud.vision.v1.CropHintsParams value) { if (cropHintsParamsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } cropHintsParams_ = value; onChanged(); } else { cropHintsParamsBuilder_.setMessage(value); } return this; } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public Builder setCropHintsParams( com.google.cloud.vision.v1.CropHintsParams.Builder builderForValue) { if (cropHintsParamsBuilder_ == null) { cropHintsParams_ = builderForValue.build(); onChanged(); } else { cropHintsParamsBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public Builder mergeCropHintsParams(com.google.cloud.vision.v1.CropHintsParams value) { if (cropHintsParamsBuilder_ == null) { if (cropHintsParams_ != null) { cropHintsParams_ = com.google.cloud.vision.v1.CropHintsParams.newBuilder(cropHintsParams_).mergeFrom(value).buildPartial(); } else { cropHintsParams_ = value; } onChanged(); } else { cropHintsParamsBuilder_.mergeFrom(value); } return this; } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public Builder clearCropHintsParams() { if (cropHintsParamsBuilder_ == null) { cropHintsParams_ = null; onChanged(); } else { cropHintsParams_ = null; cropHintsParamsBuilder_ = null; } return this; } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public com.google.cloud.vision.v1.CropHintsParams.Builder getCropHintsParamsBuilder() { onChanged(); return getCropHintsParamsFieldBuilder().getBuilder(); } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ public com.google.cloud.vision.v1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder() { if (cropHintsParamsBuilder_ != null) { return cropHintsParamsBuilder_.getMessageOrBuilder(); } else { return cropHintsParams_ == null ? com.google.cloud.vision.v1.CropHintsParams.getDefaultInstance() : cropHintsParams_; } } /** *
     * Parameters for crop hints annotation request.
     * 
* * .google.cloud.vision.v1.CropHintsParams crop_hints_params = 4; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.CropHintsParams, com.google.cloud.vision.v1.CropHintsParams.Builder, com.google.cloud.vision.v1.CropHintsParamsOrBuilder> getCropHintsParamsFieldBuilder() { if (cropHintsParamsBuilder_ == null) { cropHintsParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.CropHintsParams, com.google.cloud.vision.v1.CropHintsParams.Builder, com.google.cloud.vision.v1.CropHintsParamsOrBuilder>( getCropHintsParams(), getParentForChildren(), isClean()); cropHintsParams_ = null; } return cropHintsParamsBuilder_; } private com.google.cloud.vision.v1.WebDetectionParams webDetectionParams_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.WebDetectionParams, com.google.cloud.vision.v1.WebDetectionParams.Builder, com.google.cloud.vision.v1.WebDetectionParamsOrBuilder> webDetectionParamsBuilder_; /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public boolean hasWebDetectionParams() { return webDetectionParamsBuilder_ != null || webDetectionParams_ != null; } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public com.google.cloud.vision.v1.WebDetectionParams getWebDetectionParams() { if (webDetectionParamsBuilder_ == null) { return webDetectionParams_ == null ? com.google.cloud.vision.v1.WebDetectionParams.getDefaultInstance() : webDetectionParams_; } else { return webDetectionParamsBuilder_.getMessage(); } } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public Builder setWebDetectionParams(com.google.cloud.vision.v1.WebDetectionParams value) { if (webDetectionParamsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } webDetectionParams_ = value; onChanged(); } else { webDetectionParamsBuilder_.setMessage(value); } return this; } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public Builder setWebDetectionParams( com.google.cloud.vision.v1.WebDetectionParams.Builder builderForValue) { if (webDetectionParamsBuilder_ == null) { webDetectionParams_ = builderForValue.build(); onChanged(); } else { webDetectionParamsBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public Builder mergeWebDetectionParams(com.google.cloud.vision.v1.WebDetectionParams value) { if (webDetectionParamsBuilder_ == null) { if (webDetectionParams_ != null) { webDetectionParams_ = com.google.cloud.vision.v1.WebDetectionParams.newBuilder(webDetectionParams_).mergeFrom(value).buildPartial(); } else { webDetectionParams_ = value; } onChanged(); } else { webDetectionParamsBuilder_.mergeFrom(value); } return this; } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public Builder clearWebDetectionParams() { if (webDetectionParamsBuilder_ == null) { webDetectionParams_ = null; onChanged(); } else { webDetectionParams_ = null; webDetectionParamsBuilder_ = null; } return this; } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public com.google.cloud.vision.v1.WebDetectionParams.Builder getWebDetectionParamsBuilder() { onChanged(); return getWebDetectionParamsFieldBuilder().getBuilder(); } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ public com.google.cloud.vision.v1.WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder() { if (webDetectionParamsBuilder_ != null) { return webDetectionParamsBuilder_.getMessageOrBuilder(); } else { return webDetectionParams_ == null ? com.google.cloud.vision.v1.WebDetectionParams.getDefaultInstance() : webDetectionParams_; } } /** *
     * Parameters for web detection.
     * 
* * .google.cloud.vision.v1.WebDetectionParams web_detection_params = 6; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.WebDetectionParams, com.google.cloud.vision.v1.WebDetectionParams.Builder, com.google.cloud.vision.v1.WebDetectionParamsOrBuilder> getWebDetectionParamsFieldBuilder() { if (webDetectionParamsBuilder_ == null) { webDetectionParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.WebDetectionParams, com.google.cloud.vision.v1.WebDetectionParams.Builder, com.google.cloud.vision.v1.WebDetectionParamsOrBuilder>( getWebDetectionParams(), getParentForChildren(), isClean()); webDetectionParams_ = null; } return webDetectionParamsBuilder_; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.ImageContext) } // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImageContext) private static final com.google.cloud.vision.v1.ImageContext DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ImageContext(); } public static com.google.cloud.vision.v1.ImageContext getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { public ImageContext parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ImageContext(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } public com.google.cloud.vision.v1.ImageContext getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy