Polishing
`@since` missing tags in some methods related to the HttpHeaders change
This commit is contained in:
parent
f025d60b92
commit
eb9ee9fafa
|
@ -91,6 +91,7 @@ public class HttpHeadersAssert extends AbstractObjectAssert<HttpHeadersAssert, H
|
|||
* Verify that the actual HTTP headers contain only the headers with the
|
||||
* given {@code names}, in any order and in a case-insensitive manner.
|
||||
* @param names the names of expected HTTP headers
|
||||
* @since 7.0
|
||||
*/
|
||||
public HttpHeadersAssert containsOnlyHeaders(String... names) {
|
||||
this.namesAssert
|
||||
|
@ -170,6 +171,7 @@ public class HttpHeadersAssert extends AbstractObjectAssert<HttpHeadersAssert, H
|
|||
* the given list of values, and in the same order.
|
||||
* @param name the considered header name (case-insensitive)
|
||||
* @param values the exhaustive list of expected values
|
||||
* @since 7.0
|
||||
*/
|
||||
public HttpHeadersAssert hasExactlyValues(String name, List<String> values) {
|
||||
containsHeader(name);
|
||||
|
@ -184,6 +186,7 @@ public class HttpHeadersAssert extends AbstractObjectAssert<HttpHeadersAssert, H
|
|||
* the given list of values, in any order.
|
||||
* @param name the considered header name (case-insensitive)
|
||||
* @param values the exhaustive list of expected values
|
||||
* @since 7.0
|
||||
*/
|
||||
public HttpHeadersAssert hasExactlyValuesInAnyOrder(String name, List<String> values) {
|
||||
containsHeader(name);
|
||||
|
@ -296,6 +299,7 @@ public class HttpHeadersAssert extends AbstractObjectAssert<HttpHeadersAssert, H
|
|||
* Verify that the number actual headers is the same as in the given
|
||||
* {@code HttpHeaders}.
|
||||
* @param other the {@code HttpHeaders} to compare size with
|
||||
* @since 7.0
|
||||
*/
|
||||
public HttpHeadersAssert hasSameSizeAs(HttpHeaders other) {
|
||||
this.namesAssert
|
||||
|
|
|
@ -496,7 +496,7 @@ public class HttpHeaders implements Serializable {
|
|||
* Get the list of header values for the given header name, if any.
|
||||
* @param headerName the header name
|
||||
* @return the list of header values, or an empty list
|
||||
* @since 5.2
|
||||
* @since 7.0
|
||||
*/
|
||||
public List<String> getOrEmpty(String headerName) {
|
||||
return getOrDefault(headerName, Collections.emptyList());
|
||||
|
@ -508,6 +508,7 @@ public class HttpHeaders implements Serializable {
|
|||
* @param headerName the header name
|
||||
* @param defaultValue the fallback list if header is not present
|
||||
* @return the list of header values, or a default list of values
|
||||
* @since 7.0
|
||||
*/
|
||||
public List<String> getOrDefault(String headerName, List<String> defaultValue) {
|
||||
List<String> values = get(headerName);
|
||||
|
@ -1796,6 +1797,7 @@ public class HttpHeaders implements Serializable {
|
|||
* values of each individual header name instead.
|
||||
* @param headers the headers to add
|
||||
* @see #putAll(HttpHeaders)
|
||||
* @since 7.0
|
||||
*/
|
||||
public void addAll(HttpHeaders headers) {
|
||||
this.headers.addAll(headers.headers);
|
||||
|
@ -1866,6 +1868,7 @@ public class HttpHeaders implements Serializable {
|
|||
* @deprecated This method is provided for backward compatibility with APIs
|
||||
* that would only accept maps. Generally avoid using HttpHeaders as a Map
|
||||
* or MultiValueMap.
|
||||
* @since 7.0
|
||||
*/
|
||||
@Deprecated
|
||||
public MultiValueMap<String, String> asMultiValueMap() {
|
||||
|
@ -1920,6 +1923,7 @@ public class HttpHeaders implements Serializable {
|
|||
/**
|
||||
* Get the list of values associated with the given header name.
|
||||
* @param headerName the header name
|
||||
* @since 7.0
|
||||
*/
|
||||
@Nullable
|
||||
public List<String> get(String headerName) {
|
||||
|
@ -1953,6 +1957,7 @@ public class HttpHeaders implements Serializable {
|
|||
* Put all the entries from the given HttpHeaders into this HttpHeaders.
|
||||
* @param headers the given headers
|
||||
* @see #put(String, List)
|
||||
* @since 7.0
|
||||
*/
|
||||
public void putAll(HttpHeaders headers) {
|
||||
this.headers.putAll(headers.headers);
|
||||
|
@ -1973,6 +1978,7 @@ public class HttpHeaders implements Serializable {
|
|||
* value list or {@code null} if that header wasn't present.
|
||||
* @param key the name of the header to remove
|
||||
* @return the value list associated with the removed header name
|
||||
* @since 7.0
|
||||
*/
|
||||
public @Nullable List<String> remove(String key) {
|
||||
return this.headers.remove(key);
|
||||
|
|
|
@ -85,7 +85,7 @@ public class RequestHeaderMapMethodArgumentResolver implements HandlerMethodArgu
|
|||
}
|
||||
}
|
||||
|
||||
void copyHeaderValues(NativeWebRequest webRequest, BiConsumer<String, String> consumer) {
|
||||
private void copyHeaderValues(NativeWebRequest webRequest, BiConsumer<String, String> consumer) {
|
||||
for (Iterator<String> iterator = webRequest.getHeaderNames(); iterator.hasNext();) {
|
||||
String headerName = iterator.next();
|
||||
String[] headerValues = webRequest.getHeaderValues(headerName);
|
||||
|
|
Loading…
Reference in New Issue