Class SafetySetting.Builder (0.4.0)

publicstaticfinalclass SafetySetting.BuilderextendsGeneratedMessageV3.Builder<SafetySetting.Builder>implementsSafetySettingOrBuilder

Safety settings.

Protobuf type google.cloud.vertexai.v1.SafetySetting

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicSafetySetting.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SafetySetting.Builder
Overrides

build()

publicSafetySettingbuild()
Returns
Type Description
SafetySetting

buildPartial()

publicSafetySettingbuildPartial()
Returns
Type Description
SafetySetting

clear()

publicSafetySetting.Builderclear()
Returns
Type Description
SafetySetting.Builder
Overrides

clearCategory()

publicSafetySetting.BuilderclearCategory()

Required. Harm category.

.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SafetySetting.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicSafetySetting.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SafetySetting.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicSafetySetting.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SafetySetting.Builder
Overrides

clearThreshold()

publicSafetySetting.BuilderclearThreshold()

Required. The harm block threshold.

.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SafetySetting.Builder

This builder for chaining.

clone()

publicSafetySetting.Builderclone()
Returns
Type Description
SafetySetting.Builder
Overrides

getCategory()

publicHarmCategorygetCategory()

Required. Harm category.

.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
HarmCategory

The category.

getCategoryValue()

publicintgetCategoryValue()

Required. Harm category.

.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for category.

getDefaultInstanceForType()

publicSafetySettinggetDefaultInstanceForType()
Returns
Type Description
SafetySetting

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getThreshold()

publicSafetySetting.HarmBlockThresholdgetThreshold()

Required. The harm block threshold.

.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SafetySetting.HarmBlockThreshold

The threshold.

getThresholdValue()

publicintgetThresholdValue()

Required. The harm block threshold.

.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for threshold.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SafetySetting other)

publicSafetySetting.BuildermergeFrom(SafetySettingother)
Parameter
Name Description
other SafetySetting
Returns
Type Description
SafetySetting.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicSafetySetting.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SafetySetting.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicSafetySetting.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
SafetySetting.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalSafetySetting.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SafetySetting.Builder
Overrides

setCategory(HarmCategory value)

publicSafetySetting.BuildersetCategory(HarmCategoryvalue)

Required. Harm category.

.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value HarmCategory

The category to set.

Returns
Type Description
SafetySetting.Builder

This builder for chaining.

setCategoryValue(int value)

publicSafetySetting.BuildersetCategoryValue(intvalue)

Required. Harm category.

.google.cloud.vertexai.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

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

Returns
Type Description
SafetySetting.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicSafetySetting.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SafetySetting.Builder
Overrides

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

publicSafetySetting.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SafetySetting.Builder
Overrides

setThreshold(SafetySetting.HarmBlockThreshold value)

publicSafetySetting.BuildersetThreshold(SafetySetting.HarmBlockThresholdvalue)

Required. The harm block threshold.

.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value SafetySetting.HarmBlockThreshold

The threshold to set.

Returns
Type Description
SafetySetting.Builder

This builder for chaining.

setThresholdValue(int value)

publicSafetySetting.BuildersetThresholdValue(intvalue)

Required. The harm block threshold.

.google.cloud.vertexai.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

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

Returns
Type Description
SafetySetting.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalSafetySetting.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SafetySetting.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.