Package io.micronaut.http.client.jdk
Class HttpHeadersAdapter
java.lang.Object
io.micronaut.http.client.jdk.HttpHeadersAdapter
- All Implemented Interfaces:
ConversionServiceProvider
,ConvertibleMultiValues<String>
,ConvertibleValues<List<String>>
,Headers
,ValueResolver<CharSequence>
,HttpHeaders
,Iterable<Map.Entry<String,
List<String>>>
Adapter from
HttpHeaders
into HttpHeaders
.- Since:
- 4.0.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY
Fields inherited from interface io.micronaut.http.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, STANDARD_HEADERS, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, VIEWPORT_WIDTH, WARNING, WEBSOCKET_LOCATION, WEBSOCKET_ORIGIN, WEBSOCKET_PROTOCOL, WIDTH, WWW_AUTHENTICATE, X_AUTH_TOKEN
-
Constructor Summary
ConstructorDescriptionHttpHeadersAdapter
(HttpHeaders httpHeaders, ConversionService conversionService) -
Method Summary
Modifier and TypeMethodDescriptionget
(CharSequence name) Get a value without applying any conversion.<T> Optional<T>
get
(CharSequence name, ArgumentConversionContext<T> conversionContext) Resolve the given property for the given name.getAll
(CharSequence name) Get all the values for the given name without applying conversion.names()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.convert.value.ConvertibleMultiValues
forEach, forEachValue, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iterator
Methods inherited from interface io.micronaut.core.convert.value.ConvertibleValues
asMap, asMap, asProperties, contains, getConversionService, getValue, getValueType, subMap, subMap, subMap
Methods inherited from interface io.micronaut.http.HttpHeaders
accept, acceptCharset, acceptLanguage, contentLength, contentType, findDate, findFirst, findInt, getAuthorization, getContentType, getDate, getInt, getOrigin, isKeepAlive
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get
-
Constructor Details
-
HttpHeadersAdapter
- Parameters:
httpHeaders
- HTTP Headers.conversionService
- Conversion Service.
-
-
Method Details
-
getAll
Description copied from interface:ConvertibleMultiValues
Get all the values for the given name without applying conversion.- Specified by:
getAll
in interfaceConvertibleMultiValues<String>
- Parameters:
name
- The header name- Returns:
- All the values
-
get
Description copied from interface:ConvertibleMultiValues
Get a value without applying any conversion.- Specified by:
get
in interfaceConvertibleMultiValues<String>
- Parameters:
name
- The name of the value- Returns:
- The raw value or null
- See Also:
-
names
- Specified by:
names
in interfaceConvertibleValues<List<String>>
- Returns:
- The names of the values
-
values
- Specified by:
values
in interfaceConvertibleValues<List<String>>
- Returns:
- The values
-
get
Description copied from interface:ValueResolver
Resolve the given property for the given name.- Specified by:
get
in interfaceValueResolver<CharSequence>
- Type Parameters:
T
- The concrete type- Parameters:
name
- The nameconversionContext
- The conversion context- Returns:
- An optional containing the property value if it exists and is able to be converted
-