@@ -113,23 +113,33 @@ public interface ProblemBuilder {
113113 * @param extensions map of extension keys and values
114114 * @return this builder instance for chaining
115115 */
116- ProblemBuilder extension (Map <String , Object > extensions );
116+ ProblemBuilder extensions (Map <String , Object > extensions );
117+
118+ /**
119+ * Adds multiple custom extensions from varargs of {@link Problem.Extension}.
120+ *
121+ * @param extension array of extensions
122+ * @return this builder instance for chaining
123+ */
124+ default ProblemBuilder extension (Problem .Extension extension ) {
125+ return extensions (extension );
126+ }
117127
118128 /**
119129 * Adds multiple custom extensions from varargs of {@link Problem.Extension}.
120130 *
121131 * @param extensions array of extensions
122132 * @return this builder instance for chaining
123133 */
124- ProblemBuilder extension (Problem .Extension ... extensions );
134+ ProblemBuilder extensions (Problem .Extension ... extensions );
125135
126136 /**
127137 * Adds multiple custom extensions from a collection of {@link Problem.Extension}.
128138 *
129139 * @param extensions collection of extensions
130140 * @return this builder instance for chaining
131141 */
132- ProblemBuilder extension (Collection <? extends Problem .Extension > extensions );
142+ ProblemBuilder extensions (Collection <? extends Problem .Extension > extensions );
133143
134144 /**
135145 * Builds an immutable {@link Problem} instance with the configured properties and extensions.
@@ -151,4 +161,49 @@ public interface ProblemBuilder {
151161 * @return a new {@link Problem} instance
152162 */
153163 Problem build ();
164+
165+ /**
166+ * Adds multiple custom extensions from a map.
167+ *
168+ * <p><b>Deprecated</b> due to confusing name as singular "extension" suggests adding a single
169+ * extension, while the method actually adds multiple extensions from the provided map.
170+ *
171+ * @param extensions map of extension keys and values
172+ * @return this builder instance for chaining
173+ * @deprecated use {@link #extensions(Map)} instead
174+ */
175+ @ Deprecated
176+ default ProblemBuilder extension (Map <String , Object > extensions ) {
177+ return extensions (extensions );
178+ }
179+
180+ /**
181+ * Adds multiple custom extensions from varargs of {@link Problem.Extension}.
182+ *
183+ * <p><b>Deprecated</b> due to confusing name as singular "extension" suggests adding a single
184+ * extension, while the method actually adds multiple extensions from the provided vararg.
185+ *
186+ * @param extensions array of extensions
187+ * @return this builder instance for chaining
188+ * @deprecated use {@link #extensions(Problem.Extension...)} instead
189+ */
190+ @ Deprecated
191+ default ProblemBuilder extension (Problem .Extension ... extensions ) {
192+ return extensions (extensions );
193+ }
194+
195+ /**
196+ * Adds multiple custom extensions from a collection of {@link Problem.Extension}.
197+ *
198+ * <p><b>Deprecated</b> due to confusing name as singular "extension" suggests adding a single
199+ * extension, while the method actually adds multiple extensions from the provided collection.
200+ *
201+ * @param extensions collection of extensions
202+ * @return this builder instance for chaining
203+ * @deprecated use {@link #extensions(Collection)} instead
204+ */
205+ @ Deprecated
206+ default ProblemBuilder extension (Collection <? extends Problem .Extension > extensions ) {
207+ return extensions (extensions );
208+ }
154209}
0 commit comments