Package io.micronaut.http.netty
Class NettyHttpParameters
java.lang.Object
io.micronaut.http.netty.NettyHttpParameters
- All Implemented Interfaces:
ConversionServiceAware,ConversionServiceProvider,ConvertibleMultiValues<String>,ConvertibleValues<List<String>>,ValueResolver<CharSequence>,HttpParameters,MutableHttpParameters,Iterable<Map.Entry<String,List<String>>>
Implementation of
MutableHttpParameters for Netty.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionNettyHttpParameters(Map<String, List<String>> parameters, ConversionService conversionService, @Nullable BiConsumer<CharSequence, List<String>> onChange) -
Method Summary
Modifier and TypeMethodDescriptionadd(CharSequence name, List<CharSequence> values) Adds a new http parameter.get(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.Provides the conversion service.names()voidsetConversionService(ConversionService conversionService) Sets the conversion service.values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.convert.value.ConvertibleMultiValues
forEach, forEachValue, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iteratorMethods inherited from interface io.micronaut.core.convert.value.ConvertibleValues
asMap, asMap, asProperties, contains, getValue, getValueType, subMap, subMap, subMapMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface io.micronaut.http.MutableHttpParameters
addMethods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get
-
Constructor Details
-
NettyHttpParameters
public NettyHttpParameters(Map<String, List<String>> parameters, ConversionService conversionService, @Nullable @Nullable BiConsumer<CharSequence, List<String>> onChange) - Parameters:
parameters- The parametersconversionService- The conversion serviceonChange- A callback for changes
-
-
Method Details
-
names
- Specified by:
namesin interfaceConvertibleValues<List<String>>- Returns:
- The names of the values
-
values
- Specified by:
valuesin interfaceConvertibleValues<List<String>>- Returns:
- The values
-
getAll
Description copied from interface:ConvertibleMultiValuesGet all the values for the given name without applying conversion.- Specified by:
getAllin interfaceConvertibleMultiValues<String>- Parameters:
name- The header name- Returns:
- All the values
-
get
Description copied from interface:ConvertibleMultiValuesGet a value without applying any conversion.- Specified by:
getin interfaceConvertibleMultiValues<String>- Parameters:
name- The name of the value- Returns:
- The raw value or null
- See Also:
-
get
Description copied from interface:ValueResolverResolve the given property for the given name.- Specified by:
getin 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
-
add
Description copied from interface:MutableHttpParametersAdds a new http parameter.- Specified by:
addin interfaceMutableHttpParameters- Parameters:
name- the name of the parametervalues- the values of the parameter- Returns:
- self
-
getConversionService
Description copied from interface:ConversionServiceProviderProvides the conversion service.- Specified by:
getConversionServicein interfaceConversionServiceProvider- Specified by:
getConversionServicein interfaceConvertibleValues<List<String>>- Returns:
- the conversion service
-
setConversionService
Description copied from interface:ConversionServiceAwareSets the conversion service.- Specified by:
setConversionServicein interfaceConversionServiceAware- Parameters:
conversionService- The conversion service
-