Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
`@since` missing tags in some methods related to the HttpHeaders change
  • Loading branch information
simonbasle committed Dec 27, 2024
1 parent f025d60 commit eb9ee9f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public HttpHeadersAssert containsHeaders(String... names) {
* 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
Expand Down Expand Up @@ -170,6 +171,7 @@ public HttpHeadersAssert hasValue(String name, Instant value) {
* 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);
Expand All @@ -184,6 +186,7 @@ public HttpHeadersAssert hasExactlyValues(String name, List<String> values) {
* 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);
Expand Down Expand Up @@ -296,6 +299,7 @@ public HttpHeadersAssert hasSizeBetween(int lowerBoundary, int higherBoundary) {
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public HttpHeaders(HttpHeaders httpHeaders) {
* 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());
Expand All @@ -508,6 +508,7 @@ public List<String> getOrEmpty(String headerName) {
* @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);
Expand Down Expand Up @@ -1796,6 +1797,7 @@ public void addAll(String headerName, List<? extends String> headerValues) {
* 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);
Expand Down Expand Up @@ -1866,6 +1868,7 @@ public Map<String, String> asSingleValueMap() {
* @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() {
Expand Down Expand Up @@ -1920,6 +1923,7 @@ public boolean containsHeaderValue(String headerName, String value) {
/**
* 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) {
Expand Down Expand Up @@ -1953,6 +1957,7 @@ public List<String> get(String headerName) {
* 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);
Expand All @@ -1973,6 +1978,7 @@ public void putAll(Map<? extends String, ? extends List<String>> headers) {
* 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ else if (MultiValueMap.class.isAssignableFrom(paramType)) {
}
}

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);
Expand Down

0 comments on commit eb9ee9f

Please sign in to comment.