Class Sentiment (2.24.0)

public final class Sentiment extends GeneratedMessageV3 implements SentimentOrBuilder

Represents the feeling associated with the entire text or entities in the text.

Protobuf type google.cloud.language.v1.Sentiment

Implements

SentimentOrBuilder

Static Fields

MAGNITUDE_FIELD_NUMBER

public static final int MAGNITUDE_FIELD_NUMBER
Field Value
TypeDescription
int

SCORE_FIELD_NUMBER

public static final int SCORE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Sentiment getDefaultInstance()
Returns
TypeDescription
Sentiment

getDescriptor()

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

newBuilder()

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

newBuilder(Sentiment prototype)

public static Sentiment.Builder newBuilder(Sentiment prototype)
Parameter
NameDescription
prototypeSentiment
Returns
TypeDescription
Sentiment.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Sentiment getDefaultInstanceForType()
Returns
TypeDescription
Sentiment

getMagnitude()

public float getMagnitude()

A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).

float magnitude = 2;

Returns
TypeDescription
float

The magnitude.

getParserForType()

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

getScore()

public float getScore()

Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).

float score = 3;

Returns
TypeDescription
float

The score.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
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 Sentiment.Builder newBuilderForType()
Returns
TypeDescription
Sentiment.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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