Class ImageContext.Builder

  • All Implemented Interfaces:
    ImageContextOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    ImageContext

    public static final class ImageContext.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
    implements ImageContextOrBuilder
     Image context and/or feature-specific parameters.
     
    Protobuf type google.cloud.vision.v1p1beta1.ImageContext
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • clear

        public ImageContext.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • getDefaultInstanceForType

        public ImageContext getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public ImageContext build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public ImageContext buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public ImageContext.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • setField

        public ImageContext.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                             Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • clearField

        public ImageContext.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • clearOneof

        public ImageContext.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • setRepeatedField

        public ImageContext.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     int index,
                                                     Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • addRepeatedField

        public ImageContext.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • mergeFrom

        public ImageContext.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ImageContext.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • mergeFrom

        public ImageContext.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ImageContext.Builder>
        Throws:
        IOException
      • hasLatLongRect

        public boolean hasLatLongRect()
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
        Specified by:
        hasLatLongRect in interface ImageContextOrBuilder
        Returns:
        Whether the latLongRect field is set.
      • getLatLongRect

        public LatLongRect getLatLongRect()
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
        Specified by:
        getLatLongRect in interface ImageContextOrBuilder
        Returns:
        The latLongRect.
      • setLatLongRect

        public ImageContext.Builder setLatLongRect​(LatLongRect value)
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
      • setLatLongRect

        public ImageContext.Builder setLatLongRect​(LatLongRect.Builder builderForValue)
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
      • mergeLatLongRect

        public ImageContext.Builder mergeLatLongRect​(LatLongRect value)
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
      • clearLatLongRect

        public ImageContext.Builder clearLatLongRect()
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
      • getLatLongRectBuilder

        public LatLongRect.Builder getLatLongRectBuilder()
         lat/long rectangle that specifies the location of the image.
         
        .google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;
      • getLanguageHintsList

        public com.google.protobuf.ProtocolStringList getLanguageHintsList()
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Specified by:
        getLanguageHintsList in interface ImageContextOrBuilder
        Returns:
        A list containing the languageHints.
      • getLanguageHintsCount

        public int getLanguageHintsCount()
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Specified by:
        getLanguageHintsCount in interface ImageContextOrBuilder
        Returns:
        The count of languageHints.
      • getLanguageHints

        public String getLanguageHints​(int 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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Specified by:
        getLanguageHints in interface ImageContextOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The languageHints at the given index.
      • getLanguageHintsBytes

        public com.google.protobuf.ByteString getLanguageHintsBytes​(int 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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Specified by:
        getLanguageHintsBytes in interface ImageContextOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the languageHints at the given index.
      • setLanguageHints

        public ImageContext.Builder setLanguageHints​(int index,
                                                     String value)
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Parameters:
        index - The index to set the value at.
        value - The languageHints to set.
        Returns:
        This builder for chaining.
      • addLanguageHints

        public ImageContext.Builder addLanguageHints​(String value)
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Parameters:
        value - The languageHints to add.
        Returns:
        This builder for chaining.
      • addAllLanguageHints

        public ImageContext.Builder addAllLanguageHints​(Iterable<String> values)
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Parameters:
        values - The languageHints to add.
        Returns:
        This builder for chaining.
      • clearLanguageHints

        public ImageContext.Builder clearLanguageHints()
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Returns:
        This builder for chaining.
      • addLanguageHintsBytes

        public ImageContext.Builder addLanguageHintsBytes​(com.google.protobuf.ByteString value)
         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](https://cloud.google.com/vision/docs/languages).
         
        repeated string language_hints = 2;
        Parameters:
        value - The bytes of the languageHints to add.
        Returns:
        This builder for chaining.
      • hasCropHintsParams

        public boolean hasCropHintsParams()
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
        Specified by:
        hasCropHintsParams in interface ImageContextOrBuilder
        Returns:
        Whether the cropHintsParams field is set.
      • getCropHintsParams

        public CropHintsParams getCropHintsParams()
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
        Specified by:
        getCropHintsParams in interface ImageContextOrBuilder
        Returns:
        The cropHintsParams.
      • setCropHintsParams

        public ImageContext.Builder setCropHintsParams​(CropHintsParams value)
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
      • setCropHintsParams

        public ImageContext.Builder setCropHintsParams​(CropHintsParams.Builder builderForValue)
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
      • mergeCropHintsParams

        public ImageContext.Builder mergeCropHintsParams​(CropHintsParams value)
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
      • clearCropHintsParams

        public ImageContext.Builder clearCropHintsParams()
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
      • getCropHintsParamsBuilder

        public CropHintsParams.Builder getCropHintsParamsBuilder()
         Parameters for crop hints annotation request.
         
        .google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;
      • hasWebDetectionParams

        public boolean hasWebDetectionParams()
         Parameters for web detection.
         
        .google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;
        Specified by:
        hasWebDetectionParams in interface ImageContextOrBuilder
        Returns:
        Whether the webDetectionParams field is set.
      • setWebDetectionParams

        public ImageContext.Builder setWebDetectionParams​(WebDetectionParams value)
         Parameters for web detection.
         
        .google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;
      • mergeWebDetectionParams

        public ImageContext.Builder mergeWebDetectionParams​(WebDetectionParams value)
         Parameters for web detection.
         
        .google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;
      • clearWebDetectionParams

        public ImageContext.Builder clearWebDetectionParams()
         Parameters for web detection.
         
        .google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;
      • getWebDetectionParamsBuilder

        public WebDetectionParams.Builder getWebDetectionParamsBuilder()
         Parameters for web detection.
         
        .google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;
      • hasTextDetectionParams

        public boolean hasTextDetectionParams()
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
        Specified by:
        hasTextDetectionParams in interface ImageContextOrBuilder
        Returns:
        Whether the textDetectionParams field is set.
      • getTextDetectionParams

        public TextDetectionParams getTextDetectionParams()
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
        Specified by:
        getTextDetectionParams in interface ImageContextOrBuilder
        Returns:
        The textDetectionParams.
      • setTextDetectionParams

        public ImageContext.Builder setTextDetectionParams​(TextDetectionParams value)
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
      • setTextDetectionParams

        public ImageContext.Builder setTextDetectionParams​(TextDetectionParams.Builder builderForValue)
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
      • mergeTextDetectionParams

        public ImageContext.Builder mergeTextDetectionParams​(TextDetectionParams value)
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
      • clearTextDetectionParams

        public ImageContext.Builder clearTextDetectionParams()
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
      • getTextDetectionParamsBuilder

        public TextDetectionParams.Builder getTextDetectionParamsBuilder()
         Parameters for text detection and document text detection.
         
        .google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;
      • setUnknownFields

        public final ImageContext.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>
      • mergeUnknownFields

        public final ImageContext.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ImageContext.Builder>