Class SynonymSet.Builder (0.4.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.cloud.contentwarehouse.v1.SynonymSet.Synonym>
Returns
TypeDescription
SynonymSet.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SynonymSet.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueSynonymSet.Synonym
Returns
TypeDescription
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
NameDescription
builderForValueSynonymSet.Synonym.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueSynonymSet.Synonym
Returns
TypeDescription
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
NameDescription
indexint
builderForValueSynonymSet.Synonym.Builder
Returns
TypeDescription
SynonymSet.Builder

addSynonymsBuilder()

public SynonymSet.Synonym.Builder addSynonymsBuilder()

List of Synonyms for the context.

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

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
SynonymSet.Synonym.Builder

build()

public SynonymSet build()
Returns
TypeDescription
SynonymSet

buildPartial()

public SynonymSet buildPartial()
Returns
TypeDescription
SynonymSet

clear()

public SynonymSet.Builder clear()
Returns
TypeDescription
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
TypeDescription
SynonymSet.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SynonymSet.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
SynonymSet.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSynonyms()

public SynonymSet.Builder clearSynonyms()

List of Synonyms for the context.

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

Returns
TypeDescription
SynonymSet.Builder

clone()

public SynonymSet.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for context.

getDefaultInstanceForType()

public SynonymSet getDefaultInstanceForType()
Returns
TypeDescription
SynonymSet

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<Builder>

getSynonymsCount()

public int getSynonymsCount()

List of Synonyms for the context.

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

Returns
TypeDescription
int

getSynonymsList()

public List<SynonymSet.Synonym> getSynonymsList()

List of Synonyms for the context.

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

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<? extends com.google.cloud.contentwarehouse.v1.SynonymSet.SynonymOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SynonymSet other)

public SynonymSet.Builder mergeFrom(SynonymSet other)
Parameter
NameDescription
otherSynonymSet
Returns
TypeDescription
SynonymSet.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SynonymSet.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
valueString

The context to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for context to set.

Returns
TypeDescription
SynonymSet.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public SynonymSet.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
indexint
valueSynonymSet.Synonym
Returns
TypeDescription
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
NameDescription
indexint
builderForValueSynonymSet.Synonym.Builder
Returns
TypeDescription
SynonymSet.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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