Class TextSpan.Builder (2.44.0)

public static final class TextSpan.Builder extends GeneratedMessageV3.Builder<TextSpan.Builder> implements TextSpanOrBuilder

Represents an output piece of text.

Protobuf type google.cloud.language.v1.TextSpan

Implements

TextSpanOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public TextSpan build()
Returns
Type Description
TextSpan

buildPartial()

public TextSpan buildPartial()
Returns
Type Description
TextSpan

clear()

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

clearBeginOffset()

public TextSpan.Builder clearBeginOffset()

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()

public TextSpan.Builder clearContent()

The content of the output text.

string content = 1;

Returns
Type Description
TextSpan.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getBeginOffset()

public int getBeginOffset()

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()

public String getContent()

The content of the output text.

string content = 1;

Returns
Type Description
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the output text.

string content = 1;

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

public TextSpan getDefaultInstanceForType()
Returns
Type Description
TextSpan

getDescriptorForType()

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

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(TextSpan other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setBeginOffset(int value)

public TextSpan.Builder setBeginOffset(int value)

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)

public TextSpan.Builder setContent(String value)

The content of the output text.

string content = 1;

Parameter
Name Description
value String

The content to set.

Returns
Type Description
TextSpan.Builder

This builder for chaining.

setContentBytes(ByteString value)

public TextSpan.Builder setContentBytes(ByteString value)

The content of the output text.

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)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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