|
18 | 18 |
|
19 | 19 | public class VertexAiGeminiSafetySetting { |
20 | 20 |
|
| 21 | + public static Builder builder() { |
| 22 | + return new Builder(); |
| 23 | + } |
| 24 | + |
21 | 25 | /** |
22 | 26 | * Enum representing different threshold levels for blocking harmful content. |
23 | 27 | */ |
@@ -77,51 +81,30 @@ public int getValue() { |
77 | 81 |
|
78 | 82 | } |
79 | 83 |
|
80 | | - private HarmCategory category; |
| 84 | + private final HarmCategory category; |
81 | 85 |
|
82 | | - private HarmBlockThreshold threshold; |
| 86 | + private final HarmBlockThreshold threshold; |
83 | 87 |
|
84 | | - private HarmBlockMethod method; |
85 | | - |
86 | | - // Default constructor |
87 | | - public VertexAiGeminiSafetySetting() { |
88 | | - this.category = HarmCategory.HARM_CATEGORY_UNSPECIFIED; |
89 | | - this.threshold = HarmBlockThreshold.HARM_BLOCK_THRESHOLD_UNSPECIFIED; |
90 | | - this.method = HarmBlockMethod.HARM_BLOCK_METHOD_UNSPECIFIED; |
91 | | - } |
| 88 | + private final HarmBlockMethod method; |
92 | 89 |
|
93 | | - // Constructor with all fields |
94 | | - public VertexAiGeminiSafetySetting(HarmCategory category, HarmBlockThreshold threshold, HarmBlockMethod method) { |
| 90 | + private VertexAiGeminiSafetySetting(HarmCategory category, HarmBlockThreshold threshold, HarmBlockMethod method) { |
95 | 91 | this.category = category; |
96 | 92 | this.threshold = threshold; |
97 | 93 | this.method = method; |
98 | 94 | } |
99 | 95 |
|
100 | | - // Getters and setters |
101 | 96 | public HarmCategory getCategory() { |
102 | 97 | return this.category; |
103 | 98 | } |
104 | 99 |
|
105 | | - public void setCategory(HarmCategory category) { |
106 | | - this.category = category; |
107 | | - } |
108 | | - |
109 | 100 | public HarmBlockThreshold getThreshold() { |
110 | 101 | return this.threshold; |
111 | 102 | } |
112 | 103 |
|
113 | | - public void setThreshold(HarmBlockThreshold threshold) { |
114 | | - this.threshold = threshold; |
115 | | - } |
116 | | - |
117 | 104 | public HarmBlockMethod getMethod() { |
118 | 105 | return this.method; |
119 | 106 | } |
120 | 107 |
|
121 | | - public void setMethod(HarmBlockMethod method) { |
122 | | - this.method = method; |
123 | | - } |
124 | | - |
125 | 108 | @Override |
126 | 109 | public String toString() { |
127 | 110 | return "SafetySetting{" + "category=" + this.category + ", threshold=" + this.threshold + ", method=" |
|
0 commit comments