@@ -115,6 +115,7 @@ public ServerRequest.Builder uri(URI uri) {
115
115
116
116
@ Override
117
117
public ServerRequest .Builder header (String headerName , String ... headerValues ) {
118
+ Assert .notNull (headerName , "Header Name must not be null" );
118
119
for (String headerValue : headerValues ) {
119
120
this .headers .add (headerName , headerValue );
120
121
}
@@ -123,12 +124,14 @@ public ServerRequest.Builder header(String headerName, String... headerValues) {
123
124
124
125
@ Override
125
126
public ServerRequest .Builder headers (Consumer <HttpHeaders > headersConsumer ) {
127
+ Assert .notNull (headersConsumer , "Header Consumer must not be null" );
126
128
headersConsumer .accept (this .headers );
127
129
return this ;
128
130
}
129
131
130
132
@ Override
131
133
public ServerRequest .Builder cookie (String name , String ... values ) {
134
+ Assert .notNull (name , "Cookie Name must not be null" );
132
135
for (String value : values ) {
133
136
this .cookies .add (name , new Cookie (name , value ));
134
137
}
@@ -137,36 +140,41 @@ public ServerRequest.Builder cookie(String name, String... values) {
137
140
138
141
@ Override
139
142
public ServerRequest .Builder cookies (Consumer <MultiValueMap <String , Cookie >> cookiesConsumer ) {
143
+ Assert .notNull (cookiesConsumer , "Cookie Consumer must not be null" );
140
144
cookiesConsumer .accept (this .cookies );
141
145
return this ;
142
146
}
143
147
144
148
@ Override
145
149
public ServerRequest .Builder body (byte [] body ) {
150
+ Assert .notNull (body , "body must not be null" );
146
151
this .body = body ;
147
152
return this ;
148
153
}
149
154
150
155
@ Override
151
156
public ServerRequest .Builder body (String body ) {
157
+ Assert .notNull (body , "body must not be null" );
152
158
return body (body .getBytes (StandardCharsets .UTF_8 ));
153
159
}
154
160
155
161
@ Override
156
162
public ServerRequest .Builder attribute (String name , Object value ) {
157
- Assert .notNull (name , "' name' must not be null" );
163
+ Assert .notNull (name , "name must not be null" );
158
164
this .attributes .put (name , value );
159
165
return this ;
160
166
}
161
167
162
168
@ Override
163
169
public ServerRequest .Builder attributes (Consumer <Map <String , Object >> attributesConsumer ) {
170
+ Assert .notNull (attributesConsumer , "AttributesConsumer must not be null" );
164
171
attributesConsumer .accept (this .attributes );
165
172
return this ;
166
173
}
167
174
168
175
@ Override
169
176
public ServerRequest .Builder param (String name , String ... values ) {
177
+ Assert .notNull (name , "name must not be null" );
170
178
for (String value : values ) {
171
179
this .params .add (name , value );
172
180
}
@@ -175,12 +183,13 @@ public ServerRequest.Builder param(String name, String... values) {
175
183
176
184
@ Override
177
185
public ServerRequest .Builder params (Consumer <MultiValueMap <String , String >> paramsConsumer ) {
186
+ Assert .notNull (paramsConsumer , "paramsConsumer must not be null" );
178
187
paramsConsumer .accept (this .params );
179
188
return this ;
180
189
}
181
190
182
191
@ Override
183
- public ServerRequest .Builder remoteAddress (InetSocketAddress remoteAddress ) {
192
+ public ServerRequest .Builder remoteAddress (@ Nullable InetSocketAddress remoteAddress ) {
184
193
this .remoteAddress = remoteAddress ;
185
194
return this ;
186
195
}
0 commit comments