Package io.micronaut.core.convert.value
Class MutableConvertibleMultiValuesMap<V>
- java.lang.Object
-
- io.micronaut.core.convert.value.ConvertibleMultiValuesMap<V>
-
- io.micronaut.core.convert.value.MutableConvertibleMultiValuesMap<V>
-
- Type Parameters:
V
- The generic value
- All Implemented Interfaces:
ConvertibleMultiValues<V>
,ConvertibleValues<java.util.List<V>>
,MutableConvertibleMultiValues<V>
,MutableConvertibleValues<java.util.List<V>>
,ValueResolver<java.lang.CharSequence>
,java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.util.List<V>>>
public class MutableConvertibleMultiValuesMap<V> extends ConvertibleMultiValuesMap<V> implements MutableConvertibleMultiValues<V>
Implementation ofMutableConvertibleMultiValues
that operates against a backingLinkedHashMap
.- Since:
- 1.0
-
-
Field Summary
-
Fields inherited from class io.micronaut.core.convert.value.ConvertibleMultiValuesMap
EMPTY, values
-
Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY
-
-
Constructor Summary
Constructors Constructor Description MutableConvertibleMultiValuesMap()
Default constructor.MutableConvertibleMultiValuesMap(java.util.Map<java.lang.CharSequence,java.util.List<V>> values)
MutableConvertibleMultiValuesMap(java.util.Map<java.lang.CharSequence,java.util.List<V>> values, ConversionService<?> conversionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MutableConvertibleMultiValues<V>
add(java.lang.CharSequence key, V value)
Adds a value for the given key.MutableConvertibleMultiValues<V>
clear()
Clear all values.MutableConvertibleValues<java.util.List<V>>
put(java.lang.CharSequence key, java.util.List<V> value)
Insert a value for the given key and value.MutableConvertibleValues<java.util.List<V>>
remove(java.lang.CharSequence key)
Remove a value for the given key.MutableConvertibleMultiValues<V>
remove(java.lang.CharSequence key, V value)
Remove the given value from the given key.protected java.util.Map<java.lang.CharSequence,java.util.List<V>>
wrapValues(java.util.Map<java.lang.CharSequence,java.util.List<V>> values)
Wraps the values (by default in an unmodifiable map).-
Methods inherited from class io.micronaut.core.convert.value.ConvertibleMultiValuesMap
equals, get, get, getAll, hashCode, names, values
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.convert.value.ConvertibleMultiValues
forEach, forEachValue, get, getAll, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iterator
-
Methods inherited from interface io.micronaut.core.convert.value.ConvertibleValues
asMap, asMap, asProperties, contains, getValue, getValueType, names, subMap, subMap, subMap, values
-
Methods inherited from interface io.micronaut.core.convert.value.MutableConvertibleValues
putAll, putAll
-
Methods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get, get
-
-
-
-
Constructor Detail
-
MutableConvertibleMultiValuesMap
public MutableConvertibleMultiValuesMap()
Default constructor.
-
MutableConvertibleMultiValuesMap
public MutableConvertibleMultiValuesMap(java.util.Map<java.lang.CharSequence,java.util.List<V>> values)
- Parameters:
values
- The values
-
MutableConvertibleMultiValuesMap
public MutableConvertibleMultiValuesMap(java.util.Map<java.lang.CharSequence,java.util.List<V>> values, ConversionService<?> conversionService)
- Parameters:
values
- The valuesconversionService
- The conversion service
-
-
Method Detail
-
add
public MutableConvertibleMultiValues<V> add(java.lang.CharSequence key, V value)
Description copied from interface:MutableConvertibleMultiValues
Adds a value for the given key. Note that this method will not remove items currently associated with the key.- Specified by:
add
in interfaceMutableConvertibleMultiValues<V>
- Parameters:
key
- The keyvalue
- The value- Returns:
- This instance
-
put
public MutableConvertibleValues<java.util.List<V>> put(java.lang.CharSequence key, java.util.List<V> value)
Description copied from interface:MutableConvertibleValues
Insert a value for the given key and value.- Specified by:
put
in interfaceMutableConvertibleValues<V>
- Parameters:
key
- The keyvalue
- The value- Returns:
- This values instance
-
remove
public MutableConvertibleValues<java.util.List<V>> remove(java.lang.CharSequence key)
Description copied from interface:MutableConvertibleValues
Remove a value for the given key.- Specified by:
remove
in interfaceMutableConvertibleValues<V>
- Parameters:
key
- The key- Returns:
- This values instance
-
remove
public MutableConvertibleMultiValues<V> remove(java.lang.CharSequence key, V value)
Description copied from interface:MutableConvertibleMultiValues
Remove the given value from the given key.- Specified by:
remove
in interfaceMutableConvertibleMultiValues<V>
- Parameters:
key
- The keyvalue
- The value- Returns:
- This instance
-
clear
public MutableConvertibleMultiValues<V> clear()
Description copied from interface:MutableConvertibleMultiValues
Clear all values.- Specified by:
clear
in interfaceMutableConvertibleMultiValues<V>
- Specified by:
clear
in interfaceMutableConvertibleValues<V>
- Returns:
- This instance
-
wrapValues
protected java.util.Map<java.lang.CharSequence,java.util.List<V>> wrapValues(java.util.Map<java.lang.CharSequence,java.util.List<V>> values)
Description copied from class:ConvertibleMultiValuesMap
Wraps the values (by default in an unmodifiable map).- Overrides:
wrapValues
in classConvertibleMultiValuesMap<V>
- Parameters:
values
- The values- Returns:
- The wrapped values.
-
-