Class TextSpan (2.4.1)

public final class TextSpan extends GeneratedMessageV3 implements TextSpanOrBuilder

Represents an output piece of text.

Protobuf type google.cloud.language.v1.TextSpan

Implements

TextSpanOrBuilder

Static Fields

BEGIN_OFFSET_FIELD_NUMBER

public static final int BEGIN_OFFSET_FIELD_NUMBER
Field Value
TypeDescription
int

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static TextSpan getDefaultInstance()
Returns
TypeDescription
TextSpan

getDescriptor()

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

newBuilder()

public static TextSpan.Builder newBuilder()
Returns
TypeDescription
TextSpan.Builder

newBuilder(TextSpan prototype)

public static TextSpan.Builder newBuilder(TextSpan prototype)
Parameter
NameDescription
prototypeTextSpan
Returns
TypeDescription
TextSpan.Builder

parseDelimitedFrom(InputStream input)

public static TextSpan parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static TextSpan parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static TextSpan parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static TextSpan parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static TextSpan parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static TextSpan parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static TextSpan parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static TextSpan parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static TextSpan parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static TextSpan parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static TextSpan parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static TextSpan parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextSpan
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<TextSpan> parser()
Returns
TypeDescription
Parser<TextSpan>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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

getParserForType()

public Parser<TextSpan> getParserForType()
Returns
TypeDescription
Parser<TextSpan>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public TextSpan.Builder newBuilderForType()
Returns
TypeDescription
TextSpan.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected TextSpan.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
TextSpan.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public TextSpan.Builder toBuilder()
Returns
TypeDescription
TextSpan.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException