Class Audience.Builder (2.57.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
Type Description
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
Name Description
value String

The ageGroups to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the ageGroups to add.

Returns
Type Description
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
Name Description
values Iterable<String>

The ageGroups to add.

Returns
Type Description
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
Name Description
values Iterable<String>

The genders to add.

Returns
Type Description
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
Name Description
value String

The genders to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the genders to add.

Returns
Type Description
Audience.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Audience.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Audience.Builder
Overrides

build()

public Audience build()
Returns
Type Description
Audience

buildPartial()

public Audience buildPartial()
Returns
Type Description
Audience

clear()

public Audience.Builder clear()
Returns
Type Description
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
Type Description
Audience.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Audience.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
Audience.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Audience.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Audience.Builder
Overrides

clone()

public Audience.Builder clone()
Returns
Type Description
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
Name Description
index int

The index of the element to return.

Returns
Type Description
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
Name Description
index int

The index of the value to return.

Returns
Type Description
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
Type Description
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
Type Description
ProtocolStringList

A list containing the ageGroups.

getDefaultInstanceForType()

public Audience getDefaultInstanceForType()
Returns
Type Description
Audience

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Name Description
index int

The index of the element to return.

Returns
Type Description
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
Name Description
index int

The index of the value to return.

Returns
Type Description
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
Type Description
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
Type Description
ProtocolStringList

A list containing the genders.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Audience other)

public Audience.Builder mergeFrom(Audience other)
Parameter
Name Description
other Audience
Returns
Type Description
Audience.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Audience.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Audience.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Audience.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Audience.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Audience.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
index int

The index to set the value at.

value String

The ageGroups to set.

Returns
Type Description
Audience.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Audience.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
index int

The index to set the value at.

value String

The genders to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Audience.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Audience.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Audience.Builder
Overrides