Class SafetyRating (3.41.0)

public final class SafetyRating extends GeneratedMessageV3 implements SafetyRatingOrBuilder

Safety rating corresponding to the generated content.

Protobuf type google.cloud.aiplatform.v1beta1.SafetyRating

Static Fields

BLOCKED_FIELD_NUMBER

public static final int BLOCKED_FIELD_NUMBER
Field Value
TypeDescription
int

CATEGORY_FIELD_NUMBER

public static final int CATEGORY_FIELD_NUMBER
Field Value
TypeDescription
int

PROBABILITY_FIELD_NUMBER

public static final int PROBABILITY_FIELD_NUMBER
Field Value
TypeDescription
int

PROBABILITY_SCORE_FIELD_NUMBER

public static final int PROBABILITY_SCORE_FIELD_NUMBER
Field Value
TypeDescription
int

SEVERITY_FIELD_NUMBER

public static final int SEVERITY_FIELD_NUMBER
Field Value
TypeDescription
int

SEVERITY_SCORE_FIELD_NUMBER

public static final int SEVERITY_SCORE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static SafetyRating getDefaultInstance()
Returns
TypeDescription
SafetyRating

getDescriptor()

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

newBuilder()

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

newBuilder(SafetyRating prototype)

public static SafetyRating.Builder newBuilder(SafetyRating prototype)
Parameter
NameDescription
prototypeSafetyRating
Returns
TypeDescription
SafetyRating.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getBlocked()

public boolean getBlocked()

Output only. Indicates whether the content was filtered out because of this rating.

bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

The blocked.

getCategory()

public HarmCategory getCategory()

Output only. Harm category.

.google.cloud.aiplatform.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
HarmCategory

The category.

getCategoryValue()

public int getCategoryValue()

Output only. Harm category.

.google.cloud.aiplatform.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for category.

getDefaultInstanceForType()

public SafetyRating getDefaultInstanceForType()
Returns
TypeDescription
SafetyRating

getParserForType()

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

getProbability()

public SafetyRating.HarmProbability getProbability()

Output only. Harm probability levels in the content.

.google.cloud.aiplatform.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
SafetyRating.HarmProbability

The probability.

getProbabilityScore()

public float getProbabilityScore()

Output only. Harm probability score.

float probability_score = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
float

The probabilityScore.

getProbabilityValue()

public int getProbabilityValue()

Output only. Harm probability levels in the content.

.google.cloud.aiplatform.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for probability.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSeverity()

public SafetyRating.HarmSeverity getSeverity()

Output only. Harm severity levels in the content.

.google.cloud.aiplatform.v1beta1.SafetyRating.HarmSeverity severity = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
SafetyRating.HarmSeverity

The severity.

getSeverityScore()

public float getSeverityScore()

Output only. Harm severity score.

float severity_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
float

The severityScore.

getSeverityValue()

public int getSeverityValue()

Output only. Harm severity levels in the content.

.google.cloud.aiplatform.v1beta1.SafetyRating.HarmSeverity severity = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for severity.

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 SafetyRating.Builder newBuilderForType()
Returns
TypeDescription
SafetyRating.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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