Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -122,7 +122,7 @@ class DefaultServerRequestBuilder implements ServerRequest.Builder {
|
||||
|
||||
@Override
|
||||
public ServerRequest.Builder header(String headerName, String... headerValues) {
|
||||
Assert.notNull(headerName, "Header Name must not be null");
|
||||
Assert.notNull(headerName, "Header name must not be null");
|
||||
for (String headerValue : headerValues) {
|
||||
this.headers.add(headerName, headerValue);
|
||||
}
|
||||
@@ -131,14 +131,14 @@ class DefaultServerRequestBuilder implements ServerRequest.Builder {
|
||||
|
||||
@Override
|
||||
public ServerRequest.Builder headers(Consumer<HttpHeaders> headersConsumer) {
|
||||
Assert.notNull(headersConsumer, "Header Consumer must not be null");
|
||||
Assert.notNull(headersConsumer, "Headers consumer must not be null");
|
||||
headersConsumer.accept(this.headers);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerRequest.Builder cookie(String name, String... values) {
|
||||
Assert.notNull(name, "Cookie Name must not be null");
|
||||
Assert.notNull(name, "Cookie name must not be null");
|
||||
for (String value : values) {
|
||||
this.cookies.add(name, new HttpCookie(name, value));
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class DefaultServerRequestBuilder implements ServerRequest.Builder {
|
||||
|
||||
@Override
|
||||
public ServerRequest.Builder cookies(Consumer<MultiValueMap<String, HttpCookie>> cookiesConsumer) {
|
||||
Assert.notNull(cookiesConsumer, "Cookie Consumer must not be null");
|
||||
Assert.notNull(cookiesConsumer, "Cookies consumer must not be null");
|
||||
cookiesConsumer.accept(this.cookies);
|
||||
return this;
|
||||
}
|
||||
@@ -178,14 +178,14 @@ class DefaultServerRequestBuilder implements ServerRequest.Builder {
|
||||
|
||||
@Override
|
||||
public ServerRequest.Builder attribute(String name, Object value) {
|
||||
Assert.notNull(name, "name must not be null");
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
this.attributes.put(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerRequest.Builder attributes(Consumer<Map<String, Object>> attributesConsumer) {
|
||||
Assert.notNull(attributesConsumer, "AttributesConsumer must not be null");
|
||||
Assert.notNull(attributesConsumer, "Attributes consumer must not be null");
|
||||
attributesConsumer.accept(this.attributes);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user