Class Image.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Image.Builder>
com.google.cloud.retail.v2alpha.Image.Builder
All Implemented Interfaces:
ImageOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Image

public static final class Image.Builder extends com.google.protobuf.GeneratedMessage.Builder<Image.Builder> implements ImageOrBuilder
 [Product][google.cloud.retail.v2alpha.Product] image. Recommendations AI and
 Retail Search use product images to improve prediction and search results.
 Product images can be returned in results, and are shown in prediction or
 search previews in the console. Please try to provide correct product images
 and avoid using images with size too small.
 
Protobuf type google.cloud.retail.v2alpha.Image
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    Height of the image in number of pixels.
    Required.
    Width of the image in number of pixels.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    int
    Height of the image in number of pixels.
    Required.
    com.google.protobuf.ByteString
    Required.
    int
    Width of the image in number of pixels.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    setHeight(int value)
    Height of the image in number of pixels.
    setUri(String value)
    Required.
    setUriBytes(com.google.protobuf.ByteString value)
    Required.
    setWidth(int value)
    Width of the image in number of pixels.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • 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<Image.Builder>
    • clear

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

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

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

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

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

      public Image.Builder mergeFrom(Image other)
    • isInitialized

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

      public Image.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<Image.Builder>
      Throws:
      IOException
    • getUri

      public String getUri()
       Required. URI of the image.
      
       This field must be a valid UTF-8 encoded URI with a length limit of 5,000
       characters. Otherwise, an INVALID_ARGUMENT error is returned.
      
       Google Merchant Center property
       [image_link](https://support.google.com/merchants/answer/6324350).
       Schema.org property [Product.image](https://schema.org/image).
       
      string uri = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getUri in interface ImageOrBuilder
      Returns:
      The uri.
    • getUriBytes

      public com.google.protobuf.ByteString getUriBytes()
       Required. URI of the image.
      
       This field must be a valid UTF-8 encoded URI with a length limit of 5,000
       characters. Otherwise, an INVALID_ARGUMENT error is returned.
      
       Google Merchant Center property
       [image_link](https://support.google.com/merchants/answer/6324350).
       Schema.org property [Product.image](https://schema.org/image).
       
      string uri = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getUriBytes in interface ImageOrBuilder
      Returns:
      The bytes for uri.
    • setUri

      public Image.Builder setUri(String value)
       Required. URI of the image.
      
       This field must be a valid UTF-8 encoded URI with a length limit of 5,000
       characters. Otherwise, an INVALID_ARGUMENT error is returned.
      
       Google Merchant Center property
       [image_link](https://support.google.com/merchants/answer/6324350).
       Schema.org property [Product.image](https://schema.org/image).
       
      string uri = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The uri to set.
      Returns:
      This builder for chaining.
    • clearUri

      public Image.Builder clearUri()
       Required. URI of the image.
      
       This field must be a valid UTF-8 encoded URI with a length limit of 5,000
       characters. Otherwise, an INVALID_ARGUMENT error is returned.
      
       Google Merchant Center property
       [image_link](https://support.google.com/merchants/answer/6324350).
       Schema.org property [Product.image](https://schema.org/image).
       
      string uri = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setUriBytes

      public Image.Builder setUriBytes(com.google.protobuf.ByteString value)
       Required. URI of the image.
      
       This field must be a valid UTF-8 encoded URI with a length limit of 5,000
       characters. Otherwise, an INVALID_ARGUMENT error is returned.
      
       Google Merchant Center property
       [image_link](https://support.google.com/merchants/answer/6324350).
       Schema.org property [Product.image](https://schema.org/image).
       
      string uri = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for uri to set.
      Returns:
      This builder for chaining.
    • getHeight

      public int getHeight()
       Height of the image in number of pixels.
      
       This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
       returned.
       
      int32 height = 2;
      Specified by:
      getHeight in interface ImageOrBuilder
      Returns:
      The height.
    • setHeight

      public Image.Builder setHeight(int value)
       Height of the image in number of pixels.
      
       This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
       returned.
       
      int32 height = 2;
      Parameters:
      value - The height to set.
      Returns:
      This builder for chaining.
    • clearHeight

      public Image.Builder clearHeight()
       Height of the image in number of pixels.
      
       This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
       returned.
       
      int32 height = 2;
      Returns:
      This builder for chaining.
    • getWidth

      public int getWidth()
       Width of the image in number of pixels.
      
       This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
       returned.
       
      int32 width = 3;
      Specified by:
      getWidth in interface ImageOrBuilder
      Returns:
      The width.
    • setWidth

      public Image.Builder setWidth(int value)
       Width of the image in number of pixels.
      
       This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
       returned.
       
      int32 width = 3;
      Parameters:
      value - The width to set.
      Returns:
      This builder for chaining.
    • clearWidth

      public Image.Builder clearWidth()
       Width of the image in number of pixels.
      
       This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
       returned.
       
      int32 width = 3;
      Returns:
      This builder for chaining.