public class HttpHeaders extends Object implements MultiValueMap<String,String>, Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ACCEPT
The HTTP
Accept header field name. |
static String |
ACCEPT_CHARSET
The HTTP
Accept-Charset header field name. |
static String |
ACCEPT_ENCODING
The HTTP
Accept-Encoding header field name. |
static String |
ACCEPT_LANGUAGE
The HTTP
Accept-Language header field name. |
static String |
ACCEPT_RANGES
The HTTP
Accept-Ranges header field name. |
static String |
ACCESS_CONTROL_ALLOW_CREDENTIALS
The CORS
Access-Control-Allow-Credentials response header field name. |
static String |
ACCESS_CONTROL_ALLOW_HEADERS
The CORS
Access-Control-Allow-Headers response header field name. |
static String |
ACCESS_CONTROL_ALLOW_METHODS
The CORS
Access-Control-Allow-Methods response header field name. |
static String |
ACCESS_CONTROL_ALLOW_ORIGIN
The CORS
Access-Control-Allow-Origin response header field name. |
static String |
ACCESS_CONTROL_EXPOSE_HEADERS
The CORS
Access-Control-Expose-Headers response header field name. |
static String |
ACCESS_CONTROL_MAX_AGE
The CORS
Access-Control-Max-Age response header field name. |
static String |
ACCESS_CONTROL_REQUEST_HEADERS
The CORS
Access-Control-Request-Headers request header field name. |
static String |
ACCESS_CONTROL_REQUEST_METHOD
The CORS
Access-Control-Request-Method request header field name. |
static String |
AGE
The HTTP
Age header field name. |
static String |
ALLOW
The HTTP
Allow header field name. |
static String |
AUTHORIZATION
The HTTP
Authorization header field name. |
static String |
CACHE_CONTROL
The HTTP
Cache-Control header field name. |
static String |
CONNECTION
The HTTP
Connection header field name. |
static String |
CONTENT_DISPOSITION
The HTTP
Content-Disposition header field name. |
static String |
CONTENT_ENCODING
The HTTP
Content-Encoding header field name. |
static String |
CONTENT_LANGUAGE
The HTTP
Content-Language header field name. |
static String |
CONTENT_LENGTH
The HTTP
Content-Length header field name. |
static String |
CONTENT_LOCATION
The HTTP
Content-Location header field name. |
static String |
CONTENT_RANGE
The HTTP
Content-Range header field name. |
static String |
CONTENT_TYPE
The HTTP
Content-Type header field name. |
static String |
COOKIE
The HTTP
Cookie header field name. |
static String |
DATE
The HTTP
Date header field name. |
static HttpHeaders |
EMPTY
An empty
HttpHeaders instance (immutable). |
static String |
ETAG
The HTTP
ETag header field name. |
static String |
EXPECT
The HTTP
Expect header field name. |
static String |
EXPIRES
The HTTP
Expires header field name. |
static String |
FROM
The HTTP
From header field name. |
static String |
HOST
The HTTP
Host header field name. |
static String |
IF_MATCH
The HTTP
If-Match header field name. |
static String |
IF_MODIFIED_SINCE
The HTTP
If-Modified-Since header field name. |
static String |
IF_NONE_MATCH
The HTTP
If-None-Match header field name. |
static String |
IF_RANGE
The HTTP
If-Range header field name. |
static String |
IF_UNMODIFIED_SINCE
The HTTP
If-Unmodified-Since header field name. |
static String |
LAST_MODIFIED
The HTTP
Last-Modified header field name. |
static String |
LINK
The HTTP
Link header field name. |
static String |
LOCATION
The HTTP
Location header field name. |
static String |
MAX_FORWARDS
The HTTP
Max-Forwards header field name. |
static String |
ORIGIN
The HTTP
Origin header field name. |
static String |
PRAGMA
The HTTP
Pragma header field name. |
static String |
PROXY_AUTHENTICATE
The HTTP
Proxy-Authenticate header field name. |
static String |
PROXY_AUTHORIZATION
The HTTP
Proxy-Authorization header field name. |
static String |
RANGE
The HTTP
Range header field name. |
static String |
REFERER
The HTTP
Referer header field name. |
static String |
RETRY_AFTER
The HTTP
Retry-After header field name. |
static String |
SERVER
The HTTP
Server header field name. |
static String |
SET_COOKIE
The HTTP
Set-Cookie header field name. |
static String |
SET_COOKIE2
The HTTP
Set-Cookie2 header field name. |
static String |
TE
The HTTP
TE header field name. |
static String |
TRAILER
The HTTP
Trailer header field name. |
static String |
TRANSFER_ENCODING
The HTTP
Transfer-Encoding header field name. |
static String |
UPGRADE
The HTTP
Upgrade header field name. |
static String |
USER_AGENT
The HTTP
User-Agent header field name. |
static String |
VARY
The HTTP
Vary header field name. |
static String |
VIA
The HTTP
Via header field name. |
static String |
WARNING
The HTTP
Warning header field name. |
static String |
WWW_AUTHENTICATE
The HTTP
WWW-Authenticate header field name. |
| 构造器和说明 |
|---|
HttpHeaders()
Construct a new, empty instance of the
HttpHeaders object. |
HttpHeaders(MultiValueMap<String,String> headers)
Construct a new
HttpHeaders instance backed by an existing map. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(String headerName,
String headerValue)
Add the given, single header value under the given name.
|
void |
addAll(MultiValueMap<String,String> values)
Add all the values of the given
MultiValueMap to the current values. |
void |
addAll(String key,
Collection<? extends String> values)
Add all the values of the given list to the current list of values for the given key.
|
void |
addIfAbsent(String key,
String value)
|
void |
clear() |
void |
clearContentHeaders()
Remove the well-known
"Content-*" HTTP headers. |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static String |
encodeBasicAuth(String username,
String password,
Charset charset)
Encode the given username and password into Basic Authentication credentials.
|
Set<Map.Entry<String,Collection<String>>> |
entrySet() |
boolean |
equals(Object other) |
static String |
formatHeaders(MultiValueMap<String,String> headers)
Helps to format HTTP header values, as HTTP header values themselves can
contain comma-separated values, can become confusing with regular
Map formatting that also uses commas between entries. |
List<String> |
get(Object key) |
List<MediaType> |
getAccept()
Return the list of acceptable media types,
as specified by the
Accept header. |
List<Charset> |
getAcceptCharset()
Return the list of acceptable charsets,
as specified by the
Accept-Charset header. |
boolean |
getAccessControlAllowCredentials()
Return the value of the
Access-Control-Allow-Credentials response header. |
List<String> |
getAccessControlAllowHeaders()
Return the value of the
Access-Control-Allow-Headers response header. |
List<HttpMethod> |
getAccessControlAllowMethods()
Return the value of the
Access-Control-Allow-Methods response header. |
String |
getAccessControlAllowOrigin()
Return the value of the
Access-Control-Allow-Origin response header. |
List<String> |
getAccessControlExposeHeaders()
Return the value of the
Access-Control-Expose-Headers response header. |
long |
getAccessControlMaxAge()
Return the value of the
Access-Control-Max-Age response header. |
List<String> |
getAccessControlRequestHeaders()
Return the value of the
Access-Control-Request-Headers request header. |
HttpMethod |
getAccessControlRequestMethod()
Return the value of the
Access-Control-Request-Method request header. |
Set<HttpMethod> |
getAllow()
Return the set of allowed
HTTP methods,
as specified by the Allow header. |
String |
getCacheControl()
Return the value of the
Cache-Control header. |
List<String> |
getConnection()
Return the value of the
Connection header. |
Locale |
getContentLanguage()
Return the first
Locale of the content languages,
as specified by the Content-Language header. |
long |
getContentLength()
Return the length of the body in bytes, as specified by the
Content-Length header. |
MediaType |
getContentType()
Return the media type of the body, as specified
by the
Content-Type header. |
String |
getETag()
Return the entity tag of the body, as specified by the
ETag header. |
protected List<String> |
getETagValuesAsList(String headerName)
Retrieve a combined result from the field values of the ETag header.
|
Date |
getExpires() |
protected String |
getFieldValues(String headerName)
Retrieve a combined result from the field values of multi-valued headers.
|
String |
getFirst(String headerName)
Return the first header value for the given header name, if any.
|
InetSocketAddress |
getHost()
Return the value of the
Host header, if available. |
List<String> |
getIfMatch()
Return the value of the
If-Match header. |
List<String> |
getIfNoneMatch()
Return the value of the
If-None-Match header. |
URI |
getLocation()
Return the (new) location of a resource
as specified by the
Location header. |
List<String> |
getOrEmpty(Object headerName)
Get the list of header values for the given header name, if any.
|
String |
getOrigin()
Return the value of the
Origin header. |
String |
getPragma()
Return the value of the
Pragma header. |
List<HttpRange> |
getRange()
Return the value of the
Range header. |
String |
getUpgrade()
Return the value of the
Upgrade header. |
List<String> |
getValuesAsList(String headerName)
Return all values of a given header name,
even if this header is set multiple times.
|
List<String> |
getVary()
Return the request header names subject to content negotiation.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<String> |
keySet() |
Collection<String> |
put(String key,
Collection<String> value) |
void |
putAll(Map<? extends String,? extends Collection<String>> map) |
Collection<String> |
remove(Object key) |
void |
set(String headerName,
String headerValue)
Set the given, single header value under the given name.
|
void |
setAccept(List<MediaType> acceptableMediaTypes)
Set the list of acceptable media types,
as specified by the
Accept header. |
void |
setAcceptCharset(List<Charset> acceptableCharsets)
Set the list of acceptable charsets,
as specified by the
Accept-Charset header. |
void |
setAccessControlAllowCredentials(boolean allowCredentials)
Set the (new) value of the
Access-Control-Allow-Credentials response header. |
void |
setAccessControlAllowHeaders(List<String> allowedHeaders)
Set the (new) value of the
Access-Control-Allow-Headers response header. |
void |
setAccessControlAllowMethods(List<HttpMethod> allowedMethods)
Set the (new) value of the
Access-Control-Allow-Methods response header. |
void |
setAccessControlAllowOrigin(String allowedOrigin)
Set the (new) value of the
Access-Control-Allow-Origin response header. |
void |
setAccessControlExposeHeaders(List<String> exposedHeaders)
Set the (new) value of the
Access-Control-Expose-Headers response header. |
void |
setAccessControlMaxAge(long maxAge)
Set the (new) value of the
Access-Control-Max-Age response header. |
void |
setAccessControlRequestHeaders(List<String> requestHeaders)
Set the (new) value of the
Access-Control-Request-Headers request header. |
void |
setAccessControlRequestMethod(HttpMethod requestMethod)
Set the (new) value of the
Access-Control-Request-Method request header. |
void |
setAll(Map<String,String> values)
Set the given values under.
|
void |
setAllow(Set<HttpMethod> allowedMethods)
Set the set of allowed
HTTP methods,
as specified by the Allow header. |
void |
setBasicAuth(String encodedCredentials)
Set the value of the Authorization header to
Basic Authentication based on the given encoded credentials.
|
void |
setBasicAuth(String username,
String password)
Set the value of the Authorization header to
Basic Authentication based on the given username and password.
|
void |
setBasicAuth(String username,
String password,
Charset charset)
Set the value of the Authorization header to
Basic Authentication based on the given username and password.
|
void |
setBearerAuth(String token)
Set the value of the Authorization header to
the given Bearer token.
|
void |
setCacheControl(String cacheControl)
Set the (new) value of the
Cache-Control header. |
void |
setConnection(List<String> connection)
Set the (new) value of the
Connection header. |
void |
setConnection(String connection)
Set the (new) value of the
Connection header. |
void |
setContentLength(long contentLength)
Set the length of the body in bytes, as specified by the
Content-Length header. |
void |
setContentType(MediaType mediaType)
Set the media type of the body,
as specified by the
Content-Type header. |
void |
setETag(String etag)
Set the (new) entity tag of the body, as specified by the
ETag header. |
void |
setExpires(long time) |
void |
setHost(NetworkAddress host)
Set the (new) value of the
Host header. |
void |
setIfMatch(List<String> ifMatchList)
Set the (new) value of the
If-Match header. |
void |
setIfMatch(String ifMatch)
Set the (new) value of the
If-Match header. |
void |
setIfNoneMatch(List<String> ifNoneMatchList)
Set the (new) values of the
If-None-Match header. |
void |
setIfNoneMatch(String ifNoneMatch)
Set the (new) value of the
If-None-Match header. |
void |
setLocation(URI location)
Set the (new) location of a resource,
as specified by the
Location header. |
void |
setOrigin(String origin)
Set the (new) value of the
Origin header. |
void |
setPragma(String pragma)
Set the (new) value of the
Pragma header. |
void |
setRange(List<HttpRange> ranges)
Sets the (new) value of the
Range header. |
void |
setUpgrade(String upgrade)
Set the (new) value of the
Upgrade header. |
void |
setVary(List<String> requestHeaders)
Set the request header names (e.g.
|
int |
size() |
protected String |
toCommaDelimitedString(List<String> headerValues)
Turn the given list of header values into a comma-delimited result.
|
Map<String,String> |
toSingleValueMap()
Return a
Map with the first values contained in this MultiValueMap. |
String |
toString() |
int |
total() |
Collection<Collection<String>> |
values() |
static HttpHeaders |
writableHttpHeaders(HttpHeaders headers)
Return an
HttpHeaders object that can be read and written to. |
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic static final String ACCEPT
Accept header field name.public static final String ACCEPT_CHARSET
Accept-Charset header field name.public static final String ACCEPT_ENCODING
Accept-Encoding header field name.public static final String ACCEPT_LANGUAGE
Accept-Language header field name.public static final String ACCEPT_RANGES
Accept-Ranges header field name.public static final String ACCESS_CONTROL_ALLOW_CREDENTIALS
Access-Control-Allow-Credentials response header field name.public static final String ACCESS_CONTROL_ALLOW_HEADERS
Access-Control-Allow-Headers response header field name.public static final String ACCESS_CONTROL_ALLOW_METHODS
Access-Control-Allow-Methods response header field name.public static final String ACCESS_CONTROL_ALLOW_ORIGIN
Access-Control-Allow-Origin response header field name.public static final String ACCESS_CONTROL_EXPOSE_HEADERS
Access-Control-Expose-Headers response header field name.public static final String ACCESS_CONTROL_MAX_AGE
Access-Control-Max-Age response header field name.public static final String ACCESS_CONTROL_REQUEST_HEADERS
Access-Control-Request-Headers request header field name.public static final String ACCESS_CONTROL_REQUEST_METHOD
Access-Control-Request-Method request header field name.public static final String AGE
Age header field name.public static final String ALLOW
Allow header field name.public static final String AUTHORIZATION
Authorization header field name.public static final String CACHE_CONTROL
Cache-Control header field name.public static final String CONNECTION
Connection header field name.public static final String CONTENT_ENCODING
Content-Encoding header field name.public static final String CONTENT_DISPOSITION
Content-Disposition header field name.public static final String CONTENT_LANGUAGE
Content-Language header field name.public static final String CONTENT_LENGTH
Content-Length header field name.public static final String CONTENT_LOCATION
Content-Location header field name.public static final String CONTENT_RANGE
Content-Range header field name.public static final String CONTENT_TYPE
Content-Type header field name.public static final String COOKIE
Cookie header field name.public static final String DATE
Date header field name.public static final String ETAG
ETag header field name.public static final String EXPECT
Expect header field name.public static final String EXPIRES
Expires header field name.public static final String FROM
From header field name.public static final String HOST
Host header field name.public static final String IF_MATCH
If-Match header field name.public static final String IF_MODIFIED_SINCE
If-Modified-Since header field name.public static final String IF_NONE_MATCH
If-None-Match header field name.public static final String IF_RANGE
If-Range header field name.public static final String IF_UNMODIFIED_SINCE
If-Unmodified-Since header field name.public static final String LAST_MODIFIED
Last-Modified header field name.public static final String LOCATION
Location header field name.public static final String MAX_FORWARDS
Max-Forwards header field name.public static final String PRAGMA
Pragma header field name.public static final String PROXY_AUTHENTICATE
Proxy-Authenticate header field name.public static final String PROXY_AUTHORIZATION
Proxy-Authorization header field name.public static final String RANGE
Range header field name.public static final String REFERER
Referer header field name.public static final String RETRY_AFTER
Retry-After header field name.public static final String SERVER
Server header field name.public static final String SET_COOKIE
Set-Cookie header field name.public static final String SET_COOKIE2
Set-Cookie2 header field name.public static final String TE
TE header field name.public static final String TRAILER
Trailer header field name.public static final String TRANSFER_ENCODING
Transfer-Encoding header field name.public static final String UPGRADE
Upgrade header field name.public static final String USER_AGENT
User-Agent header field name.public static final String VARY
Vary header field name.public static final String VIA
Via header field name.public static final String WARNING
Warning header field name.public static final String WWW_AUTHENTICATE
WWW-Authenticate header field name.public static final HttpHeaders EMPTY
HttpHeaders instance (immutable).public HttpHeaders()
HttpHeaders object.
This is the common constructor, using a case-insensitive map structure.
public HttpHeaders(MultiValueMap<String,String> headers)
HttpHeaders instance backed by an existing map.
This constructor is available as an optimization for adapting to existing headers map structures, primarily for internal use within the framework.
headers - the headers map (expected to operate with case-insensitive keys)public static HttpHeaders writableHttpHeaders(HttpHeaders headers)
HttpHeaders object that can be read and written to.public static String formatHeaders(MultiValueMap<String,String> headers)
Map formatting that also uses commas between entries.headers - the headers to formatpublic static String encodeBasicAuth(String username, String password, @Nullable Charset charset)
The encoded credentials returned by this method can be supplied to
setBasicAuth(String) to set the Basic Authentication header.
username - the usernamepassword - the passwordcharset - the charset to use to convert the credentials into an octet
sequence. Defaults to Charsets.ISO_8859_1.IllegalArgumentException - if username or password
contains characters that cannot be encoded to the given charsetsetBasicAuth(String),
setBasicAuth(String, String),
setBasicAuth(String, String, Charset),
RFC 7617public List<String> getOrEmpty(Object headerName)
headerName - the header namepublic List<MediaType> getAccept()
Accept header.
Returns an empty list when the acceptable media types are unspecified.
public void setAccept(List<MediaType> acceptableMediaTypes)
Accept header.public boolean getAccessControlAllowCredentials()
Access-Control-Allow-Credentials response header.public void setAccessControlAllowCredentials(boolean allowCredentials)
Access-Control-Allow-Credentials response header.public List<String> getAccessControlAllowHeaders()
Access-Control-Allow-Headers response header.public void setAccessControlAllowHeaders(List<String> allowedHeaders)
Access-Control-Allow-Headers response header.public List<HttpMethod> getAccessControlAllowMethods()
Access-Control-Allow-Methods response header.public void setAccessControlAllowMethods(List<HttpMethod> allowedMethods)
Access-Control-Allow-Methods response header.@Nullable public String getAccessControlAllowOrigin()
Access-Control-Allow-Origin response header.public void setAccessControlAllowOrigin(@Nullable String allowedOrigin)
Access-Control-Allow-Origin response header.public List<String> getAccessControlExposeHeaders()
Access-Control-Expose-Headers response header.public void setAccessControlExposeHeaders(List<String> exposedHeaders)
Access-Control-Expose-Headers response header.public long getAccessControlMaxAge()
Access-Control-Max-Age response header.
Returns -1 when the max age is unknown.
public void setAccessControlMaxAge(long maxAge)
Access-Control-Max-Age response header.public List<String> getAccessControlRequestHeaders()
Access-Control-Request-Headers request header.public void setAccessControlRequestHeaders(List<String> requestHeaders)
Access-Control-Request-Headers request header.@Nullable public HttpMethod getAccessControlRequestMethod()
Access-Control-Request-Method request header.public void setAccessControlRequestMethod(@Nullable HttpMethod requestMethod)
Access-Control-Request-Method request header.public List<Charset> getAcceptCharset()
Accept-Charset header.public void setAcceptCharset(List<Charset> acceptableCharsets)
Accept-Charset header.public Set<HttpMethod> getAllow()
HTTP methods,
as specified by the Allow header.
Returns an empty set when the allowed methods are unspecified.
public void setAllow(Set<HttpMethod> allowedMethods)
HTTP methods,
as specified by the Allow header.public void setBasicAuth(String username, String password)
Note that this method only supports characters in the
ISO-8859-1 character set.
username - the usernamepassword - the passwordIllegalArgumentException - if either user or
password contain characters that cannot be encoded to ISO-8859-1setBasicAuth(String),
setBasicAuth(String, String, Charset),
encodeBasicAuth(String, String, Charset),
RFC 7617public void setBasicAuth(String username, String password, @Nullable Charset charset)
username - the usernamepassword - the passwordcharset - the charset to use to convert the credentials into an octet
sequence. Defaults to ISO-8859-1.IllegalArgumentException - if username or password
contains characters that cannot be encoded to the given charsetsetBasicAuth(String),
setBasicAuth(String, String),
encodeBasicAuth(String, String, Charset),
RFC 7617public void setBasicAuth(String encodedCredentials)
Favor this method over setBasicAuth(String, String) and
setBasicAuth(String, String, Charset) if you wish to cache the
encoded credentials.
encodedCredentials - the encoded credentialsIllegalArgumentException - if supplied credentials string is
null or blanksetBasicAuth(String, String),
setBasicAuth(String, String, Charset),
encodeBasicAuth(String, String, Charset),
RFC 7617public void setBearerAuth(String token)
token - the Base64 encoded token@Nullable public String getCacheControl()
Cache-Control header.public void setCacheControl(@Nullable String cacheControl)
Cache-Control header.public void setConnection(String connection)
Connection header.public void setConnection(List<String> connection)
Connection header.@Nullable public Locale getContentLanguage()
Locale of the content languages,
as specified by the Content-Language header.
Returns null when the content language is unknown.
Use getValuesAsList(CONTENT_LANGUAGE) if you need
to get multiple content languages.
public long getContentLength()
Content-Length header.
Returns -1 when the content-length is unknown.
public void setContentLength(long contentLength)
Content-Length header.@Nullable public MediaType getContentType()
Content-Type header.
Returns null when the content-type is unknown.
public void setContentType(@Nullable MediaType mediaType)
Content-Type header.@Nullable public String getETag()
ETag header.public void setETag(@Nullable String etag)
ETag header.@Nullable public InetSocketAddress getHost()
Host header, if available.
If the header value does not contain a port, the
port in the returned address will
be 0.
public void setHost(@Nullable NetworkAddress host)
Host header.
If the given port is 0,
the host header will only contain the
public List<String> getIfMatch()
If-Match header.IllegalArgumentException - if parsing failspublic void setIfMatch(String ifMatch)
If-Match header.public void setIfMatch(List<String> ifMatchList)
If-Match header.public List<String> getIfNoneMatch()
If-None-Match header.IllegalArgumentException - if parsing failspublic void setIfNoneMatch(String ifNoneMatch)
If-None-Match header.public void setIfNoneMatch(List<String> ifNoneMatchList)
If-None-Match header.@Nullable public URI getLocation()
Location header.
Returns null when the location is unknown.
public void setLocation(@Nullable URI location)
Location header.public List<HttpRange> getRange()
Range header.
Returns an empty list when the range is unknown.
public void setExpires(long time)
public Date getExpires()
public void setUpgrade(@Nullable String upgrade)
Upgrade header.public List<String> getVary()
public void setVary(List<String> requestHeaders)
requestHeaders - the request header namespublic List<String> getValuesAsList(String headerName)
headerName - the header namepublic void clearContentHeaders()
"Content-*" HTTP headers.
Such headers should be cleared from the response if the intended body can't be written due to errors.
protected List<String> getETagValuesAsList(String headerName)
headerName - the header nameIllegalArgumentException - if parsing fails@Nullable protected String getFieldValues(String headerName)
headerName - the header nameprotected String toCommaDelimitedString(List<String> headerValues)
headerValues - the list of header values@Nullable public String getFirst(String headerName)
getFirst 在接口中 MultiValueMap<String,String>headerName - the header namenull if nonepublic void add(String headerName, @Nullable String headerValue)
add 在接口中 MultiValueMap<String,String>headerName - the header nameheaderValue - the header valueUnsupportedOperationException - if adding headers is not supportedset(String, String)public void addAll(String key, Collection<? extends String> values)
MultiValueMapaddAll 在接口中 MultiValueMap<String,String>key - they keyvalues - the values to be addedpublic void addAll(MultiValueMap<String,String> values)
MultiValueMapMultiValueMap to the current values.addAll 在接口中 MultiValueMap<String,String>values - the values to be addedpublic void set(String headerName, @Nullable String headerValue)
set 在接口中 MultiValueMap<String,String>headerName - the header nameheaderValue - the header valueUnsupportedOperationException - if adding headers is not supportedadd(String, String)public void setAll(Map<String,String> values)
MultiValueMapsetAll 在接口中 MultiValueMap<String,String>values - the values.public Map<String,String> toSingleValueMap()
MultiValueMapMap with the first values contained in this MultiValueMap.toSingleValueMap 在接口中 MultiValueMap<String,String>public int size()
size 在接口中 Map<String,Collection<String>>public boolean isEmpty()
isEmpty 在接口中 Map<String,Collection<String>>public boolean containsKey(Object key)
containsKey 在接口中 Map<String,Collection<String>>public boolean containsValue(Object value)
containsValue 在接口中 Map<String,Collection<String>>public Collection<String> put(String key, Collection<String> value)
put 在接口中 Map<String,Collection<String>>public Collection<String> remove(Object key)
remove 在接口中 Map<String,Collection<String>>public void putAll(Map<? extends String,? extends Collection<String>> map)
putAll 在接口中 Map<String,Collection<String>>public void clear()
clear 在接口中 Map<String,Collection<String>>public Collection<Collection<String>> values()
values 在接口中 Map<String,Collection<String>>public Set<Map.Entry<String,Collection<String>>> entrySet()
entrySet 在接口中 Map<String,Collection<String>>public int hashCode()
public void addIfAbsent(String key, String value)
MultiValueMapaddIfAbsent 在接口中 MultiValueMap<String,String>key - the keyvalue - the value to be addedpublic int total()
total 在接口中 MultiValueMap<String,String>Copyright © 2021. All rights reserved.