Class Audience.Builder (2.42.0)

public static final class Audience.Builder extends GeneratedMessageV3.Builder<Audience.Builder> implements AudienceOrBuilder

An intended audience of the Product for whom it's sold.

Protobuf type google.cloud.retail.v2alpha.Audience

Implements

AudienceOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAgeGroups(String value)

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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Parameter
NameDescription
valueString

The ageGroups to add.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

addAgeGroupsBytes(ByteString value)

public Audience.Builder addAgeGroupsBytes(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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Parameter
NameDescription
valueByteString

The bytes of the ageGroups to add.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

addAllAgeGroups(Iterable<String> values)

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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Parameter
NameDescription
valuesIterable<String>

The ageGroups to add.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

addAllGenders(Iterable<String> values)

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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Parameter
NameDescription
valuesIterable<String>

The genders to add.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

addGenders(String value)

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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Parameter
NameDescription
valueString

The genders to add.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

addGendersBytes(ByteString value)

public Audience.Builder addGendersBytes(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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Parameter
NameDescription
valueByteString

The bytes of the genders to add.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Audience.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Audience.Builder
Overrides

build()

public Audience build()
Returns
TypeDescription
Audience

buildPartial()

public Audience buildPartial()
Returns
TypeDescription
Audience

clear()

public Audience.Builder clear()
Returns
TypeDescription
Audience.Builder
Overrides

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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Audience.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Audience.Builder
Overrides

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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Audience.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Audience.Builder
Overrides

clone()

public Audience.Builder clone()
Returns
TypeDescription
Audience.Builder
Overrides

getAgeGroups(int index)

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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The ageGroups at the given index.

getAgeGroupsBytes(int index)

public 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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the ageGroups at the given index.

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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Returns
TypeDescription
int

The count of ageGroups.

getAgeGroupsList()

public 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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Returns
TypeDescription
ProtocolStringList

A list containing the ageGroups.

getDefaultInstanceForType()

public Audience getDefaultInstanceForType()
Returns
TypeDescription
Audience

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getGenders(int index)

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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The genders at the given index.

getGendersBytes(int index)

public 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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the genders at the given index.

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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Returns
TypeDescription
int

The count of genders.

getGendersList()

public 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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Returns
TypeDescription
ProtocolStringList

A list containing the genders.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Audience other)

public Audience.Builder mergeFrom(Audience other)
Parameter
NameDescription
otherAudience
Returns
TypeDescription
Audience.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Audience.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Audience.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Audience.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Audience.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Audience.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Audience.Builder
Overrides

setAgeGroups(int index, String value)

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. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.

repeated string age_groups = 2;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The ageGroups to set.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Audience.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Audience.Builder
Overrides

setGenders(int index, String value)

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. Schema.org property Product.audience.suggestedGender.

repeated string genders = 1;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The genders to set.

Returns
TypeDescription
Audience.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Audience.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Audience.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Audience.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Audience.Builder
Overrides