Class TextSpan.Builder (2.57.0)

publicstaticfinalclass TextSpan.BuilderextendsGeneratedMessageV3.Builder<TextSpan.Builder>implementsTextSpanOrBuilder

Represents a text span in the input document.

Protobuf type google.cloud.language.v2.TextSpan

Implements

TextSpanOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicTextSpan.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TextSpan.Builder
Overrides

build()

publicTextSpanbuild()
Returns
Type Description
TextSpan

buildPartial()

publicTextSpanbuildPartial()
Returns
Type Description
TextSpan

clear()

publicTextSpan.Builderclear()
Returns
Type Description
TextSpan.Builder
Overrides

clearBeginOffset()

publicTextSpan.BuilderclearBeginOffset()

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.

int32 begin_offset = 2;

Returns
Type Description
TextSpan.Builder

This builder for chaining.

clearContent()

publicTextSpan.BuilderclearContent()

The content of the text span, which is a substring of the document.

string content = 1;

Returns
Type Description
TextSpan.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicTextSpan.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
TextSpan.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicTextSpan.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
TextSpan.Builder
Overrides

clone()

publicTextSpan.Builderclone()
Returns
Type Description
TextSpan.Builder
Overrides

getBeginOffset()

publicintgetBeginOffset()

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.

int32 begin_offset = 2;

Returns
Type Description
int

The beginOffset.

getContent()

publicStringgetContent()

The content of the text span, which is a substring of the document.

string content = 1;

Returns
Type Description
String

The content.

getContentBytes()

publicByteStringgetContentBytes()

The content of the text span, which is a substring of the document.

string content = 1;

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

publicTextSpangetDefaultInstanceForType()
Returns
Type Description
TextSpan

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(TextSpan other)

publicTextSpan.BuildermergeFrom(TextSpanother)
Parameter
Name Description
other TextSpan
Returns
Type Description
TextSpan.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicTextSpan.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TextSpan.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicTextSpan.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
TextSpan.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalTextSpan.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TextSpan.Builder
Overrides

setBeginOffset(int value)

publicTextSpan.BuildersetBeginOffset(intvalue)

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.

int32 begin_offset = 2;

Parameter
Name Description
value int

The beginOffset to set.

Returns
Type Description
TextSpan.Builder

This builder for chaining.

setContent(String value)

publicTextSpan.BuildersetContent(Stringvalue)

The content of the text span, which is a substring of the document.

string content = 1;

Parameter
Name Description
value String

The content to set.

Returns
Type Description
TextSpan.Builder

This builder for chaining.

setContentBytes(ByteString value)

publicTextSpan.BuildersetContentBytes(ByteStringvalue)

The content of the text span, which is a substring of the document.

string content = 1;

Parameter
Name Description
value ByteString

The bytes for content to set.

Returns
Type Description
TextSpan.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicTextSpan.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TextSpan.Builder
Overrides

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

publicTextSpan.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
TextSpan.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalTextSpan.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TextSpan.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.