Class TextSpan.Builder (2.7.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.v1beta2.TextSpan

Implements

TextSpanOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TextSpan.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TextSpan.Builder
Overrides

build()

public TextSpan build()
Returns
TypeDescription
TextSpan

buildPartial()

public TextSpan buildPartial()
Returns
TypeDescription
TextSpan

clear()

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

This builder for chaining.

clearContent()

public TextSpan.Builder clearContent()

The content of the output text.

string content = 1;

Returns
TypeDescription
TextSpan.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public TextSpan.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
TextSpan.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

The beginOffset.

getContent()

public String getContent()

The content of the output text.

string content = 1;

Returns
TypeDescription
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the output text.

string content = 1;

Returns
TypeDescription
ByteString

The bytes for content.

getDefaultInstanceForType()

public TextSpan getDefaultInstanceForType()
Returns
TypeDescription
TextSpan

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(TextSpan other)

public TextSpan.Builder mergeFrom(TextSpan other)
Parameter
NameDescription
otherTextSpan
Returns
TypeDescription
TextSpan.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

The beginOffset to set.

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

The content to set.

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

The bytes for content to set.

Returns
TypeDescription
TextSpan.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public TextSpan.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TextSpan.Builder
Overrides

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

public TextSpan.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
TextSpan.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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