Class SynonymSet.Builder (0.51.0)

public static final class SynonymSet.Builder extends GeneratedMessageV3.Builder<SynonymSet.Builder> implements SynonymSetOrBuilder

Represents a list of synonyms for a given context. For example a context "sales" could contain: Synonym 1: sale, invoice, bill, order Synonym 2: money, credit, finance, payment Synonym 3: shipping, freight, transport Each SynonymSets should be disjoint

Protobuf type google.cloud.contentwarehouse.v1.SynonymSet

Implements

SynonymSetOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllSynonyms(Iterable<? extends SynonymSet.Synonym> values)

public SynonymSet.Builder addAllSynonyms(Iterable<? extends SynonymSet.Synonym> values)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
values Iterable<? extends com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym>
Returns
Type Description
SynonymSet.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addSynonyms(SynonymSet.Synonym value)

public SynonymSet.Builder addSynonyms(SynonymSet.Synonym value)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
value SynonymSet.Synonym
Returns
Type Description
SynonymSet.Builder

addSynonyms(SynonymSet.Synonym.Builder builderForValue)

public SynonymSet.Builder addSynonyms(SynonymSet.Synonym.Builder builderForValue)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
builderForValue SynonymSet.Synonym.Builder
Returns
Type Description
SynonymSet.Builder

addSynonyms(int index, SynonymSet.Synonym value)

public SynonymSet.Builder addSynonyms(int index, SynonymSet.Synonym value)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameters
Name Description
index int
value SynonymSet.Synonym
Returns
Type Description
SynonymSet.Builder

addSynonyms(int index, SynonymSet.Synonym.Builder builderForValue)

public SynonymSet.Builder addSynonyms(int index, SynonymSet.Synonym.Builder builderForValue)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameters
Name Description
index int
builderForValue SynonymSet.Synonym.Builder
Returns
Type Description
SynonymSet.Builder

addSynonymsBuilder()

public SynonymSet.Synonym.Builder addSynonymsBuilder()

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Returns
Type Description
SynonymSet.Synonym.Builder

addSynonymsBuilder(int index)

public SynonymSet.Synonym.Builder addSynonymsBuilder(int index)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
index int
Returns
Type Description
SynonymSet.Synonym.Builder

build()

public SynonymSet build()
Returns
Type Description
SynonymSet

buildPartial()

public SynonymSet buildPartial()
Returns
Type Description
SynonymSet

clear()

public SynonymSet.Builder clear()
Returns
Type Description
SynonymSet.Builder
Overrides

clearContext()

public SynonymSet.Builder clearContext()

This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.

string context = 2;

Returns
Type Description
SynonymSet.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SynonymSet.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SynonymSet.Builder
Overrides

clearName()

public SynonymSet.Builder clearName()

The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.

string name = 1;

Returns
Type Description
SynonymSet.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSynonyms()

public SynonymSet.Builder clearSynonyms()

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Returns
Type Description
SynonymSet.Builder

clone()

public SynonymSet.Builder clone()
Returns
Type Description
SynonymSet.Builder
Overrides

getContext()

public String getContext()

This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.

string context = 2;

Returns
Type Description
String

The context.

getContextBytes()

public ByteString getContextBytes()

This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.

string context = 2;

Returns
Type Description
ByteString

The bytes for context.

getDefaultInstanceForType()

public SynonymSet getDefaultInstanceForType()
Returns
Type Description
SynonymSet

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getName()

public String getName()

The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getSynonyms(int index)

public SynonymSet.Synonym getSynonyms(int index)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
index int
Returns
Type Description
SynonymSet.Synonym

getSynonymsBuilder(int index)

public SynonymSet.Synonym.Builder getSynonymsBuilder(int index)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
index int
Returns
Type Description
SynonymSet.Synonym.Builder

getSynonymsBuilderList()

public List<SynonymSet.Synonym.Builder> getSynonymsBuilderList()

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Returns
Type Description
List<Builder>

getSynonymsCount()

public int getSynonymsCount()

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Returns
Type Description
int

getSynonymsList()

public List<SynonymSet.Synonym> getSynonymsList()

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Returns
Type Description
List<Synonym>

getSynonymsOrBuilder(int index)

public SynonymSet.SynonymOrBuilder getSynonymsOrBuilder(int index)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
index int
Returns
Type Description
SynonymSet.SynonymOrBuilder

getSynonymsOrBuilderList()

public List<? extends SynonymSet.SynonymOrBuilder> getSynonymsOrBuilderList()

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Returns
Type Description
List<? extends com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder>

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SynonymSet other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SynonymSet.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SynonymSet.Builder
Overrides

removeSynonyms(int index)

public SynonymSet.Builder removeSynonyms(int index)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameter
Name Description
index int
Returns
Type Description
SynonymSet.Builder

setContext(String value)

public SynonymSet.Builder setContext(String value)

This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.

string context = 2;

Parameter
Name Description
value String

The context to set.

Returns
Type Description
SynonymSet.Builder

This builder for chaining.

setContextBytes(ByteString value)

public SynonymSet.Builder setContextBytes(ByteString value)

This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.

string context = 2;

Parameter
Name Description
value ByteString

The bytes for context to set.

Returns
Type Description
SynonymSet.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public SynonymSet.Builder setName(String value)

The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
SynonymSet.Builder

This builder for chaining.

setNameBytes(ByteString value)

public SynonymSet.Builder setNameBytes(ByteString value)

The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
SynonymSet.Builder

This builder for chaining.

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

public SynonymSet.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SynonymSet.Builder
Overrides

setSynonyms(int index, SynonymSet.Synonym value)

public SynonymSet.Builder setSynonyms(int index, SynonymSet.Synonym value)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameters
Name Description
index int
value SynonymSet.Synonym
Returns
Type Description
SynonymSet.Builder

setSynonyms(int index, SynonymSet.Synonym.Builder builderForValue)

public SynonymSet.Builder setSynonyms(int index, SynonymSet.Synonym.Builder builderForValue)

List of Synonyms for the context.

repeated .google.cloud.contentwarehouse.v1.SynonymSet.Synonym synonyms = 3;

Parameters
Name Description
index int
builderForValue SynonymSet.Synonym.Builder
Returns
Type Description
SynonymSet.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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