@Internal public class NettyHttpHeaders extends java.lang.Object implements MutableHttpHeaders
HttpHeaders
.ACCEPT, ACCEPT_CH, ACCEPT_CH_LIFETIME, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_PATCH, ACCEPT_RANGES, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, AGE, ALLOW, AUTHORIZATION, AUTHORIZATION_INFO, CACHE_CONTROL, CONNECTION, CONTENT_BASE, CONTENT_DISPOSITION, CONTENT_DPR, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, CROSS_ORIGIN_RESOURCE_POLICY, DATE, DEVICE_MEMORY, DOWNLINK, DPR, ECT, ETAG, EXPECT, EXPIRES, FEATURE_POLICY, FORWARDED, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, REFERRER_POLICY, RETRY_AFTER, RTT, SAVE_DATA, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_KEY1, SEC_WEBSOCKET_KEY2, SEC_WEBSOCKET_LOCATION, SEC_WEBSOCKET_ORIGIN, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION, SERVER, SET_COOKIE, SET_COOKIE2, SOURCE_MAP, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, VIEWPORT_WIDTH, WARNING, WEBSOCKET_LOCATION, WEBSOCKET_ORIGIN, WEBSOCKET_PROTOCOL, WIDTH, WWW_AUTHENTICATE, X_AUTH_TOKEN
EMPTY
Constructor and Description |
---|
NettyHttpHeaders()
Default constructor.
|
NettyHttpHeaders(io.netty.handler.codec.http.HttpHeaders nettyHeaders,
ConversionService conversionService) |
Modifier and Type | Method and Description |
---|---|
MutableHttpHeaders |
add(java.lang.CharSequence header,
java.lang.CharSequence value)
Add a header for the given name and value.
|
boolean |
contains(java.lang.String name)
Whether the given key is contained within these values.
|
java.lang.String |
get(java.lang.CharSequence name)
Get a value without applying any conversion.
|
<T> java.util.Optional<T> |
get(java.lang.CharSequence name,
ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name.
|
java.util.List<java.lang.String> |
getAll(java.lang.CharSequence name)
Get all the values for the given name without applying conversion.
|
io.netty.handler.codec.http.HttpHeaders |
getNettyHeaders() |
java.util.Set<java.lang.String> |
names() |
MutableHttpHeaders |
remove(java.lang.CharSequence header)
Removes a header.
|
MutableHeaders |
set(java.lang.CharSequence header,
java.lang.CharSequence value)
Sets an HTTP header overriding any existing value.
|
java.util.Collection<java.util.List<java.lang.String>> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, allow, allow, allowGeneric, auth, auth, contentType, date, date, expires, expires, ifModifiedSince, ifModifiedSince, lastModified, lastModified, location
accept, contentLength, contentType, findDate, findFirst, findInt, getAuthorization, getContentType, getDate, getInt, getOrigin, isKeepAlive
empty, forEach, forEachValue, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iterator, of
asMap, asMap, asProperties, getValue, getValueType, of, subMap, subMap, subMap
get, get, get
public NettyHttpHeaders(io.netty.handler.codec.http.HttpHeaders nettyHeaders, ConversionService conversionService)
nettyHeaders
- The Netty Http headersconversionService
- The conversion servicepublic NettyHttpHeaders()
public io.netty.handler.codec.http.HttpHeaders getNettyHeaders()
public final boolean contains(java.lang.String name)
ConvertibleValues
contains
in interface ConvertibleValues<java.util.List<java.lang.String>>
name
- The key namepublic <T> java.util.Optional<T> get(java.lang.CharSequence name, ArgumentConversionContext<T> conversionContext)
ValueResolver
get
in interface ValueResolver<java.lang.CharSequence>
T
- The concrete typename
- The nameconversionContext
- The conversion contextpublic java.util.List<java.lang.String> getAll(java.lang.CharSequence name)
ConvertibleMultiValues
getAll
in interface ConvertibleMultiValues<java.lang.String>
name
- The header namepublic java.util.Set<java.lang.String> names()
names
in interface ConvertibleValues<java.util.List<java.lang.String>>
public java.util.Collection<java.util.List<java.lang.String>> values()
values
in interface ConvertibleValues<java.util.List<java.lang.String>>
public java.lang.String get(java.lang.CharSequence name)
ConvertibleMultiValues
get
in interface ConvertibleMultiValues<java.lang.String>
name
- The name of the valueConvertibleMultiValues.getFirst(CharSequence)
public MutableHttpHeaders add(java.lang.CharSequence header, java.lang.CharSequence value)
MutableHttpHeaders
add
in interface MutableHeaders
add
in interface MutableHttpHeaders
header
- The header namevalue
- The valuepublic MutableHeaders set(java.lang.CharSequence header, java.lang.CharSequence value)
MutableHeaders
set
in interface MutableHeaders
set
in interface MutableHttpHeaders
header
- The headervalue
- The valuepublic MutableHttpHeaders remove(java.lang.CharSequence header)
MutableHeaders
remove
in interface MutableHeaders
remove
in interface MutableHttpHeaders
header
- The header to remove