@@ -86,50 +86,113 @@ public static Builder create(final String attachmentName) {
8686 return new Builder (attachmentName );
8787 }
8888
89- public Builder withUrl (final String url ) {
89+ public Builder setUrl (final String url ) {
9090 Objects .requireNonNull (url , "Url must not be null value" );
9191 this .url = url ;
9292 return this ;
9393 }
9494
95- public Builder withResponseCode (final int responseCode ) {
95+ public Builder setResponseCode (final int responseCode ) {
9696 Objects .requireNonNull (responseCode , "Response code must not be null value" );
9797 this .responseCode = responseCode ;
9898 return this ;
9999 }
100100
101- public Builder withHeader (final String name , final String value ) {
101+ public Builder setHeader (final String name , final String value ) {
102102 Objects .requireNonNull (name , "Header name must not be null value" );
103103 Objects .requireNonNull (value , "Header value must not be null value" );
104104 this .headers .put (name , value );
105105 return this ;
106106 }
107107
108- public Builder withHeaders (final Map <String , String > headers ) {
108+ public Builder setHeaders (final Map <String , String > headers ) {
109109 Objects .requireNonNull (headers , "Headers must not be null value" );
110110 this .headers .putAll (headers );
111111 return this ;
112112 }
113113
114- public Builder withCookie (final String name , final String value ) {
114+ public Builder setCookie (final String name , final String value ) {
115115 Objects .requireNonNull (name , "Cookie name must not be null value" );
116116 Objects .requireNonNull (value , "Cookie value must not be null value" );
117117 this .cookies .put (name , value );
118118 return this ;
119119 }
120120
121- public Builder withCookies (final Map <String , String > cookies ) {
121+ public Builder setCookies (final Map <String , String > cookies ) {
122122 Objects .requireNonNull (cookies , "Cookies must not be null value" );
123123 this .cookies .putAll (cookies );
124124 return this ;
125125 }
126126
127- public Builder withBody (final String body ) {
127+ public Builder setBody (final String body ) {
128128 Objects .requireNonNull (body , "Body should not be null value" );
129129 this .body = body ;
130130 return this ;
131131 }
132132
133+ /**
134+ * Use setter method instead.
135+ * @deprecated scheduled for removal in 3.0 release
136+ */
137+ @ Deprecated
138+ public Builder withUrl (final String url ) {
139+ return setUrl (url );
140+ }
141+
142+ /**
143+ * Use setter method instead.
144+ * @deprecated scheduled for removal in 3.0 release
145+ */
146+ @ Deprecated
147+ public Builder withResponseCode (final int responseCode ) {
148+ return setResponseCode (responseCode );
149+ }
150+
151+ /**
152+ * Use setter method instead.
153+ * @deprecated scheduled for removal in 3.0 release
154+ */
155+ @ Deprecated
156+ public Builder withHeader (final String name , final String value ) {
157+ return setHeader (name , value );
158+ }
159+
160+ /**
161+ * Use setter method instead.
162+ * @deprecated scheduled for removal in 3.0 release
163+ */
164+ @ Deprecated
165+ public Builder withHeaders (final Map <String , String > headers ) {
166+ return setHeaders (headers );
167+ }
168+
169+ /**
170+ * Use setter method instead.
171+ * @deprecated scheduled for removal in 3.0 release
172+ */
173+ @ Deprecated
174+ public Builder withCookie (final String name , final String value ) {
175+ return setCookie (name , value );
176+ }
177+
178+ /**
179+ * Use setter method instead.
180+ * @deprecated scheduled for removal in 3.0 release
181+ */
182+ @ Deprecated
183+ public Builder withCookies (final Map <String , String > cookies ) {
184+ return setCookies (cookies );
185+ }
186+
187+ /**
188+ * Use setter method instead.
189+ * @deprecated scheduled for removal in 3.0 release
190+ */
191+ @ Deprecated
192+ public Builder withBody (final String body ) {
193+ return setBody (body );
194+ }
195+
133196 public HttpResponseAttachment build () {
134197 return new HttpResponseAttachment (name , url , body , responseCode , headers , cookies );
135198 }
0 commit comments