Browse Source

Polishing

pull/35813/head
Sam Brannen 5 months ago
parent
commit
d37030b9e1
  1. 20
      spring-web/src/main/java/org/springframework/http/HttpHeaders.java

20
spring-web/src/main/java/org/springframework/http/HttpHeaders.java

@ -1614,7 +1614,6 @@ public class HttpHeaders implements Serializable {
// ignore // ignore
} }
} }
} }
if (rejectInvalid) { if (rejectInvalid) {
throw new IllegalArgumentException("Cannot parse date value \"" + headerValue + throw new IllegalArgumentException("Cannot parse date value \"" + headerValue +
@ -1900,7 +1899,7 @@ public class HttpHeaders implements Serializable {
// Map-like implementation // Map-like implementation
/** /**
* Returns {@code true} if this HttpHeaders contains no header entry. * Returns {@code true} if this HttpHeaders contains no header entries.
*/ */
public boolean isEmpty() { public boolean isEmpty() {
return this.headers.isEmpty(); return this.headers.isEmpty();
@ -1944,7 +1943,7 @@ public class HttpHeaders implements Serializable {
/** /**
* Get the list of values associated with the given header name, or null. * Get the list of values associated with the given header name, or null.
* <p>To ensure support for double-quoted values, see also * <p>To ensure support for double-quoted values, use
* {@link #getValuesAsList(String)}. * {@link #getValuesAsList(String)}.
* @param headerName the header name * @param headerName the header name
* @since 7.0 * @since 7.0
@ -2000,7 +1999,7 @@ public class HttpHeaders implements Serializable {
* Remove a header from this HttpHeaders instance, and return the associated * Remove a header from this HttpHeaders instance, and return the associated
* value list or {@code null} if that header wasn't present. * value list or {@code null} if that header wasn't present.
* @param key the name of the header to remove * @param key the name of the header to remove
* @return the value list associated with the removed header name * @return the value list associated with the removed header name or {@code null}
* @since 7.0 * @since 7.0
*/ */
public @Nullable List<String> remove(String key) { public @Nullable List<String> remove(String key) {
@ -2015,8 +2014,9 @@ public class HttpHeaders implements Serializable {
} }
/** /**
* Return the number of headers in the collection. This can be inflated, * Return the number of headers in the collection.
* see {@link HttpHeaders class level javadoc}. * <p>This can be inflated: see the {@link HttpHeaders class level javadoc}
* for details.
*/ */
public int size() { public int size() {
return this.headers.size(); return this.headers.size();
@ -2033,7 +2033,7 @@ public class HttpHeaders implements Serializable {
/** /**
* Return a view of the headers as an entry {@code Set} of key-list pairs. * Return a view of the headers as an entry {@code Set} of key-list pairs.
* Both {@link Iterator#remove()} and {@link Entry#setValue} * <p>Both {@link Iterator#remove()} and {@link Entry#setValue}
* are supported and mutate the headers. * are supported and mutate the headers.
* <p>This collection is guaranteed to contain one entry per header name * <p>This collection is guaranteed to contain one entry per header name
* even if the backing structure stores multiple casing variants of names, * even if the backing structure stores multiple casing variants of names,
@ -2048,8 +2048,9 @@ public class HttpHeaders implements Serializable {
} }
/** /**
* Return the set of header names. Both {@link Set#remove(Object)} and * Return the set of header names.
* {@link Set#clear()} operations are supported and mutate the headers. * <p>Both {@link Set#remove(Object)} and {@link Set#clear()} operations are
* supported and mutate the headers.
* <p>This collection is guaranteed to contain only one casing variant * <p>This collection is guaranteed to contain only one casing variant
* of each header name even if the backing structure stores multiple casing * of each header name even if the backing structure stores multiple casing
* variants of names. The first encountered variant is the one that is * variants of names. The first encountered variant is the one that is
@ -2231,7 +2232,6 @@ public class HttpHeaders implements Serializable {
private static class HeaderNamesIterator implements Iterator<String> { private static class HeaderNamesIterator implements Iterator<String> {
private @Nullable String currentName; private @Nullable String currentName;
private final MultiValueMap<String, String> headers; private final MultiValueMap<String, String> headers;

Loading…
Cancel
Save