Class Audience.Builder

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

public static final class Audience.Builder extends com.google.protobuf.GeneratedMessage.Builder<Audience.Builder> implements AudienceOrBuilder
 An intended audience of the [Product][google.cloud.retail.v2alpha.Product]
 for whom it's sold.
 
Protobuf type google.cloud.retail.v2alpha.Audience
  • Method Summary

    Modifier and Type
    Method
    Description
    The age groups of the audience.
    addAgeGroupsBytes(com.google.protobuf.ByteString value)
    The age groups of the audience.
    The age groups of the audience.
    The genders of the audience.
    The genders of the audience.
    addGendersBytes(com.google.protobuf.ByteString value)
    The genders of the audience.
     
     
     
    The age groups of the audience.
    The genders of the audience.
    getAgeGroups(int index)
    The age groups of the audience.
    com.google.protobuf.ByteString
    getAgeGroupsBytes(int index)
    The age groups of the audience.
    int
    The age groups of the audience.
    com.google.protobuf.ProtocolStringList
    The age groups of the audience.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    getGenders(int index)
    The genders of the audience.
    com.google.protobuf.ByteString
    getGendersBytes(int index)
    The genders of the audience.
    int
    The genders of the audience.
    com.google.protobuf.ProtocolStringList
    The genders of the audience.
    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)
     
    setAgeGroups(int index, String value)
    The age groups of the audience.
    setGenders(int index, String value)
    The genders of the audience.

    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<Audience.Builder>
    • clear

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

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

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

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

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

      public Audience.Builder mergeFrom(Audience other)
    • isInitialized

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

      public Audience.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<Audience.Builder>
      Throws:
      IOException
    • getGendersList

      public com.google.protobuf.ProtocolStringList getGendersList()
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Specified by:
      getGendersList in interface AudienceOrBuilder
      Returns:
      A list containing the genders.
    • getGendersCount

      public int getGendersCount()
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Specified by:
      getGendersCount in interface AudienceOrBuilder
      Returns:
      The count of genders.
    • getGenders

      public String getGenders(int index)
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Specified by:
      getGenders in interface AudienceOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The genders at the given index.
    • getGendersBytes

      public com.google.protobuf.ByteString getGendersBytes(int index)
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Specified by:
      getGendersBytes in interface AudienceOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the genders at the given index.
    • setGenders

      public Audience.Builder setGenders(int index, String value)
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Parameters:
      index - The index to set the value at.
      value - The genders to set.
      Returns:
      This builder for chaining.
    • addGenders

      public Audience.Builder addGenders(String value)
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Parameters:
      value - The genders to add.
      Returns:
      This builder for chaining.
    • addAllGenders

      public Audience.Builder addAllGenders(Iterable<String> values)
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Parameters:
      values - The genders to add.
      Returns:
      This builder for chaining.
    • clearGenders

      public Audience.Builder clearGenders()
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Returns:
      This builder for chaining.
    • addGendersBytes

      public Audience.Builder addGendersBytes(com.google.protobuf.ByteString value)
       The genders of the audience. Strongly encouraged to use the standard
       values: "male", "female", "unisex".
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [gender](https://support.google.com/merchants/answer/6324479). Schema.org
       property
       [Product.audience.suggestedGender](https://schema.org/suggestedGender).
       
      repeated string genders = 1;
      Parameters:
      value - The bytes of the genders to add.
      Returns:
      This builder for chaining.
    • getAgeGroupsList

      public com.google.protobuf.ProtocolStringList getAgeGroupsList()
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Specified by:
      getAgeGroupsList in interface AudienceOrBuilder
      Returns:
      A list containing the ageGroups.
    • getAgeGroupsCount

      public int getAgeGroupsCount()
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Specified by:
      getAgeGroupsCount in interface AudienceOrBuilder
      Returns:
      The count of ageGroups.
    • getAgeGroups

      public String getAgeGroups(int index)
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Specified by:
      getAgeGroups in interface AudienceOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The ageGroups at the given index.
    • getAgeGroupsBytes

      public com.google.protobuf.ByteString getAgeGroupsBytes(int index)
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Specified by:
      getAgeGroupsBytes in interface AudienceOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the ageGroups at the given index.
    • setAgeGroups

      public Audience.Builder setAgeGroups(int index, String value)
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Parameters:
      index - The index to set the value at.
      value - The ageGroups to set.
      Returns:
      This builder for chaining.
    • addAgeGroups

      public Audience.Builder addAgeGroups(String value)
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Parameters:
      value - The ageGroups to add.
      Returns:
      This builder for chaining.
    • addAllAgeGroups

      public Audience.Builder addAllAgeGroups(Iterable<String> values)
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Parameters:
      values - The ageGroups to add.
      Returns:
      This builder for chaining.
    • clearAgeGroups

      public Audience.Builder clearAgeGroups()
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Returns:
      This builder for chaining.
    • addAgeGroupsBytes

      public Audience.Builder addAgeGroupsBytes(com.google.protobuf.ByteString value)
       The age groups of the audience. Strongly encouraged to use the standard
       values: "newborn" (up to 3 months old), "infant" (3–12 months old),
       "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
       teens or older).
      
       At most 5 values are allowed. Each value must be a UTF-8 encoded string
       with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
       is returned.
      
       Google Merchant Center property
       [age_group](https://support.google.com/merchants/answer/6324463).
       Schema.org property
       [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
       [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
       
      repeated string age_groups = 2;
      Parameters:
      value - The bytes of the ageGroups to add.
      Returns:
      This builder for chaining.