Package io.micronaut.http.simple
Class SimpleHttpParameters
java.lang.Object
io.micronaut.http.simple.SimpleHttpParameters
- All Implemented Interfaces:
ConversionServiceAware
,ConversionServiceProvider
,ConvertibleMultiValues<String>
,ConvertibleValues<List<String>>
,ValueResolver<CharSequence>
,HttpParameters
,MutableHttpParameters
,Iterable<Map.Entry<String,
List<String>>>
Simple implementation of
MutableHttpParameters
.- Since:
- 1.0
- Author:
- Graeme Rocher, Vladimir Orany
-
Field Summary
Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY
-
Constructor Summary
ConstructorDescriptionSimpleHttpParameters
(ConversionService conversionService) SimpleHttpParameters
(Map<CharSequence, List<String>> values, ConversionService conversionService) -
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.names()
void
setConversionService
(ConversionService conversionService) Sets the conversion service.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 java.lang.Iterable
forEach, spliterator
Methods inherited from interface io.micronaut.http.MutableHttpParameters
add
Methods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get
-
Constructor Details
-
SimpleHttpParameters
public SimpleHttpParameters(Map<CharSequence, List<String>> values, ConversionService conversionService) - Parameters:
values
- The parameter valuesconversionService
- The conversion service
-
SimpleHttpParameters
- Parameters:
conversionService
- The conversion service
-
-
Method Details
-
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
-
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:
-
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
-
add
Description copied from interface:MutableHttpParameters
Adds a new http parameter.- Specified by:
add
in interfaceMutableHttpParameters
- Parameters:
name
- the name of the parametervalues
- the values of the parameter- Returns:
- self
-
setConversionService
Description copied from interface:ConversionServiceAware
Sets the conversion service.- Specified by:
setConversionService
in interfaceConversionServiceAware
- Parameters:
conversionService
- The conversion service
-