Class SafetyRating.Builder
-
- All Implemented Interfaces:
public abstract class SafetyRating.BuilderBuilder for SafetyRating.
-
-
Constructor Summary
Constructors Constructor Description SafetyRating.Builder()
-
Method Summary
Modifier and Type Method Description abstract SafetyRating.Builderblocked(boolean blocked)Setter for blocked. SafetyRating.BuilderclearBlocked()Clears the value of blocked field. abstract SafetyRating.Buildercategory(HarmCategory category)Setter for category. SafetyRating.BuilderclearCategory()Clears the value of category field. SafetyRating.Buildercategory(HarmCategory.Known knownType)Setter for category given a known enum. SafetyRating.Buildercategory(String category)Setter for category given a string. abstract SafetyRating.BuilderoverwrittenThreshold(HarmBlockThreshold overwrittenThreshold)Setter for overwrittenThreshold. SafetyRating.BuilderclearOverwrittenThreshold()Clears the value of overwrittenThreshold field. SafetyRating.BuilderoverwrittenThreshold(HarmBlockThreshold.Known knownType)Setter for overwrittenThreshold given a known enum. SafetyRating.BuilderoverwrittenThreshold(String overwrittenThreshold)Setter for overwrittenThreshold given a string. abstract SafetyRating.Builderprobability(HarmProbability probability)Setter for probability. SafetyRating.BuilderclearProbability()Clears the value of probability field. SafetyRating.Builderprobability(HarmProbability.Known knownType)Setter for probability given a known enum. SafetyRating.Builderprobability(String probability)Setter for probability given a string. abstract SafetyRating.BuilderprobabilityScore(Float probabilityScore)Setter for probabilityScore. SafetyRating.BuilderclearProbabilityScore()Clears the value of probabilityScore field. abstract SafetyRating.Builderseverity(HarmSeverity severity)Setter for severity. SafetyRating.BuilderclearSeverity()Clears the value of severity field. SafetyRating.Builderseverity(HarmSeverity.Known knownType)Setter for severity given a known enum. SafetyRating.Builderseverity(String severity)Setter for severity given a string. abstract SafetyRating.BuilderseverityScore(Float severityScore)Setter for severityScore. SafetyRating.BuilderclearSeverityScore()Clears the value of severityScore field. abstract SafetyRatingbuild()-
-
Method Detail
-
blocked
abstract SafetyRating.Builder blocked(boolean blocked)
Setter for blocked.
blocked: Output only. Indicates whether the content was blocked because of this rating.
-
clearBlocked
@CanIgnoreReturnValue() SafetyRating.Builder clearBlocked()
Clears the value of blocked field.
-
category
abstract SafetyRating.Builder category(HarmCategory category)
Setter for category.
category: Output only. The harm category of this rating.
-
clearCategory
@CanIgnoreReturnValue() SafetyRating.Builder clearCategory()
Clears the value of category field.
-
category
@CanIgnoreReturnValue() SafetyRating.Builder category(HarmCategory.Known knownType)
Setter for category given a known enum.
category: Output only. The harm category of this rating.
-
category
@CanIgnoreReturnValue() SafetyRating.Builder category(String category)
Setter for category given a string.
category: Output only. The harm category of this rating.
-
overwrittenThreshold
abstract SafetyRating.Builder overwrittenThreshold(HarmBlockThreshold overwrittenThreshold)
Setter for overwrittenThreshold.
overwrittenThreshold: Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API.
-
clearOverwrittenThreshold
@CanIgnoreReturnValue() SafetyRating.Builder clearOverwrittenThreshold()
Clears the value of overwrittenThreshold field.
-
overwrittenThreshold
@CanIgnoreReturnValue() SafetyRating.Builder overwrittenThreshold(HarmBlockThreshold.Known knownType)
Setter for overwrittenThreshold given a known enum.
overwrittenThreshold: Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API.
-
overwrittenThreshold
@CanIgnoreReturnValue() SafetyRating.Builder overwrittenThreshold(String overwrittenThreshold)
Setter for overwrittenThreshold given a string.
overwrittenThreshold: Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API.
-
probability
abstract SafetyRating.Builder probability(HarmProbability probability)
Setter for probability.
probability: Output only. The probability of harm for this category.
-
clearProbability
@CanIgnoreReturnValue() SafetyRating.Builder clearProbability()
Clears the value of probability field.
-
probability
@CanIgnoreReturnValue() SafetyRating.Builder probability(HarmProbability.Known knownType)
Setter for probability given a known enum.
probability: Output only. The probability of harm for this category.
-
probability
@CanIgnoreReturnValue() SafetyRating.Builder probability(String probability)
Setter for probability given a string.
probability: Output only. The probability of harm for this category.
-
probabilityScore
abstract SafetyRating.Builder probabilityScore(Float probabilityScore)
Setter for probabilityScore.
probabilityScore: Output only. The probability score of harm for this category. This field is not supported in Gemini API.
-
clearProbabilityScore
@CanIgnoreReturnValue() SafetyRating.Builder clearProbabilityScore()
Clears the value of probabilityScore field.
-
severity
abstract SafetyRating.Builder severity(HarmSeverity severity)
Setter for severity.
severity: Output only. The severity of harm for this category. This field is not supported in Gemini API.
-
clearSeverity
@CanIgnoreReturnValue() SafetyRating.Builder clearSeverity()
Clears the value of severity field.
-
severity
@CanIgnoreReturnValue() SafetyRating.Builder severity(HarmSeverity.Known knownType)
Setter for severity given a known enum.
severity: Output only. The severity of harm for this category. This field is not supported in Gemini API.
-
severity
@CanIgnoreReturnValue() SafetyRating.Builder severity(String severity)
Setter for severity given a string.
severity: Output only. The severity of harm for this category. This field is not supported in Gemini API.
-
severityScore
abstract SafetyRating.Builder severityScore(Float severityScore)
Setter for severityScore.
severityScore: Output only. The severity score of harm for this category. This field is not supported in Gemini API.
-
clearSeverityScore
@CanIgnoreReturnValue() SafetyRating.Builder clearSeverityScore()
Clears the value of severityScore field.
-
build
abstract SafetyRating build()
-
-
-
-