Class ReferenceImage.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ReferenceImage.Builder>
com.google.cloud.vision.v1.ReferenceImage.Builder
All Implemented Interfaces:
ReferenceImageOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ReferenceImage

public static final class ReferenceImage.Builder extends com.google.protobuf.GeneratedMessage.Builder<ReferenceImage.Builder> implements ReferenceImageOrBuilder
 A `ReferenceImage` represents a product image and its associated metadata,
 such as bounding boxes.
 
Protobuf type google.cloud.vision.v1.ReferenceImage
  • Method Details

    • getDescriptor

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

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

      public ReferenceImage.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.GeneratedMessage.Builder<ReferenceImage.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.GeneratedMessage.Builder<ReferenceImage.Builder>
    • getDefaultInstanceForType

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

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

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

      public ReferenceImage.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<ReferenceImage.Builder>
    • mergeFrom

      public ReferenceImage.Builder mergeFrom(ReferenceImage other)
    • isInitialized

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

      public ReferenceImage.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<ReferenceImage.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       The resource name of the reference image.
      
       Format is:
       `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
      
       This field is ignored when creating a reference image.
       
      string name = 1;
      Specified by:
      getName in interface ReferenceImageOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The resource name of the reference image.
      
       Format is:
       `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
      
       This field is ignored when creating a reference image.
       
      string name = 1;
      Specified by:
      getNameBytes in interface ReferenceImageOrBuilder
      Returns:
      The bytes for name.
    • setName

      public ReferenceImage.Builder setName(String value)
       The resource name of the reference image.
      
       Format is:
       `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
      
       This field is ignored when creating a reference image.
       
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public ReferenceImage.Builder clearName()
       The resource name of the reference image.
      
       Format is:
       `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
      
       This field is ignored when creating a reference image.
       
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public ReferenceImage.Builder setNameBytes(com.google.protobuf.ByteString value)
       The resource name of the reference image.
      
       Format is:
       `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
      
       This field is ignored when creating a reference image.
       
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getUri

      public String getUri()
       Required. The Google Cloud Storage URI of the reference image.
      
       The URI must start with `gs://`.
       
      string uri = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getUri in interface ReferenceImageOrBuilder
      Returns:
      The uri.
    • getUriBytes

      public com.google.protobuf.ByteString getUriBytes()
       Required. The Google Cloud Storage URI of the reference image.
      
       The URI must start with `gs://`.
       
      string uri = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getUriBytes in interface ReferenceImageOrBuilder
      Returns:
      The bytes for uri.
    • setUri

      public ReferenceImage.Builder setUri(String value)
       Required. The Google Cloud Storage URI of the reference image.
      
       The URI must start with `gs://`.
       
      string uri = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The uri to set.
      Returns:
      This builder for chaining.
    • clearUri

      public ReferenceImage.Builder clearUri()
       Required. The Google Cloud Storage URI of the reference image.
      
       The URI must start with `gs://`.
       
      string uri = 2 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setUriBytes

      public ReferenceImage.Builder setUriBytes(com.google.protobuf.ByteString value)
       Required. The Google Cloud Storage URI of the reference image.
      
       The URI must start with `gs://`.
       
      string uri = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for uri to set.
      Returns:
      This builder for chaining.
    • getBoundingPolysList

      public List<BoundingPoly> getBoundingPolysList()
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBoundingPolysList in interface ReferenceImageOrBuilder
    • getBoundingPolysCount

      public int getBoundingPolysCount()
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBoundingPolysCount in interface ReferenceImageOrBuilder
    • getBoundingPolys

      public BoundingPoly getBoundingPolys(int index)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBoundingPolys in interface ReferenceImageOrBuilder
    • setBoundingPolys

      public ReferenceImage.Builder setBoundingPolys(int index, BoundingPoly value)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • setBoundingPolys

      public ReferenceImage.Builder setBoundingPolys(int index, BoundingPoly.Builder builderForValue)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • addBoundingPolys

      public ReferenceImage.Builder addBoundingPolys(BoundingPoly value)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • addBoundingPolys

      public ReferenceImage.Builder addBoundingPolys(int index, BoundingPoly value)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • addBoundingPolys

      public ReferenceImage.Builder addBoundingPolys(BoundingPoly.Builder builderForValue)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • addBoundingPolys

      public ReferenceImage.Builder addBoundingPolys(int index, BoundingPoly.Builder builderForValue)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • addAllBoundingPolys

      public ReferenceImage.Builder addAllBoundingPolys(Iterable<? extends BoundingPoly> values)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • clearBoundingPolys

      public ReferenceImage.Builder clearBoundingPolys()
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • removeBoundingPolys

      public ReferenceImage.Builder removeBoundingPolys(int index)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • getBoundingPolysBuilder

      public BoundingPoly.Builder getBoundingPolysBuilder(int index)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • getBoundingPolysOrBuilder

      public BoundingPolyOrBuilder getBoundingPolysOrBuilder(int index)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBoundingPolysOrBuilder in interface ReferenceImageOrBuilder
    • getBoundingPolysOrBuilderList

      public List<? extends BoundingPolyOrBuilder> getBoundingPolysOrBuilderList()
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBoundingPolysOrBuilderList in interface ReferenceImageOrBuilder
    • addBoundingPolysBuilder

      public BoundingPoly.Builder addBoundingPolysBuilder()
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • addBoundingPolysBuilder

      public BoundingPoly.Builder addBoundingPolysBuilder(int index)
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];
    • getBoundingPolysBuilderList

      public List<BoundingPoly.Builder> getBoundingPolysBuilderList()
       Optional. Bounding polygons around the areas of interest in the reference
       image. If this field is empty, the system will try to detect regions of
       interest. At most 10 bounding polygons will be used.
      
       The provided shape is converted into a non-rotated rectangle. Once
       converted, the small edge of the rectangle must be greater than or equal
       to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
       is not).
       
      repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];