Class SafetyRating.Builder (3.36.0)

public static final class SafetyRating.Builder extends GeneratedMessageV3.Builder<SafetyRating.Builder> implements SafetyRatingOrBuilder

Safety rating corresponding to the generated content.

Protobuf type google.cloud.aiplatform.v1.SafetyRating

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public SafetyRating build()
Returns
TypeDescription
SafetyRating

buildPartial()

public SafetyRating buildPartial()
Returns
TypeDescription
SafetyRating

clear()

public SafetyRating.Builder clear()
Returns
TypeDescription
SafetyRating.Builder
Overrides

clearBlocked()

public SafetyRating.Builder clearBlocked()

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

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

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

clearCategory()

public SafetyRating.Builder clearCategory()

Output only. Harm category.

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

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearProbability()

public SafetyRating.Builder clearProbability()

Output only. Harm probability levels in the content.

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

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

clone()

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

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getProbability()

public SafetyRating.HarmProbability getProbability()

Output only. Harm probability levels in the content.

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

Returns
TypeDescription
SafetyRating.HarmProbability

The probability.

getProbabilityValue()

public int getProbabilityValue()

Output only. Harm probability levels in the content.

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

Returns
TypeDescription
int

The enum numeric value on the wire for probability.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SafetyRating other)

public SafetyRating.Builder mergeFrom(SafetyRating other)
Parameter
NameDescription
otherSafetyRating
Returns
TypeDescription
SafetyRating.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SafetyRating.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SafetyRating.Builder
Overrides

setBlocked(boolean value)

public SafetyRating.Builder setBlocked(boolean value)

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

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

Parameter
NameDescription
valueboolean

The blocked to set.

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

setCategory(HarmCategory value)

public SafetyRating.Builder setCategory(HarmCategory value)

Output only. Harm category.

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

Parameter
NameDescription
valueHarmCategory

The category to set.

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

setCategoryValue(int value)

public SafetyRating.Builder setCategoryValue(int value)

Output only. Harm category.

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

Parameter
NameDescription
valueint

The enum numeric value on the wire for category to set.

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setProbability(SafetyRating.HarmProbability value)

public SafetyRating.Builder setProbability(SafetyRating.HarmProbability value)

Output only. Harm probability levels in the content.

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

Parameter
NameDescription
valueSafetyRating.HarmProbability

The probability to set.

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

setProbabilityValue(int value)

public SafetyRating.Builder setProbabilityValue(int value)

Output only. Harm probability levels in the content.

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

Parameter
NameDescription
valueint

The enum numeric value on the wire for probability to set.

Returns
TypeDescription
SafetyRating.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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