Class 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.GeneratedMessageV3.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 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<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.GeneratedMessageV3.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.GeneratedMessageV3.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
      • clone

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

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

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

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

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

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

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.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.
      • setUnknownFields

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

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